org.eclipse.osgi.internal.resolver
Class GenericSpecificationImpl

java.lang.Object
  extended by org.eclipse.osgi.internal.resolver.GenericSpecificationImpl
All Implemented Interfaces:
java.lang.Cloneable, GenericSpecification, VersionConstraint

public class GenericSpecificationImpl
extends java.lang.Object
implements GenericSpecification


Field Summary
protected  java.lang.Object monitor
           
 
Fields inherited from interface org.eclipse.osgi.service.resolver.GenericSpecification
RESOLUTION_MULTIPLE, RESOLUTION_OPTIONAL
 
Constructor Summary
GenericSpecificationImpl()
           
 
Method Summary
 BundleDescription getBundle()
          Returns the bundle that declares this constraint.
protected  java.util.Map<java.lang.String,java.lang.Object> getInteralAttributes()
           
protected  java.util.Map<java.lang.String,java.lang.String> getInternalDirectives()
           
protected  java.lang.String getInternalNameSpace()
           
 java.lang.String getMatchingFilter()
          Returns a matching filter used to match with a suppliers attributes
 java.lang.String getName()
          Returns this constraint's name.
 BundleRequirement getRequirement()
          Returns the requirement represented by this constraint.
 int getResolution()
          Returns the resolution type of the required capability.
 BaseDescription getSupplier()
          Returns the supplier that satisfies this constraint, if it is resolved.
 GenericDescription[] getSuppliers()
          Returns the suppliers of the capability.
 java.lang.String getType()
          Returns the type of generic specification
 VersionRange getVersionRange()
          Returns the version range for this constraint.
 boolean isResolved()
          Returns whether this constraint is resolved.
 boolean isSatisfiedBy(BaseDescription supplier)
          Returns whether this constraint could be satisfied by the given supplier.
protected  void setBundle(BundleDescription bundle)
           
protected  void setName(java.lang.String name)
           
protected  void setSupplier(BaseDescription supplier)
           
protected  void setVersionRange(VersionRange versionRange)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.osgi.service.resolver.VersionConstraint
getBundle, getName, getRequirement, getVersionRange
 

Field Detail

monitor

protected final java.lang.Object monitor
Constructor Detail

GenericSpecificationImpl

public GenericSpecificationImpl()
Method Detail

getMatchingFilter

public java.lang.String getMatchingFilter()
Description copied from interface: GenericSpecification
Returns a matching filter used to match with a suppliers attributes

Specified by:
getMatchingFilter in interface GenericSpecification
Returns:
a matching filter used to match with a suppliers attributes

isSatisfiedBy

public boolean isSatisfiedBy(BaseDescription supplier)
Description copied from interface: VersionConstraint
Returns whether this constraint could be satisfied by the given supplier. This will depend on the suppliers different attributes including its name, versions and other arbitrary attributes

Specified by:
isSatisfiedBy in interface VersionConstraint
Parameters:
supplier - a supplier to be tested against this constraint (may be null)
Returns:
true if this constraint could be resolved using the supplier, false otherwise

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getType

public java.lang.String getType()
Description copied from interface: GenericSpecification
Returns the type of generic specification

Specified by:
getType in interface GenericSpecification
Returns:
the type of generic specification

getResolution

public int getResolution()
Description copied from interface: GenericSpecification
Returns the resolution type of the required capability. The returned value is a bit mask that may have the optional bit GenericSpecification.RESOLUTION_OPTIONAL and/or the multiple bit GenericSpecification.RESOLUTION_MULTIPLE set.

Specified by:
getResolution in interface GenericSpecification
Returns:
the resolution type of the required capability

isResolved

public boolean isResolved()
Description copied from interface: VersionConstraint
Returns whether this constraint is resolved. A resolved constraint is guaranteed to have its supplier defined.

Specified by:
isResolved in interface VersionConstraint
Returns:
true if this bundle is resolved, false otherwise

getSupplier

public BaseDescription getSupplier()
Description copied from interface: VersionConstraint
Returns the supplier that satisfies this constraint, if it is resolved.

Specified by:
getSupplier in interface VersionConstraint
Returns:
a supplier, or null
See Also:
VersionConstraint.isResolved()

setSupplier

protected void setSupplier(BaseDescription supplier)

getSuppliers

public GenericDescription[] getSuppliers()
Description copied from interface: GenericSpecification
Returns the suppliers of the capability. If the the resolution is multiple then more than one supplier may be returned

Specified by:
getSuppliers in interface GenericSpecification
Returns:
the suppliers of the capability

getInternalDirectives

protected java.util.Map<java.lang.String,java.lang.String> getInternalDirectives()

getInteralAttributes

protected java.util.Map<java.lang.String,java.lang.Object> getInteralAttributes()

getInternalNameSpace

protected java.lang.String getInternalNameSpace()

getName

public java.lang.String getName()
Description copied from interface: VersionConstraint
Returns this constraint's name.

Specified by:
getName in interface VersionConstraint
Returns:
this constraint's name

getVersionRange

public VersionRange getVersionRange()
Description copied from interface: VersionConstraint
Returns the version range for this constraint.

Specified by:
getVersionRange in interface VersionConstraint
Returns:
the version range for this constraint, or null

getBundle

public BundleDescription getBundle()
Description copied from interface: VersionConstraint
Returns the bundle that declares this constraint.

Specified by:
getBundle in interface VersionConstraint
Returns:
a bundle description

setName

protected void setName(java.lang.String name)

setVersionRange

protected void setVersionRange(VersionRange versionRange)

setBundle

protected void setBundle(BundleDescription bundle)

getRequirement

public BundleRequirement getRequirement()
Description copied from interface: VersionConstraint
Returns the requirement represented by this constraint. Some constraint types may not be able to represent a requirement. In such cases null is returned.

Specified by:
getRequirement in interface VersionConstraint
Returns:
the requirement represented by this constraint


Copyright © 2007-2012 FuseSource, Corp.. All Rights Reserved.