org.jboss.osgi.resolver.spi
Class AbstractDynamicPackageRequirement

java.lang.Object
  extended by org.jboss.osgi.resolver.spi.AbstractPackageRequirement
      extended by org.jboss.osgi.resolver.spi.AbstractDynamicPackageRequirement
All Implemented Interfaces:
XAttachmentSupport, XAttributeSupport, XDirectiveSupport, XElement, XPackageRequirement, XRequirement

public class AbstractDynamicPackageRequirement
extends AbstractPackageRequirement

The abstract implementation of a XPackageRequirement.

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

Constructor Summary
AbstractDynamicPackageRequirement(AbstractModule module, String name, Map<String,String> dirs, Map<String,Object> atts)
           
 
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
 Object getAttribute(String key)
          Get the value of the given attribute
 Map<String,Object> getAttributes()
          Get the attributes
 String getDirective(String key)
          Get the value of the given directive
 Map<String,String> getDirectives()
          Get the directives
 XModule getModule()
          Get associated module.
 String getName()
          Get the name for this capability.
 XCapability getWiredCapability()
          Get the wired capbillity for this requirement.
 boolean isDynamic()
          True if this is a dynamic requirement.
 boolean isOptional()
          True if this requirement is optional
 boolean matchPackageName(XPackageCapability cap)
           
<T> T
removeAttachment(Class<T> clazz)
          Remove an attached object for a given key
 String toString()
           
 
Methods inherited from class org.jboss.osgi.resolver.spi.AbstractPackageRequirement
getBundleSymbolicName, getBundleVersion, getResolution, getVersionRange, match
 
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.XPackageRequirement
isDynamic
 
Methods inherited from interface org.jboss.osgi.resolver.XRequirement
getModule, getWiredCapability, isOptional
 
Methods inherited from interface org.jboss.osgi.resolver.XElement
getName
 
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.jboss.osgi.resolver.XAttachmentSupport
addAttachment, getAttachment, removeAttachment
 

Constructor Detail

AbstractDynamicPackageRequirement

public AbstractDynamicPackageRequirement(AbstractModule module,
                                         String name,
                                         Map<String,String> dirs,
                                         Map<String,Object> atts)
Method Detail

matchPackageName

public boolean matchPackageName(XPackageCapability cap)
Overrides:
matchPackageName in class AbstractPackageRequirement

toString

public String toString()
Overrides:
toString in class AbstractPackageRequirement

getModule

public XModule getModule()
Description copied from interface: XRequirement
Get associated module.

Specified by:
getModule in interface XRequirement

isOptional

public boolean isOptional()
Description copied from interface: XRequirement
True if this requirement is optional

Specified by:
isOptional in interface XRequirement

isDynamic

public boolean isDynamic()
Description copied from interface: XRequirement
True if this is a dynamic requirement.

Specified by:
isDynamic in interface XRequirement

getWiredCapability

public XCapability getWiredCapability()
Description copied from interface: XRequirement
Get the wired capbillity for this requirement.

Specified by:
getWiredCapability in interface XRequirement
Returns:
The wired capabillity or null

getAttribute

public Object getAttribute(String key)
Description copied from interface: XAttributeSupport
Get the value of the given attribute

Specified by:
getAttribute in interface XAttributeSupport
Returns:
null if no such attribute is associated with this capability

getAttributes

public Map<String,Object> getAttributes()
Description copied from interface: XAttributeSupport
Get the attributes

Specified by:
getAttributes in interface XAttributeSupport

getDirective

public String getDirective(String key)
Description copied from interface: XDirectiveSupport
Get the value of the given directive

Specified by:
getDirective in interface XDirectiveSupport
Returns:
null if no such directive is associated with this capability

getDirectives

public Map<String,String> getDirectives()
Description copied from interface: XDirectiveSupport
Get the directives

Specified by:
getDirectives in interface XDirectiveSupport

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

getName

public String getName()
Description copied from interface: XElement
Get the name for this capability.

Specified by:
getName in interface XElement


Copyright © 2012. All Rights Reserved.