public interface CompositeBundle extends Bundle
A framework has one composite bundle for each of its child frameworks. A framework can have zero or more composite bundles installed. A child framework must have one and only one surrogate bundle which represents the composite bundle in the parent framework. In other words, a parent framework can have many child frameworks but a child framework can have only one parent.
A composite bundle does the following as specified by the composite manifest map:
Framework
will be in the
STARTING
state. This child Framework
can
then be used to manage and control the child framework instance. The child
framework instance is persistent and uses a storage area associated with the
installed composite bundle. The child framework's lifecycle is tied to its
composite bundle's lifecycle in the following ways:
stop(Bundle.STOP_TRANSIENT)
,
update
, refreshPackages etc.).The child framework may be persistently started and stopped by persistently starting and stopping the composite bundle, but it is still possible to initialize and start the child framework explicitly while the composite bundle is not persistently started. This allows for the child framework to be initialized and populated with a set of bundles before starting the composite bundle. The set of bundles installed into the child framework are the component bundles which comprise the composite bundle.
The child framework's lifecycle is also tied to the lifecycle of its
parent framework. When the parent Framework
enters the
STOPPING
state, all active child frameworks of that
parent are shutdown using the Framework.stop()
method. The parent
framework must not enter the Bundle.RESOLVED
state until all the
child frameworks have completed their shutdown process. Just as with other
Bundles, references to child frameworks (or the associated composite and
surrogate bundles) become invalid after the parent framework has completed
the shutdown process, and must not be allowed to re-initialize or re-start
the child framework.
SurrogateBundle
ACTIVE, INSTALLED, RESOLVED, SIGNERS_ALL, SIGNERS_TRUSTED, START_ACTIVATION_POLICY, START_TRANSIENT, STARTING, STOP_TRANSIENT, STOPPING, UNINSTALLED
Modifier and Type | Method and Description |
---|---|
Framework |
getCompositeFramework()
Deprecated.
Returns the child framework associated with this composite bundle.
|
SurrogateBundle |
getSurrogateBundle()
Deprecated.
Returns the surrogate bundle associated with this composite bundle.
|
void |
uninstall()
Deprecated.
Uninstalls this composite bundle.
|
void |
update()
Deprecated.
This operation is not supported for composite bundles.
|
void |
update(InputStream input)
Deprecated.
This operation is not supported for composite bundles.
|
void |
update(Map compositeManifest)
Deprecated.
Updates this composite bundle with the specified manifest.
|
adapt, findEntries, getBundleContext, getBundleId, getDataFile, getEntry, getEntryPaths, getHeaders, getHeaders, getLastModified, getLocation, getRegisteredServices, getResource, getResources, getServicesInUse, getSignerCertificates, getState, getSymbolicName, getVersion, hasPermission, loadClass, start, start, stop, stop
compareTo
Framework getCompositeFramework()
SurrogateBundle getSurrogateBundle()
void update(Map compositeManifest) throws BundleException
Similar to normal bundle updates, the packages exported by a composite or surrogate bundle can not change as a result of calling update: the previous package exports must be available to other consuming bundles (in either the parent or child framework) until the PackageAdmin.refreshPackages method has been called to refresh the composite, or the parent Framework is re-launched.
compositeManifest
- the new composite manifest.BundleException
- If the update fails.CompositeBundleFactory.installCompositeBundle(Map, String, Map)
void update() throws BundleException
BundleException
of type
invalid operation
must be
thrown.update
in interface Bundle
BundleException
- If this bundle could not be updated.
BundleException types thrown by this method include:
BundleException.READ_ERROR
,
BundleException.DUPLICATE_BUNDLE_ERROR
,
BundleException.MANIFEST_ERROR
,
BundleException.NATIVECODE_ERROR
,
BundleException.RESOLVE_ERROR
,
BundleException.STATECHANGE_ERROR
, and
BundleException.ACTIVATOR_ERROR
.Bundle.update(InputStream)
void update(InputStream input) throws BundleException
BundleException
of type
invalid operation
must be
thrown.update
in interface Bundle
input
- The InputStream
from which to read the new bundle or
null
to indicate the Framework must create the input
stream from this bundle's Bundle-UpdateLocation
Manifest header, if present, or this
bundle's original location. The input stream must always be closed
when this method completes, even if an exception is thrown.BundleException
- If this bundle could not be updated.
BundleException types thrown by this method include:
BundleException.READ_ERROR
,
BundleException.DUPLICATE_BUNDLE_ERROR
,
BundleException.MANIFEST_ERROR
,
BundleException.NATIVECODE_ERROR
,
BundleException.RESOLVE_ERROR
,
BundleException.STATECHANGE_ERROR
, and
BundleException.ACTIVATOR_ERROR
.Bundle.stop()
,
Bundle.start()
void uninstall() throws BundleException
uninstall
in interface Bundle
BundleException
- If the uninstall failed. This can occur if
another thread is attempting to change this bundle's state and
does not complete in a timely manner. BundleException types
thrown by this method include:
BundleException.STATECHANGE_ERROR
Bundle.stop()
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.