org.eclipse.osgi.service.resolver
Interface BundleDescription

All Superinterfaces:
BaseDescription

public interface BundleDescription
extends BaseDescription

This class represents a specific version of a bundle in the system.

Clients may implement this interface.

Since:
3.1

Method Summary
 boolean attachFragments()
          Returns true if this bundle allows fragments to attach
 boolean dynamicFragments()
          Returns true if this bundle allows fragments to attach dynamically after it has been resolved.
 long getBundleId()
          Returns the numeric id of this bundle.
 State getContainingState()
          Returns the state object which hosts this bundle. null is returned if this bundle is not currently in a state.
 BundleDescription[] getDependents()
          Returns all bundles which depend on this bundle.
 java.lang.String[] getExecutionEnvironments()
          Returns the list of execution environments that are required by this bundle.
 ExportPackageDescription[] getExportPackages()
          Returns an array of export package descriptions defined by the Export-Package clauses.
 BundleDescription[] getFragments()
          Returns all fragments known to this bundle (regardless resolution status).
 GenericDescription[] getGenericCapabilities()
          Returns an array of generic descriptions for the capabilities of this bundle.
 GenericSpecification[] getGenericRequires()
          Returns an array of generic specifications constraints required by this bundle.
 HostSpecification getHost()
          Returns the host for this bundle. null is returned if this bundle is not a fragment.
 ImportPackageSpecification[] getImportPackages()
          Returns an array of import package specifications defined by the Import-Package clause.
 java.lang.String getLocation()
          The location string for this bundle.
 java.lang.String getPlatformFilter()
          Returns the platform filter in the form of an LDAP filter
 BundleSpecification[] getRequiredBundles()
          Returns an array of bundle specifications defined by the Require-Bundle clause in this bundle.
 ExportPackageDescription[] getResolvedImports()
          Returns all the export packages that satisfy all the imported packages for this bundle.
 BundleDescription[] getResolvedRequires()
          Returns all the bundle descriptions that satisfy all the require bundles for this bundle.
 ExportPackageDescription[] getSelectedExports()
          Returns all the exported packages from this bundle that have been selected by the resolver.
 java.lang.String getSymbolicName()
          Gets the Bundle-SymbolicName of this BundleDescription.
 java.lang.Object getUserObject()
          Returns the user object associated to this bundle description, or null if none exists.
 boolean hasDynamicImports()
          Returns true if this bundle has one or more dynamically imported packages.
 boolean isRemovalPending()
          Returns whether this bundle is pending a removal.
 boolean isResolved()
          Returns true if this bundle is resolved in its host state.
 boolean isSingleton()
          Returns whether this bundle is a singleton.
 void setUserObject(java.lang.Object userObject)
          Associates a user-provided object to this bundle description, or removes an existing association, if null is provided.
 java.lang.String toString()
          Returns the string representation of this bundle.
 
Methods inherited from interface org.eclipse.osgi.service.resolver.BaseDescription
getName, getSupplier, getVersion
 

Method Detail

getSymbolicName

java.lang.String getSymbolicName()
Gets the Bundle-SymbolicName of this BundleDescription. Same as calling BaseDescription.getName().

Returns:
The bundle symbolic name or null if the bundle does not have a symbolic name.

getLocation

java.lang.String getLocation()
The location string for this bundle.

Returns:
The bundle location or null if the bundle description does not have a location

getRequiredBundles

BundleSpecification[] getRequiredBundles()
Returns an array of bundle specifications defined by the Require-Bundle clause in this bundle.

Returns:
an array of bundle specifications

getExportPackages

ExportPackageDescription[] getExportPackages()
Returns an array of export package descriptions defined by the Export-Package clauses. All export package descriptions are returned even if they have not been selected by the resolver as an exporter of the package.

Returns:
an array of export package descriptions

getImportPackages

ImportPackageSpecification[] getImportPackages()
Returns an array of import package specifications defined by the Import-Package clause.

Returns:
an array of import package specifications

getGenericRequires

GenericSpecification[] getGenericRequires()
Returns an array of generic specifications constraints required by this bundle.

Returns:
an array of generic specifications
Since:
3.2

getGenericCapabilities

GenericDescription[] getGenericCapabilities()
Returns an array of generic descriptions for the capabilities of this bundle.

