org.jboss.osgi.resolver.v2.spi
Class AbstractBundleRequirement

java.lang.Object
  extended by org.jboss.osgi.resolver.v2.spi.AbstractRequirement
      extended by org.jboss.osgi.resolver.v2.spi.AbstractBundleRequirement
All Implemented Interfaces:
XAttachmentSupport, XAttributeSupport, XDirectiveSupport, XElement, XRequirement, org.osgi.framework.resource.Requirement, org.osgi.framework.wiring.BundleRequirement

public class AbstractBundleRequirement
extends AbstractRequirement
implements org.osgi.framework.wiring.BundleRequirement

The abstract implementation of a BundleRequirement.

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

Constructor Summary
AbstractBundleRequirement(org.osgi.framework.wiring.BundleRevision brev, String namespace, 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
 org.osgi.framework.wiring.BundleRevision getResource()
           
 org.osgi.framework.wiring.BundleRevision getRevision()
           
 boolean matches(org.osgi.framework.wiring.BundleCapability cap)
           
<T> T
removeAttachment(Class<T> clazz)
          Remove an attached object for a given key
 
Methods inherited from class org.jboss.osgi.resolver.v2.spi.AbstractRequirement
getAttribute, getAttributes, getDirective, getDirectives, getMandatoryAttributes, getNamespace, isOptional, matches, matchFilterValue, matchNamespaceValue, toString, validateAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.osgi.framework.wiring.BundleRequirement
getAttributes, getDirectives, getNamespace
 
Methods inherited from interface org.osgi.framework.resource.Requirement
matches
 
Methods inherited from interface org.jboss.osgi.resolver.v2.XAttachmentSupport
addAttachment, getAttachment, removeAttachment
 

Constructor Detail

AbstractBundleRequirement

public AbstractBundleRequirement(org.osgi.framework.wiring.BundleRevision brev,
                                 String namespace,
                                 Map<String,Object> atts,
                                 Map<String,String> dirs)
Method Detail

getRevision

public org.osgi.framework.wiring.BundleRevision getRevision()
Specified by:
getRevision in interface org.osgi.framework.wiring.BundleRequirement

getResource

public org.osgi.framework.wiring.BundleRevision getResource()
Specified by:
getResource in interface org.osgi.framework.resource.Requirement
Specified by:
getResource in interface org.osgi.framework.wiring.BundleRequirement
Overrides:
getResource in class AbstractRequirement

matches

public boolean matches(org.osgi.framework.wiring.BundleCapability cap)
Specified by:
matches in interface org.osgi.framework.wiring.BundleRequirement

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.