org.jboss.osgi.resolver.spi
Class AbstractBundleRequirement

java.lang.Object
  extended by org.jboss.osgi.resolver.spi.AbstractElement
      extended by org.jboss.osgi.resolver.spi.AbstractRequirement
          extended by org.jboss.osgi.resolver.spi.AbstractBundleRequirement
All Implemented Interfaces:
XAttachmentSupport, XAttributeSupport, XBundleRequirement, XDirectiveSupport, XElement, XHostRequirement, XPackageRequirement, XRequirement, XResourceRequirement, BundleRequirement, Requirement

public class AbstractBundleRequirement
extends AbstractRequirement
implements XBundleRequirement

The abstract implementation of an XBundleRequirement.

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

Constructor Summary
AbstractBundleRequirement(XResource resource, String namespace, Map<String,Object> atts, Map<String,String> dirs)
           
 
Method Summary
 BundleRevision getResource()
          Returns the resource declaring this requirement.
 BundleRevision getRevision()
          Returns the bundle revision declaring this requirement.
 boolean matches(BundleCapability cap)
          Returns whether the specified capability matches this requirement.
 
Methods inherited from class org.jboss.osgi.resolver.spi.AbstractRequirement
adapt, ensureImmutable, ensureMutable, getAttribute, getAttributes, getDirective, getDirectives, getFilterFromDirective, getNamespace, getPackageName, getSymbolicName, getVersionRange, getVisibility, isDynamic, isMutable, isOptional, matches, namespaceValueFromFilter, toString, validate
 
Methods inherited from class org.jboss.osgi.resolver.spi.AbstractElement
addAttachment, getAttachment, removeAttachment
 
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.XRequirement
adapt, isOptional, matches, validate
 
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.framework.wiring.BundleRequirement
getAttributes, getDirectives, getNamespace
 
Methods inherited from interface org.osgi.resource.Requirement
equals, hashCode
 

Constructor Detail

AbstractBundleRequirement

public AbstractBundleRequirement(XResource resource,
                                 String namespace,
                                 Map<String,Object> atts,
                                 Map<String,String> dirs)
Method Detail

getResource

public BundleRevision getResource()
Description copied from interface: Requirement
Returns the resource declaring this requirement.

Specified by:
getResource in interface BundleRequirement
Specified by:
getResource in interface Requirement
Overrides:
getResource in class AbstractRequirement
Returns:
The resource declaring this requirement. This can be null if this requirement is synthesized.

getRevision

public BundleRevision getRevision()
Description copied from interface: BundleRequirement
Returns the bundle revision declaring this requirement.

Specified by:
getRevision in interface BundleRequirement
Returns:
The bundle revision declaring this requirement.

matches

public boolean matches(BundleCapability cap)
Description copied from interface: BundleRequirement
Returns whether the specified capability matches this requirement.

Specified by:
matches in interface BundleRequirement
Parameters:
cap - The capability to match to this requirement.
Returns:
true if the specified capability has the same namespace as this requirement and the filter for this requirement matches the attributes of the specified capability; false otherwise.


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