Package org.osgi.framework

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


    try {
      while (currentThread == thread) {
        try {
          Bundle bundle = context.installBundle(TEST_BUNDLE_LOCATION);
          Thread.sleep(100);
          bundle.start();
          Thread.sleep(100);
          bundle.stop();
          Thread.sleep(100);
          bundle.uninstall();
          Thread.sleep(100);
View Full Code Here


    Bundle installBundle(String name, InputStream is) {
        Bundle b = null;
        try {
            info("installing " + name);
            b = bc.installBundle(name, is);
            b.start();
            updateLife(b, SHORT_LIFE);
            return b;
        } catch (Exception e) {
            error("failed to install " + name);
            try {
View Full Code Here

 
  public boolean runTest() {

    try {
      Bundle bundle = Util.installBundle(bc, "bundleEnd1_test-1.0.0.jar");
      bundle.start();
      bundle.stop();
      bundle.uninstall();
    } catch (BundleException e) {
      e.printStackTrace();
      return false;
View Full Code Here

  }

  public boolean runTest() {
    try {
      Bundle bundle = Util.installBundle(bc, "bundleEnd151_test-1.0.0.jar");
      bundle.start();
     
      for (int i = 0; i < loops; i++) {  
        for (int o = 0; o < locales.length; o++) {
          bundle.getHeaders(locales[o]);
        }
View Full Code Here

      for (int i = 0; i < loc.length; i++) {
        url = completeLocation(loc[i]);
        Bundle b = bc.installBundle(url);
        out.println("Installed: " + showBundle(b));
        if (opts.get("-s") != null) {
          b.start(Bundle.START_ACTIVATION_POLICY);
          out.println("Started: " + showBundle(b));
        }
      }
    } catch (BundleException e) {
      Throwable t = e;
View Full Code Here

  public boolean runTest() {
    try {
      Bundle fragment = Util.installBundle(bc, "bundleEnd152_test-1.0.0.jar");
      Bundle bundle = Util.installBundle(bc, "bundleEnd151_test-1.0.0.jar");
      bundle.start();

      for (int i = 0; i < loops; i++) {  
        for (int o = 0; o < locales.length; o++) {
          bundle.getHeaders(locales[o]);
        }
View Full Code Here

    public long install(String url, boolean start) throws MBeanException {
        try {
            Bundle bundle = bundleContext.installBundle(url, null);
            if (start) {
                bundle.start();
            }
            return bundle.getBundleId();
        } catch (Exception e) {
            throw new MBeanException(null, e.getMessage());
        }
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

                TinyBundles.newBundle()
                    .set( Constants.BUNDLE_ACTIVATOR, TimeoutShutdownActivator.class.getName() )
                    .add( activatorName, getClass().getClassLoader().getResourceAsStream( activatorName ) )
                    .build( withBnd() )
        );
        bundle.start();

        long t0 = System.currentTimeMillis();
        main.destroy();
        long t1 = System.currentTimeMillis();
//        System.err.println("Shutdown duration: " + (t1 - t0) + " ms");
View Full Code Here

          if (pi != null) {
            // Start the bundle if there is one
            Bundle bundle = Platform.getBundle(pi);
            if (bundle != null) {
              try {
                bundle.start(Bundle.START_TRANSIENT);
              } catch (BundleException exception) {
                StatusManager
                    .getManager()
                    .handle(
                        new Status(
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.