org.knopflerfish.framework
Class ExportedPackageImpl

java.lang.Object
  extended by org.knopflerfish.framework.ExportedPackageImpl
All Implemented Interfaces:
ExportedPackage

public class ExportedPackageImpl
extends java.lang.Object
implements ExportedPackage

An exported package. Instances implementing this interface are created by the PackageAdmin service.

Note that the information about an exported package provided by this class is valid only until the next time PackageAdmin.refreshPackages() is called. If an ExportedPackage becomes stale (that is, the package it references has been updated or removed as a result of calling PackageAdmin.refreshPackages()), its getName() and getSpecificationVersion() continue to return their old values, isRemovalPending() returns true, and getExportingBundle() and getImportingBundles() return null.


Method Summary
 Bundle getExportingBundle()
          Returns the bundle that is exporting this ExportedPackage.
 Bundle[] getImportingBundles()
          Returns the resolved bundles that are currently importing this ExportedPackage.
 java.lang.String getName()
          Returns the name of this ExportedPackage.
 java.lang.String getSpecificationVersion()
          Returns the specification version of this ExportedPackage, as specified in the exporting bundle's manifest file.
 Version getVersion()
          Returns the version of this exported package.
 boolean isRemovalPending()
          Returns true if this ExportedPackage has been exported by a bundle that has been updated or uninstalled.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getName

public java.lang.String getName()
Returns the name of this ExportedPackage.

Specified by:
getName in interface ExportedPackage
Returns:
The name of this ExportedPackage.

getExportingBundle

public Bundle getExportingBundle()
Returns the bundle that is exporting this ExportedPackage.

Specified by:
getExportingBundle in interface ExportedPackage
Returns:
The exporting bundle, or null if this ExportedPackage has become stale.

getImportingBundles

public Bundle[] getImportingBundles()
Returns the resolved bundles that are currently importing this ExportedPackage.

The returned array always includes the bundle returned by getExportingBundle() since an exporter always implicitly imports its exported packages.

Specified by:
getImportingBundles in interface ExportedPackage
Returns:
The array of resolved bundles currently importing this ExportedPackage, or null if this ExportedPackage has become stale.

getSpecificationVersion

public java.lang.String getSpecificationVersion()
Returns the specification version of this ExportedPackage, as specified in the exporting bundle's manifest file.

Specified by:
getSpecificationVersion in interface ExportedPackage
Returns:
The specification version of this ExportedPackage, or null if no version information is available.

isRemovalPending

public boolean isRemovalPending()
Returns true if this ExportedPackage has been exported by a bundle that has been updated or uninstalled.

Specified by:
isRemovalPending in interface ExportedPackage
Returns:
true if this ExportedPackage is being exported by a bundle that has been updated or uninstalled; false otherwise.

getVersion

public Version getVersion()
Description copied from interface: ExportedPackage
Returns the version of this exported package.

Specified by:
getVersion in interface ExportedPackage
Returns:
The version of this exported package, or Version.emptyVersion if no version information is available.

toString

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