|
OSGi™ Service Platform Release 2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Framework service which allows bundle programmers to inspect the packages exported in the Framework and eagerly update or uninstall bundles. If present, there will only be a single instance of this service registered with the Framework.
The term exported package (and the corresponding interface
ExportedPackage
)refers to a package that has actually been
exported (as opposed to one that is available for export).
The information about exported packages returned by this
service is valid only until the next time refreshPackages(org.osgi.framework.Bundle[])
is
called.
If an ExportedPackage object 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 | |
ExportedPackage |
getExportedPackage(java.lang.String name)
Gets the ExportedPackage object with the specified package name. |
ExportedPackage[] |
getExportedPackages(Bundle bundle)
Gets the packages exported by the specified bundle. |
void |
refreshPackages(Bundle[] bundles)
Forces the update (replacement) or removal of packages exported by the specified bundles. |
Method Detail |
public ExportedPackage[] getExportedPackages(Bundle bundle)
bundle
- The bundle whose exported packages are to be returned,
or null if all the packages currently
exported in the Framework are to be returned. If the
specified bundle is the system bundle (that is, the
bundle with id 0), this method returns all the packages
on the system classpath whose name does not start with
"java.". In an environment where the exhaustive list
of packages on the system classpath is not known in
advance, this method will return all currently known
packages on the system classpath, that is, all packages
on the system classpath that contains one or more classes
that have been loaded.
public ExportedPackage getExportedPackage(java.lang.String name)
name
- The name of the exported package to be returned.
public void refreshPackages(Bundle[] bundles)
If no bundles are specified, this method will update or remove any packages exported by any bundles that were previously updated or uninstalled. The technique by which this is accomplished may vary among different Framework implementations. One permissible implementation is to stop and restart the Framework.
This method returns to the caller immediately and then performs the following steps in its own thread:
For any exceptions that are thrown during any of these steps, a FrameworkEvent of type ERROR is broadcast, containing the exception.
bundles
- the bundles whose exported packages are to be updated or
removed, or null for all previously updated or uninstalled bundles.
java.lang.SecurityException
- if the caller does not have the
AdminPermission and the Java runtime environment supports
permissions.
|
OSGi™ Service Platform Release 2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |