org.jboss.osgi.resolver.spi
Class AbstractBundleRevision

java.lang.Object
  extended by org.jboss.osgi.resolver.spi.AbstractResource
      extended by org.jboss.osgi.resolver.spi.AbstractBundleRevision
All Implemented Interfaces:
XAttachmentSupport, XBundleRevision, XElement, XResource, org.osgi.framework.BundleReference, org.osgi.framework.wiring.BundleRevision, org.osgi.resource.Resource

public class AbstractBundleRevision
extends AbstractResource
implements XBundleRevision

The abstract implementation of an XBundleRevision.

Since:
30-May-2012
Author:
thomas.diesler@jboss.com

Field Summary
 
Fields inherited from interface org.osgi.framework.wiring.BundleRevision
BUNDLE_NAMESPACE, HOST_NAMESPACE, PACKAGE_NAMESPACE, TYPE_FRAGMENT
 
Constructor Summary
AbstractBundleRevision()
           
 
Method Summary
<T> T
addAttachment(Class<T> clazz, T value)
          Attach an arbirtary object with this element.
 Enumeration<URL> findEntries(String path, String filePattern, boolean recursive)
           
<T> T
getAttachment(Class<T> clazz)
          Get the attached object for a given key
 XBundle getBundle()
          Get the associated XBundle
 List<org.osgi.framework.wiring.BundleCapability> getDeclaredCapabilities(String namespace)
           
 List<org.osgi.framework.wiring.BundleRequirement> getDeclaredRequirements(String namespace)
           
 URL getEntry(String path)
           
 Enumeration<String> getEntryPaths(String path)
           
 org.jboss.modules.ModuleClassLoader getModuleClassLoader()
          Get the associated ModuleIdentifier or null if the revision is not resolved
 org.jboss.modules.ModuleIdentifier getModuleIdentifier()
          Get the associated ModuleIdentifier or null if the revision is not resolved
 URL getResource(String name)
           
 Enumeration<URL> getResources(String name)
           
 String getSymbolicName()
           
 int getTypes()
           
 org.osgi.framework.Version getVersion()
           
 org.osgi.framework.wiring.BundleWiring getWiring()
           
<T> T
removeAttachment(Class<T> clazz)
          Remove an attached object for a given key
 
Methods inherited from class org.jboss.osgi.resolver.spi.AbstractResource
addCapability, addRequirement, getCapabilities, getIdentityCapability, getRequirements, isFragment, isMutable, makeImmutable, toString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.osgi.resolver.XResource
getIdentityCapability, isFragment, isMutable, makeImmutable, validate
 
Methods inherited from interface org.jboss.osgi.resolver.XAttachmentSupport
addAttachment, getAttachment, removeAttachment
 
Methods inherited from interface org.osgi.framework.wiring.BundleRevision
getCapabilities, getRequirements
 
Methods inherited from interface org.osgi.resource.Resource
equals, hashCode
 

Constructor Detail

AbstractBundleRevision

public AbstractBundleRevision()
Method Detail

getSymbolicName

public String getSymbolicName()
Specified by:
getSymbolicName in interface org.osgi.framework.wiring.BundleRevision

getVersion

public org.osgi.framework.Version getVersion()
Specified by:
getVersion in interface org.osgi.framework.wiring.BundleRevision

getDeclaredCapabilities

public List<org.osgi.framework.wiring.BundleCapability> getDeclaredCapabilities(String namespace)
Specified by:
getDeclaredCapabilities in interface org.osgi.framework.wiring.BundleRevision

getDeclaredRequirements

public List<org.osgi.framework.wiring.BundleRequirement> getDeclaredRequirements(String namespace)
Specified by:
getDeclaredRequirements in interface org.osgi.framework.wiring.BundleRevision

getTypes

public int getTypes()
Specified by:
getTypes in interface org.osgi.framework.wiring.BundleRevision

getWiring

public org.osgi.framework.wiring.BundleWiring getWiring()
Specified by:
getWiring in interface org.osgi.framework.wiring.BundleRevision

getBundle

public XBundle getBundle()
Description copied from interface: XBundleRevision
Get the associated XBundle

Specified by:
getBundle in interface XBundleRevision
Specified by:
getBundle in interface org.osgi.framework.BundleReference

getModuleIdentifier

public org.jboss.modules.ModuleIdentifier getModuleIdentifier()
Description copied from interface: XBundleRevision
Get the associated ModuleIdentifier or null if the revision is not resolved

Specified by:
getModuleIdentifier in interface XBundleRevision

getModuleClassLoader

public org.jboss.modules.ModuleClassLoader getModuleClassLoader()
Description copied from interface: XBundleRevision
Get the associated ModuleIdentifier or null if the revision is not resolved

Specified by:
getModuleClassLoader in interface XBundleRevision

findEntries

public Enumeration<URL> findEntries(String path,
                                    String filePattern,
                                    boolean recursive)
Specified by:
findEntries in interface XBundleRevision
See Also:
Bundle#findEntries(String, String, boolean)}

getResource

public URL getResource(String name)
Specified by:
getResource in interface XBundleRevision
See Also:
Bundle#getResource(String)}

getResources

public Enumeration<URL> getResources(String name)
                              throws IOException
Specified by:
getResources in interface XBundleRevision
Throws:
IOException
See Also:
Bundle#getResources(String)}

getEntry

public URL getEntry(String path)
Specified by:
getEntry in interface XBundleRevision
See Also:
Bundle#getEntry(String)}

getEntryPaths

public Enumeration<String> getEntryPaths(String path)
Specified by:
getEntryPaths in interface XBundleRevision
See Also:
Bundle#getEntryPaths(String)}

addAttachment

public <T> T addAttachment(Class<T> clazz,
                           T value)
Description copied from interface: XAttachmentSupport
Attach an arbirtary object with this element.

Specified by:
addAttachment in interface XAttachmentSupport
Parameters:
clazz - key for the attachment
Returns:
The previously attachment object or null

getAttachment

public <T> T getAttachment(Class<T> clazz)
Description copied from interface: XAttachmentSupport
Get the attached object for a given key

Specified by:
getAttachment in interface XAttachmentSupport
Parameters:
clazz - key for the attachment
Returns:
The attached object or null

removeAttachment

public <T> T removeAttachment(Class<T> clazz)
Description copied from interface: XAttachmentSupport
Remove an attached object for a given key

Specified by:
removeAttachment in interface XAttachmentSupport
Parameters:
clazz - key for the attachment
Returns:
The attached object or null


Copyright © 2012 JBoss by Red Hat. All Rights Reserved.