Package org.osgi.framework

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


        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);
        } catch (InterruptedException ignore) { }
      }
View Full Code Here


                        options,
                        options[1]);
    if(n == 0) {
      try {
        Bundle sysBundle = Activator.getBC().getBundle((long)0);
        sysBundle.stop();
      } catch (Exception e) {
        showErr("Failed to stop bundle.", e);
      }
    }
  }
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

          out.println("Failed to restart the framework " + e);
          return 1;
        }
      } else {
        try {
          sysBundle.stop(); // shut down the framework
        } catch (Exception e) {
          out.println("Failed to stop using system bundle " + e);
          try {
            System.exit(0);
          } catch (Exception e2) {
View Full Code Here

    protected Object doExecute() throws Exception {
        new Thread() {
            public void run() {
                try {
                    Bundle bundle = getBundleContext().getBundle(0);
                    bundle.stop();
                } catch (Exception e) {
                    log.error("Error when shutting down Apache Karaf", e);
                }
            }
        }.start();
View Full Code Here

    {
        // Get system bundle and use it to shutdown Felix.
        try
        {
            Bundle bundle = m_context.getBundle(0);
            bundle.stop();
        }
        catch (Exception ex)
        {
            err.println(ex.toString());
        }
View Full Code Here

        }
        else
        {
            try
            {
                b.stop();
                writeOk();
            }
            catch (BundleException e)
            {
                writeError();
View Full Code Here

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

  Bundle bc = s1.getContext().getBundle();
  bc.stop();

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

        bundle.stop();
        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

            found |= PLATFORM_TRANSACTION_MANAGER_CLASS.equals(clazz);
        }
        assertFalse(found);

        Bundle bundle = ref.getBundle();
        bundle.stop();
        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");
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.