org.jboss.osgi.resolver.spi
Class AbstractIdentityCapability

java.lang.Object
  extended by org.jboss.osgi.resolver.spi.AbstractCapability
      extended by org.jboss.osgi.resolver.spi.AbstractIdentityCapability
All Implemented Interfaces:
XAttachmentSupport, XAttributeSupport, XCapability, XDirectiveSupport, XElement, XIdentityCapability, Capability

public class AbstractIdentityCapability
extends AbstractCapability
implements XIdentityCapability

The abstract implementation of a XIdentityCapability.

Since:
02-Jul-2010
Author:
thomas.diesler@jboss.com

Constructor Summary
protected AbstractIdentityCapability(Resource resource, Map<String,Object> atts, Map<String,String> dirs)
           
 
Method Summary
<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
protected  Set<String> getMandatoryAttributes()
           
 String getSymbolicName()
          The symbolic name of this resource.
 String getType()
          The resource type
 Version getVersion()
          The version of this resource.
 boolean isSingleton()
          A flag to indicate that this resource is a singleton
<T> T
removeAttachment(Class<T> clazz)
          Remove an attached object for a given key
 
Methods inherited from class org.jboss.osgi.resolver.spi.AbstractCapability
getAttribute, getAttributes, getDirective, getDirectives, getNamespace, getResource, toString, validateAttributes
 
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.XAttachmentSupport
addAttachment, getAttachment, removeAttachment
 
Methods inherited from interface org.jboss.osgi.resolver.XAttributeSupport
getAttribute, getAttributes
 
Methods inherited from interface org.jboss.osgi.resolver.XDirectiveSupport
getDirective, getDirectives
 
Methods inherited from interface org.osgi.resource.Capability
equals, getAttributes, getDirectives, getNamespace, getResource, hashCode
 

Constructor Detail

AbstractIdentityCapability

protected AbstractIdentityCapability(Resource resource,
                                     Map<String,Object> atts,
                                     Map<String,String> dirs)
Method Detail

getMandatoryAttributes

protected Set<String> getMandatoryAttributes()
Overrides:
getMandatoryAttributes in class AbstractCapability

getSymbolicName

public String getSymbolicName()
Description copied from interface: XIdentityCapability
The symbolic name of this resource.

Specified by:
getSymbolicName in interface XIdentityCapability

getVersion

public Version getVersion()
Description copied from interface: XIdentityCapability
The version of this resource.

Specified by:
getVersion in interface XIdentityCapability

getType

public String getType()
Description copied from interface: XIdentityCapability
The resource type

Specified by:
getType in interface XIdentityCapability
See Also:
IdentityNamespace.CAPABILITY_TYPE_ATTRIBUTE

isSingleton

public boolean isSingleton()
Description copied from interface: XIdentityCapability
A flag to indicate that this resource is a singleton

Specified by:
isSingleton in interface XIdentityCapability

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.