org.jboss.osgi.resolver.spi
Class AbstractBundleRevision

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

public class AbstractBundleRevision
extends Object
implements XResource, org.osgi.framework.wiring.BundleRevision

The abstract implementation of a BundleRevision.

Since:
02-Jul-2010
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(XResource resource)
           
 
Method Summary
<T> T
adapt(Class<T> clazz)
           
<T> T
addAttachment(Class<T> clazz, T value)
          Attach an arbirtary object with this element.
<T> T
getAttachment(Class<T> clazz)
          Get the attached object for a given key
 org.osgi.framework.Bundle getBundle()
           
 List<org.osgi.framework.resource.Capability> getCapabilities(String namespace)
           
 List<org.osgi.framework.wiring.BundleCapability> getDeclaredCapabilities(String namespace)
           
 List<org.osgi.framework.wiring.BundleRequirement> getDeclaredRequirements(String namespace)
           
 XIdentityCapability getIdentityCapability()
           
 List<org.osgi.framework.resource.Requirement> getRequirements(String namespace)
           
 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
 String toString()
           
 
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.XElement
adapt
 
Methods inherited from interface org.jboss.osgi.resolver.XAttachmentSupport
addAttachment, getAttachment, removeAttachment
 

Constructor Detail

AbstractBundleRevision

public AbstractBundleRevision(XResource resource)
Method Detail

getIdentityCapability

public XIdentityCapability getIdentityCapability()
Specified by:
getIdentityCapability in interface XResource

getCapabilities

public List<org.osgi.framework.resource.Capability> getCapabilities(String namespace)
Specified by:
getCapabilities in interface org.osgi.framework.resource.Resource
Specified by:
getCapabilities in interface org.osgi.framework.wiring.BundleRevision

getRequirements

public List<org.osgi.framework.resource.Requirement> getRequirements(String namespace)
Specified by:
getRequirements in interface org.osgi.framework.resource.Resource
Specified by:
getRequirements in interface org.osgi.framework.wiring.BundleRevision

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 org.osgi.framework.Bundle getBundle()
Specified by:
getBundle in interface org.osgi.framework.BundleReference

toString

public String toString()
Overrides:
toString in class Object

adapt

public <T> T adapt(Class<T> clazz)
Specified by:
adapt in interface XElement

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. All Rights Reserved.