Package org.osgi.framework

Examples of org.osgi.framework.BundleContext.installBundle()


        final String bundleRef = commandLine.getQualifier();
        final URL url = new URL(bundleRef);
        final BundleContext ctx = crankstartContext.getOsgiFramework().getBundleContext();
        final InputStream bundleStream = url.openStream();
        try {
            final Bundle b = ctx.installBundle(bundleRef, url.openStream());
           
            final int level = getStartLevel(crankstartContext);
            if(level > 0) {
                final BundleStartLevel bsl = (BundleStartLevel)b.adapt(BundleStartLevel.class);
                if(bsl == null) {
View Full Code Here


        BundleContext bundleContext = m_framework.getBundleContext();
        Activator hostActivator = new Activator();
        hostActivator.start(bundleContext);
        for (String location : bundleLocations)
        {
            Bundle addition = bundleContext.installBundle(location);
            addition.start();
        }
    }
}
View Full Code Here

        BundleContext bundleContext = m_framework.getBundleContext();
        Activator hostActivator = new Activator();
        hostActivator.start(bundleContext);
        for (String location : bundleLocations)
        {
            Bundle addition = bundleContext.installBundle(location);
            addition.start();
        }
    }
}
View Full Code Here

                Bundle bundle = targetPackage.getBundle(bsn);
                try {
                    if (bundle == null) {
                        // new bundle, install it
                        bundle = context.installBundle(BUNDLE_LOCATION_PREFIX + bsn, new BundleInputStream(source.getCurrentEntryStream()));
                        addRollback(new UninstallBundleRunnable(bundle, log));
                    }
                    else {
                        // existing bundle, update it
                        Version currentVersion = getVersion(bundle);
View Full Code Here

   @Override
   public BundleHandle installBundle(URL bundleURL) throws BundleException, IOException
   {
      BundleContext sysContext = framework.getBundleContext();
      Bundle bundle = sysContext.installBundle(bundleURL.toExternalForm());
      return new BundleHandle(bundle.getBundleId(), bundle.getSymbolicName());
   }

   @Override
   public void resolveBundle(BundleHandle handle) throws BundleException, IOException
View Full Code Here

            BundleContext compositeBundleContext = cb.getCompositeFramework().getBundleContext();
            // install the blueprint sample onto the framework associated with the composite bundle
            MavenArtifactProvisionOption mapo = mavenBundleInTest(getClass().getClassLoader(), "org.apache.aries.blueprint", "org.apache.aries.blueprint.sample");
            // let's use input stream to avoid invoking mvn url handler which isn't avail in the child framework.
            InputStream is = new URL(mapo.getURL()).openStream();
            Bundle bundle = compositeBundleContext.installBundle(mapo.getURL(), is);
            assertNotNull(bundle);
           
            // start the composite bundle then the blueprint sample
            cb.start();
            bundle.start();
View Full Code Here

            BundleContext compositeBundleContext = cb.getCompositeFramework().getBundleContext();
            // install the blueprint sample onto the framework associated with the composite bundle
            MavenArtifactProvisionOption mapo = mavenBundleInTest(getClass().getClassLoader(), "org.apache.aries.blueprint", "org.apache.aries.blueprint.sample");
            // let's use input stream to avoid invoking mvn url handler which isn't avail in the child framework.
            InputStream is = new URL(mapo.getURL()).openStream();
            Bundle bundle = compositeBundleContext.installBundle(mapo.getURL(), is);
            assertNotNull(bundle);
           
            // start the composite bundle then the blueprint sample
            cb.start();
            bundle.start();
View Full Code Here

            BundleContext compositeBundleContext = cb.getCompositeFramework().getBundleContext();
            // install the blueprint sample onto the framework associated with the composite bundle
            MavenArtifactProvisionOption mapo = mavenBundleInTest("org.apache.aries.blueprint", "org.apache.aries.blueprint.sample");
            // let's use input stream to avoid invoking mvn url handler which isn't avail in the child framework.
            InputStream is = new URL(mapo.getURL()).openStream();
            Bundle bundle = compositeBundleContext.installBundle(mapo.getURL(), is);
            assertNotNull(bundle);
           
            // start the composite bundle then the blueprint sample
            cb.start();
            bundle.start();
View Full Code Here

            BundleContext compositeBundleContext = cb.getCompositeFramework().getBundleContext();
            // install the blueprint sample onto the framework associated with the composite bundle
            MavenArtifactProvisionOption mapo = mavenBundleInTest("org.apache.aries.blueprint", "org.apache.aries.blueprint.sample");
            // let's use input stream to avoid invoking mvn url handler which isn't avail in the child framework.
            InputStream is = new URL(mapo.getURL()).openStream();
            Bundle bundle = compositeBundleContext.installBundle(mapo.getURL(), is);
            assertNotNull(bundle);
           
            // start the composite bundle then the blueprint sample
            cb.start();
            bundle.start();
View Full Code Here

                Bundle bundle = targetPackage.getBundle(bsn);
                try {
                    if (bundle == null) {
                        // new bundle, install it
                        bundle = context.installBundle(Constants.BUNDLE_LOCATION_PREFIX + bsn, new BundleInputStream(source.getCurrentEntryStream()));
                        addRollback(new UninstallBundleRunnable(bundle, log));
                    } else {
                        // existing bundle, update it
                        Version currentVersion = getVersion(bundle);
                        if (!sourceVersion.equals(currentVersion)) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.