org.osgi.service.framework
Interface CompositeBundleFactory

All Known Implementing Classes:
CompositeConfigurator

Deprecated. This API proposal was rejected by the OSGi Alliance and will not be part of any OSGi specification. Please transition to the org.osgi.framework.hooks API to control resolution, bundle, and service isolation. This API will be removed from Equinox in the 3.9 release You are cautioned against relying upon this API.

public interface CompositeBundleFactory

Framework service that is used to create composite bundles.

If present, there will only be a single instance of this service registered with the Framework.

Version:
$Revision: 6860 $

Field Summary
static String COMPOSITE_SERVICE_FILTER_EXPORT
          Deprecated. Manifest header (named "CompositeServiceFilter-Export") identifying the service filters that are used by a surrogate bundle to select services that will be registered into a parent framework by its associated composite bundle.
static String COMPOSITE_SERVICE_FILTER_IMPORT
          Deprecated. Manifest header (named "CompositeServiceFilter-Import") identifying the service filters that are used by a composite bundle to select services that will be registered into a child framework by its associated surrogate bundle.
 
Method Summary
 CompositeBundle installCompositeBundle(Map frameworkConfig, String location, Map compositeManifest)
          Deprecated. Installs a CompositeBundle.
 

Field Detail

COMPOSITE_SERVICE_FILTER_IMPORT

static final String COMPOSITE_SERVICE_FILTER_IMPORT
Deprecated. 
Manifest header (named "CompositeServiceFilter-Import") identifying the service filters that are used by a composite bundle to select services that will be registered into a child framework by its associated surrogate bundle.

See Also:
Constant Field Values

COMPOSITE_SERVICE_FILTER_EXPORT

static final String COMPOSITE_SERVICE_FILTER_EXPORT
Deprecated. 
Manifest header (named "CompositeServiceFilter-Export") identifying the service filters that are used by a surrogate bundle to select services that will be registered into a parent framework by its associated composite bundle.

See Also:
Constant Field Values
Method Detail

installCompositeBundle

CompositeBundle installCompositeBundle(Map frameworkConfig,
                                       String location,
                                       Map compositeManifest)
                                       throws BundleException
Deprecated. 
Installs a CompositeBundle. The composite bundle has a new child Framework associated with it and a surrogate bundle which is installed in the child framework. Composite bundles share packages and services between the parent framework they are installed in and the child framework.

The following steps are required to create a composite bundle:

  1. If a bundle containing the same location string is already installed and the Bundle object is a CompositeBundle, then that composite bundle is returned; otherwise a BundleException is thrown indicating that an incompatible bundle is already installed at the specified location.
  2. The composite bundle's associated resources are allocated. The associated resources minimally consist of a unique identifier and a persistent storage area. If this step fails, a BundleException is thrown.
  3. The compositeManifest map is used to provide the headers for the composite bundle and its surrogate bundle.

    If composite manifest map does not contain the following header(s) then a BundleException is thrown:

    • Bundle-SymbolicName the symbolic name used for the composite bundle and its surrogate bundle.

    The composite manifest map may optionally contain the following header(s):

    • Bundle-Version the bundle version used for the composite bundle and its surrogate bundle.
    • Import-Package the packages which are imported from the parent framework by the composite bundle and are exported to the child framework by the surrogate bundle.
    • Export-Package the packages which are imported from the child framework by the surrogate bundle and are exported to the parent framework by the composite bundle.
    • CompositeServiceFilter-Import the service filters which are acquired from the parent framework by the composite bundle and are registered in the child framework by the surrogate bundle.
    • CompositeServiceFilter-Export the service filters which are acquired from the child framework by the surrogate bundle and are registered in the parent framework by the composite bundle.
    • Bundle-ManifestVersion the bundle manifest version. If this header is not specified then the default is to use version 2. A BundleException is thrown if this header is specified and the version is less than 2.
    • Require-Bundle a bundle from the parent which is required by the child. Support for this header is experimental: a BundleException should be thrown if the header is present and the framework doesn't support it.

    The composite manifest map must not contain the following headers. If a composite manifest map does contain one of the following headers then a BundleException is thrown:
    Bundle-ActivationPolicy
    Bundle-Activator
    Bundle-ClassPath
    Bundle-Localization
    Bundle-NativeCode
    Fragment-Host
    DynamicImport-Package

  4. A child framework is created which uses a storage area associated with the composite bundle's persistent storage. The framework configuration property org.osgi.framework.storage, if specified, is ignored.
  5. The child framework is initialized (see Framework.init()).
  6. A surrogate bundle is created and installed into the child framework.
  7. The composite bundle's state is set to INSTALLED.
  8. A bundle event of type BundleEvent.INSTALLED is fired for the composite bundle.
  9. The CompositeBundle object for the new composite bundle is returned.

Parameters:
frameworkConfig - A map containing configuration parameters used to initialize and launch the child framework.
location - The bundle location used for the composite and surrogate bundles.
compositeManifest - A map containing the manifest used to create the composite and surrogate bundles
Returns:
A new composite bundle in INSTALLED state.
Throws:
BundleException - If the composite manifest is invalid or there is some other problem with installing the composite bundle.
SecurityException - If the caller does not have AllPermission.
See Also:
Framework, CompositeBundle


Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.