Search in sources :

Example 1 with CompositeBundleFactory

use of org.osgi.service.framework.CompositeBundleFactory in project aries by apache.

the class BundleFrameworkFactoryImpl method createBundleFramework.

public BundleFramework createBundleFramework(BundleContext bc, BundleFrameworkConfiguration config) throws BundleException {
    BundleFramework framework = null;
    ServiceReference sr = bc.getServiceReference(CompositeBundleFactory.class.getName());
    if (sr != null) {
        CompositeBundleFactory cbf = (CompositeBundleFactory) bc.getService(sr);
        CompositeBundle compositeBundle = cbf.installCompositeBundle(config.getFrameworkProperties(), config.getFrameworkID(), config.getFrameworkManifest());
        framework = new BundleFrameworkImpl(compositeBundle);
    } else
        throw new BundleException("Failed to obtain framework factory service");
    return framework;
}
Also used : BundleFramework(org.apache.aries.application.management.spi.framework.BundleFramework) BundleException(org.osgi.framework.BundleException) CompositeBundleFactory(org.osgi.service.framework.CompositeBundleFactory) CompositeBundle(org.osgi.service.framework.CompositeBundle) ServiceReference(org.osgi.framework.ServiceReference)

Aggregations

BundleFramework (org.apache.aries.application.management.spi.framework.BundleFramework)1 BundleException (org.osgi.framework.BundleException)1 ServiceReference (org.osgi.framework.ServiceReference)1 CompositeBundle (org.osgi.service.framework.CompositeBundle)1 CompositeBundleFactory (org.osgi.service.framework.CompositeBundleFactory)1