Package org.osgi.framework

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


          return;
        }
        FileItem pluginFile = formFileMap.get("pluginFile");

        try {
          Bundle bundle = bundleContext.installBundle(
              pluginFile.getName(), pluginFile.getInputStream());
          bundle.start();

        } catch (Exception e) {
          e.printStackTrace();
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

    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>();
        if(dep.isDirectory()) {
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();
            }
        }
View Full Code Here

    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
        try {
            host = new EquinoxHost();
            BundleContext context = host.start();
            Bundle calculatorBundle = context.installBundle("reference:" + generateCalculatorBundle().toString());
            Bundle operationsBundle = context.installBundle("reference:" + generateOperationsBundle().toString());

            for (Bundle b : context.getBundles()) {
                if (b.getSymbolicName().equals("org.eclipse.equinox.ds")) {
                    System.out.println(bundleStatus(b, false));
View Full Code Here

    public static void setUpBeforeClass() throws Exception {
        try {
            host = new EquinoxHost();
            BundleContext context = host.start();
            Bundle calculatorBundle = context.installBundle("reference:" + generateCalculatorBundle().toString());
            Bundle operationsBundle = context.installBundle("reference:" + generateOperationsBundle().toString());

            for (Bundle b : context.getBundles()) {
                if (b.getSymbolicName().equals("org.eclipse.equinox.ds")) {
                    System.out.println(bundleStatus(b, false));
                    b.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>();
        if(dep.isDirectory()) {
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();
            }
        }
View Full Code Here

     * @throws BundleException
     */
    @Test
    public void testLoadStartStop() throws BundleException {
        final BundleContext bundleContext = OsgiFramework.getBundleContext();
        final Bundle bundle = bundleContext.installBundle("file:" + getBundlePath());
        Assert.assertNotNull("Error loading bundle: null returned", bundle);
        Assert.assertEquals("Error loading bundle: symbolic name mismatch", getExpectedBundleSymbolicName(),
                bundle.getSymbolicName());
        Assert.assertEquals("Bundle is not in INSTALLED state", Bundle.INSTALLED, bundle.getState());

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.