Examples of installBundle()


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

            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

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

            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

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

                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

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

        try {
            Kernel kernel = getKernel();
            BundleContext bundleContext = kernel.getBundleFor(kernel.getKernelName()).getBundleContext();
            //TODO Figure out who should be responsible for uninstalling it, and whether we need to start the bundle
            //Currently, this method is only used for resource reading, seems no need to start the bundle.
            return bundleContext.installBundle("mvn:" + uri.getGroupId() + "/" + uri.getArtifactId() + "/" + uri.getVersion() + ("jar".equals(uri.getType()) ? "" : "/" + uri.getType()));
        } catch (Exception e) {
            return null;
        }
    }
View Full Code Here

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

                   
                    if (bundleInfo == null) {
                        throw new ManagementException("Cound not find bundles: " + bundleSymbolicName + "_" + bundleVersion);
                    }
                       
                    contentBundle = bundleContext.installBundle(bundleInfo.getLocation());
                    applicationBundles.add(contentBundle);

                }
            }
        } catch (BundleException be) {
View Full Code Here

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

    public static void setUpBeforeClass() throws Exception {
        host = new TestEquinoxHost();
        BundleContext context = host.start();

        InputStream is = EquinoxServiceDiscovererTestCase.class.getResourceAsStream("/test-bundle.jar");
        testBundle = context.installBundle("test-bundle", is);
        is.close();
        discoverer = new EquinoxServiceDiscoverer(context);
        File dep = new File("target/bundles");
        List<Bundle> bundles = new ArrayList<Bundle>();
        for (File f : dep.listFiles()) {
View Full Code Here

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

                bis.close();
                continue;
            }
            bis.close();
            bis = new BufferedInputStream(new FileInputStream(f));
            Bundle b = context.installBundle(f.getName(), bis);
            System.out.println("Installed "+b.getSymbolicName() + " [" + getState(b) + "]");
            bundles.add(b);
            bis.close();
        }
        for (Bundle b : bundles) {
View Full Code Here

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

        // required since the sorted set uses it
        expect(installedBundle.compareTo(EasyMock.<Bundle>anyObject())).andReturn(0).anyTimes();

        expect(bundleContext.getBundles()).andReturn(new Bundle[0]);
        expect(bundleContext.installBundle(isA(String.class),
                                           isA(InputStream.class))).andReturn(installedBundle);
        expect(installedBundle.getBundleId()).andReturn(12345L);
        expect(installedBundle.getBundleId()).andReturn(12345L);
        expect(installedBundle.getBundleId()).andReturn(12345L);
        expect(bundleContext.getBundle(12345L)).andReturn(installedBundle);
View Full Code Here

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

        // required since the sorted set uses it
        expect(installedBundle.compareTo(EasyMock.<Bundle>anyObject())).andReturn(0).anyTimes();

        // Installs f1 and 0.1
        expect(bundleContext.getBundles()).andReturn(new Bundle[0]);
        expect(bundleContext.installBundle(isA(String.class),
                                           isA(InputStream.class))).andReturn(installedBundle);
        expect(installedBundle.getBundleId()).andReturn(12345L);
        expect(installedBundle.getBundleId()).andReturn(12345L);
        expect(installedBundle.getBundleId()).andReturn(12345L);
        expect(bundleContext.getBundle(12345L)).andReturn(installedBundle);
View Full Code Here

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

                   
                    if (bundleInfo == null) {
                        throw new ManagementException("Could not find bundle: " + bundleSymbolicName + "_" + bundleVersion);
                    }
                       
                    contentBundle = bundleContext.installBundle(bundleInfo.getLocation());
                   
                    applicationBundles.add(contentBundle);
                }
               
            }
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.