Returns:
an array of generic descriptions
Since:
3.2

hasDynamicImports

boolean hasDynamicImports()
Returns true if this bundle has one or more dynamically imported packages.

Returns:
true if this bundle has one or more dynamically imported packages.

getSelectedExports

ExportPackageDescription[] getSelectedExports()
Returns all the exported packages from this bundle that have been selected by the resolver. The returned list will include the ExportPackageDescriptions returned by getExportPackages() that have been selected by the resolver and packages which are propagated by this bundle.

Returns:
the selected list of packages that this bundle exports. If the bundle is unresolved or has no shared packages then an empty array is returned.

getResolvedRequires

BundleDescription[] getResolvedRequires()
Returns all the bundle descriptions that satisfy all the require bundles for this bundle. If the bundle is not resolved or the bundle does not require any bundles then an empty array is returned.

Returns:
the bundles descriptions that satisfy all the require bundles for this bundle.

getResolvedImports

ExportPackageDescription[] getResolvedImports()
Returns all the export packages that satisfy all the imported packages for this bundle. If the bundle is not resolved or the bundle does not import any packages then an empty array is returned.

Returns:
the exported packages that satisfy all the imported packages for this bundle.

isResolved

boolean isResolved()
Returns true if this bundle is resolved in its host state.

Returns:
true if this bundle is resolved in its host state.

getContainingState

State getContainingState()
Returns the state object which hosts this bundle. null is returned if this bundle is not currently in a state.

Returns:
the state object which hosts this bundle.

toString

java.lang.String toString()
Returns the string representation of this bundle.

Overrides:
toString in class java.lang.Object
Returns:
String representation of this bundle.

getHost

HostSpecification getHost()
Returns the host for this bundle. null is returned if this bundle is not a fragment.

Returns:
the host for this bundle.

getBundleId

long getBundleId()
Returns the numeric id of this bundle. Typically a bundle description will only have a numeric id if it represents a bundle that is installed in a framework as the framework assigns the ids. -1 is returned if the id is not known.

Returns:
the numeric id of this bundle description

getFragments

BundleDescription[] getFragments()
Returns all fragments known to this bundle (regardless resolution status).

Returns:
an array of BundleDescriptions containing all known fragments

isSingleton

boolean isSingleton()
Returns whether this bundle is a singleton. Singleton bundles require that at most one single version of the bundle can be resolved at a time.

The existence of a single bundle marked as singleton causes all bundles with the same symbolic name to be treated as singletons as well.

Returns:
true, if this bundle is a singleton, false otherwise

isRemovalPending

boolean isRemovalPending()
Returns whether this bundle is pending a removal. A bundle is pending removal if it has been removed from the state but other bundles in the state currently depend on it.

Returns:
true, if this bundle is pending a removal, false otherwise

getDependents

BundleDescription[] getDependents()
Returns all bundles which depend on this bundle. A bundle depends on another bundle if it requires the bundle, imports a package which is exported by the bundle, is a fragment to the bundle or is the host of the bundle.

Returns:
all bundles which depend on this bundle.

getUserObject

java.lang.Object getUserObject()
Returns the user object associated to this bundle description, or null if none exists.

Returns:
the user object associated to this bundle description, or null

setUserObject

void setUserObject(java.lang.Object userObject)
Associates a user-provided object to this bundle description, or removes an existing association, if null is provided. The provided object is not interpreted in any ways by this bundle description.

Parameters:
userObject - an arbitrary object provided by the user, or null

getPlatformFilter

java.lang.String getPlatformFilter()
Returns the platform filter in the form of an LDAP filter

Returns:
the platfomr filter in the form of an LDAP filter

attachFragments

boolean attachFragments()
Returns true if this bundle allows fragments to attach

Returns:
true if this bundle allows fragments to attach

dynamicFragments

boolean dynamicFragments()
Returns true if this bundle allows fragments to attach dynamically after it has been resolved.

Returns:
true if this bundle allows fragments to attach dynamically

getExecutionEnvironments

java.lang.String[] getExecutionEnvironments()
Returns the list of execution environments that are required by this bundle. Any one of the listed execution environments will allow this bundle to be resolved.

Returns:
the list of execution environments that are required.
Since:
3.2