Package org.osgi.framework

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


        }, null, null);
       
     
        assertNotNull(refB);
        assertNotNull(msf);
        b.stop();
        refB = bundleContext.getServiceReference(InterfaceB.class.getName());
        refs = bundleContext.getServiceReferences(ManagedServiceFactory.class.getName(), "(" + Constants.SERVICE_PID + "=jmx.test.B.factory)");
        assertNull(refs);
        assertNull(refB);
        b.start();
View Full Code Here


        }, null, null);
       
     
        assertNotNull(refB);
        assertNotNull(msf);
        b.stop();
        refB = bundleContext.getServiceReference(InterfaceB.class.getName());
        refs = bundleContext.getServiceReferences(ManagedServiceFactory.class.getName(), "(" + Constants.SERVICE_PID + "=jmx.test.B.factory)");
        assertNull(refs);
        assertNull(refB);
        b.start();
View Full Code Here

       
        // We could potentially use Felix.stopAndWait, but use timed wait for now because
        // stopAndWait hangs with Felix 1.0.0
        if (felix instanceof Bundle) {
            Bundle felixBundle = (Bundle)felix;
            felixBundle.stop();
            int retries = 50;
            synchronized (felix) {
                while (retries-- > 0 && felixBundle.getState() != Bundle.UNINSTALLED) {
                    felix.wait(100);
                }
View Full Code Here

        new Thread() {
            public void run() {
                Bundle scrBundle = scrTracker.getServiceReference().getBundle();
                try {
                    scrBundle.stop();
                } catch (Throwable t) {
                    t.printStackTrace();
                } finally {
                    latch.countDown();
                }
View Full Code Here

   @Override
   public void stopBundle(BundleHandle handle) throws BundleException
   {
      Bundle bundle = getBundle(handle);
      bundle.stop();
   }

   @Override
   public boolean isBundleInstalled(String symbolicName)
   {
View Full Code Here

        // Start the bundle
        bundle.start();
        assertEquals(Bundle.ACTIVE, bundle.getState());

        // Stop the bundle
        bundle.stop();
        assertEquals(Bundle.RESOLVED, bundle.getState());

        bundle.uninstall();
        assertEquals(Bundle.UNINSTALLED, bundle.getState());
    }
View Full Code Here

            // Start the bundle
            bundle.start();
            Assert.assertEquals(Bundle.ACTIVE, bundle.getState());

            // Stop the bundle
            bundle.stop();
            Assert.assertEquals(Bundle.RESOLVED, bundle.getState());
        } finally {
            bundle.uninstall();
            Assert.assertEquals(Bundle.UNINSTALLED, bundle.getState());
        }
View Full Code Here

        // Start the bundle. Note, it may have started already
        bundle.start();
        assertEquals(Bundle.ACTIVE, bundle.getState());

        // Stop the bundle
        bundle.stop();
        assertEquals(Bundle.RESOLVED, bundle.getState());

        final CountDownLatch uninstallLatch = new CountDownLatch(1);
        context.addBundleListener(new BundleListener() {
            public void bundleChanged(BundleEvent event) {
View Full Code Here

        try {
            if (START_OPERATION.equals(operationName)) {
                bundle.start();
            } else if (STOP_OPERATION.equals(operationName)) {
                bundle.stop();
            }
        } catch (BundleException e) {
            context.getFailureDescription().set(e.getLocalizedMessage());
        }
View Full Code Here

    }

    public String stop() throws BundleException {
        Bundle bundle = osgiHost.getBundles().get(id);
        try {
            bundle.stop();
        } catch (Exception e) {
            addActionError(e.toString());
        }

        return view();
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.