Package org.osgi.framework.launch

Examples of org.osgi.framework.launch.Framework.waitForStop()


            if (myFramework != null) {
                logger.log(Logger.LOG_INFO, "Shutting down Apache Sling");
                try {

                    myFramework.stop();
                    myFramework.waitForStop(0);

                } catch (BundleException be) {

                    // may be thrown by stop, log but continue
                    logger.log(Logger.LOG_ERROR,
View Full Code Here


      CompositeBundle composite = (CompositeBundle) allBundles[i];
      try {
        Framework child = composite.getCompositeFramework();
        child.stop();
        // need to wait for each child to stop
        child.waitForStop(30000);
        // TODO need to figure out a way to invalid the child
      } catch (Throwable t) {
        // TODO consider logging
        t.printStackTrace();
      }
View Full Code Here

                System.exit(1);
            }

            if (m_verbose)
                System.out.println("Startup complete..");
            framework.waitForStop(0);
        }
        catch (Exception e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
            System.exit(1);
View Full Code Here

        Framework framework = factory.newFramework(frameworkProperties);

        framework.start();

        try {
            framework.waitForStop(0);
        }
        finally {
            System.exit(0);
        }
    }
View Full Code Here

        boot.bootstrap();

        framework.stop();
        getLog().debug("Waiting for shutdown (up to 5 minutes)...");
        framework.waitForStop(60 * 5 * 1000);
    }

    //
    // Deployment
    //
View Full Code Here

        kernel.shutdown();
        kernel = null;
        Framework framework = (Framework) bundleContext.getBundle();
        framework.stop();
        getLog().debug("Waiting for shutdown (up to 5 minutes)...");
        framework.waitForStop(60 * 5 * 1000);
        bundleContext = null;
    }

    /**
     * Create a Geronimo Kernel to contain the deployment configurations.
View Full Code Here

        configuration.put(Constants.FRAMEWORK_STORAGE, "target/papoose");

        FrameworkFactory factory = new PapooseFrameworkFactory();
        final Framework framework = factory.newFramework(configuration);

        FrameworkEvent frameworkEvent = framework.waitForStop(0);

        assertNotNull(frameworkEvent);
        assertEquals(FrameworkEvent.STOPPED, frameworkEvent.getType());
        assertSame(framework, frameworkEvent.getBundle());
View Full Code Here

        {
            Future<FrameworkEvent> result = pool.submit(new Callable<FrameworkEvent>()
            {
                public FrameworkEvent call() throws Exception
                {
                    return framework.waitForStop(0);
                }
            });

            framework.stop();
View Full Code Here

            assertNotNull(frameworkEvent);
            assertEquals(FrameworkEvent.STOPPED, frameworkEvent.getType());
            assertSame(systemBundle, frameworkEvent.getBundle());

            framework.waitForStop(0);
        }
        finally
        {
            pool.shutdown();
        }
View Full Code Here

            pool.shutdown();
        }

        try
        {
            framework.waitForStop(-1);
            Assert.fail("Should never accept negative wait timeouts");
        }
        catch (IllegalArgumentException iae)
        {
        }
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.