Package org.osgi.framework

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


        verify(preferencesService, prefs, repositoriesNode, featuresNode, bundleContext, installedBundle, featuresRegistry);

        reset(preferencesService, prefs, repositoriesNode, featuresNode, bundleContext, installedBundle, featuresRegistry);

        expect(bundleContext.getBundles()).andReturn(new Bundle[0]);
        expect(bundleContext.installBundle(isA(String.class),
                                           isA(InputStream.class))).andReturn(installedBundle);
        expect(installedBundle.getBundleId()).andReturn(12345L);
        expect(bundleContext.getBundle(12345L)).andReturn(installedBundle);
        installedBundle.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 = CoreOptions.mavenBundle().groupId("org.apache.aries.blueprint").artifactId("org.apache.aries.blueprint.sample").version( "0.1-incubating-SNAPSHOT");
            // 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

    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

                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

        // Now start Felix instance.
        felix.start();
        BundleContext context = felix.getBundleContext();
        InputStream is = OSGiServiceDiscovererTestCase.class.getResourceAsStream("/test-bundle.jar");
        testBundle = context.installBundle("test-bundle", is);
        is.close();
        discoverer = new OSGiServiceDiscoverer(context);
    }

    /**
 
View Full Code Here

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

        InputStream is = EquinoxServiceDiscovererTestCase.class.getResourceAsStream("/test-bundle-v1.jar");
        testBundle1 = context.installBundle("test-bundle-v1", is);
        is.close();
       
        is = EquinoxServiceDiscovererTestCase.class.getResourceAsStream("/test-bundle-v2.jar");
        testBundle2 = context.installBundle("test-bundle-v2", is);
        is.close();
View Full Code Here

        InputStream is = EquinoxServiceDiscovererTestCase.class.getResourceAsStream("/test-bundle-v1.jar");
        testBundle1 = context.installBundle("test-bundle-v1", is);
        is.close();
       
        is = EquinoxServiceDiscovererTestCase.class.getResourceAsStream("/test-bundle-v2.jar");
        testBundle2 = context.installBundle("test-bundle-v2", is);
        is.close();

        discoverer = new EquinoxServiceDiscoverer(context);
    }
View Full Code Here

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

        verify(bundleContext, installedBundle);

        reset(bundleContext, installedBundle);

        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

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.