Package org.osgi.framework

Examples of org.osgi.framework.Bundle.start()


            // update
            bundle.update(in);
        } else {
            // install
            final Bundle b = bundleContext.installBundle(location, in);
            b.start();
        }

        // take into account added/removed packages for updated bundles and newly satisfied optional package imports
        // for new installed bundles
        packageAdmin.refreshPackages(new Bundle[] { bundle });
View Full Code Here


        } catch (final ClassNotFoundException expected) {
            // expected
        }

        // start bundle
        osgiBundle.start();
        assertEquals(Bundle.ACTIVE, osgiBundle.getState());
        // try to load class when bundle is in state activate: should work
        try {
            getDynamicClassLoader().loadClass(className);
        } catch (final ClassNotFoundException expected) {
View Full Code Here

        if (start) {
            for (Bundle b : bundles) {
                try {
                    String fragmentHostHeader = (String) b.getHeaders().get(Constants.FRAGMENT_HOST);
                    if (fragmentHostHeader == null || fragmentHostHeader.trim().length() == 0) {
                        b.start();
                    }
                }
                catch (Exception ex) {
                    System.err.println("Error starting bundle " + b.getSymbolicName() + ": " + ex);
                }
View Full Code Here

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

        }
        else
        {
            try
            {
                b.start();
                writeOk();
                log("Started " + b.getSymbolicName());
            }
            catch (BundleException e)
            {
View Full Code Here

  Assert.assertTrue(
    "The remove method declared in <callback> tag should have been called during the bundle stop",
    s1.getIsOnRemoveCallbackCalled());

  bc.start();

    }

    @Override
    public List<Option> config() {
View Full Code Here

        Class clazz1 = cl1.loadClass(URLHandlersTest.class.getName());

        clazz1.getMethod("testURLHandlers").invoke(clazz1.newInstance());

        bundle.stop();
        bundle.start();
        Class clazz2 = cl2.loadClass(URLHandlersTest.class.getName());

        clazz2.getMethod("testURLHandlers").invoke(clazz2.newInstance());
        bundle.stop();
        bundle.start();
View Full Code Here

        bundle.start();
        Class clazz2 = cl2.loadClass(URLHandlersTest.class.getName());

        clazz2.getMethod("testURLHandlers").invoke(clazz2.newInstance());
        bundle.stop();
        bundle.start();
        f.stop();
    }

    public static class DelegatingClassLoader extends ClassLoader
    {
View Full Code Here

        installBundle("org.springframework", "spring-tx", null, "jar");
        getOsgiService(PackageAdmin.class).refreshPackages(new Bundle[] { bundle });
        System.err.println("Bundle refreshed");
        Thread.sleep(500);
        System.err.println("Starting bundle");
        bundle.start();

        tracker.waitForService(5000L);
        ref = tracker.getServiceReference();
        assertNotNull(ref);
        objClass = (String[]) ref.getProperty(Constants.OBJECTCLASS);
View Full Code Here

                    throw new Exception("Unexpected url2 resolve");
                }
                catch (Exception ex)
                {
                }
                bundle2.start();
                new URL("test" + System.identityHashCode(bundle2) + ":").openConnection();
                bundle2.stop();
                try
                {
                    new URL("test" + System.identityHashCode(bundle2) + ":").openConnection();
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.