Package org.osgi.framework

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


                else if ( "uninstall".equals( action ) )
                {
                    // uninstall bundle
                    try
                    {
                        bundle.uninstall();
                    }
                    catch ( BundleException be )
                    {
                        bundleException = be;
                        log( "Cannot uninstall", be );
View Full Code Here


        if (bundle == null) {
            LOGGER.warn("Could not find Bundle for file: " + file.getCanonicalPath());
        }
        else {
            bundle.stop();
            bundle.uninstall();
        }
    }

    protected Bundle getBundleForJarFile(File file) throws IOException {
        String absoluteFilePath = file.getAbsoluteFile().toURI().toString();
View Full Code Here

            bundles.removeAll(b);
        }
        for (long bundleId : bundles) {
            Bundle b = getBundleContext().getBundle(bundleId);
            if (b != null) {
                b.uninstall();
            }
        }
        if (refresh) {
            if (verbose) {
                System.out.println("Refreshing packages");
View Full Code Here

        }
        if (!errors.isEmpty()) {
            throw errors.get(0);
        }
        //Thread.sleep(500);
        saBundle.uninstall();
        //sa.stop();
        //sa.shutDown();
    }

    public void testJbiLifecycle() throws Exception {
View Full Code Here

            if (bundle == null) {
                LOGGER.warn("Could not find Bundle for Service Assembly: " + getName());
            } else {
                bundle.stop();
                bundle.uninstall();
                try {
                    deletePreferences();
                } catch (BackingStoreException e) {
                    LOGGER.warn("Error cleaning persistent state for service assembly: " + getName(), e);
                }
View Full Code Here

            bundles.removeAll(b);
        }
        for (long bundleId : bundles) {
            Bundle b = getBundleContext().getBundle(bundleId);
            if (b != null) {
                b.uninstall();
            }
        }
        refreshPackages(null);
        callListeners(new FeatureEvent(feature, FeatureEvent.EventType.FeatureUninstalled, false));
        saveState();
View Full Code Here

        jarOut.close();
        out.close();

        if (existingBundle != null) {
            existingBundle.stop();
            existingBundle.uninstall();
        }

        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());

        Bundle bundle = bundleContext.installBundle("file://" + bundleName
View Full Code Here

          Bundle bundle = installedBundles[i];
          if (bundle.getLocation().matches(mavenArtifactDesc.getShortUri() + "/.*[0-9].*")) {
            if (installMissing) {
              isInstalled = true;
            } else {
              bundle.uninstall();
            }
          }
        }
        if (!installMissing || (installMissing && !isInstalled)) {
          artsToBeInstalled.add(mavenArtifactDesc);
View Full Code Here

        testBundle.start();

        assertEquals(Bundle.ACTIVE, framework.getState());
        assertEquals(Bundle.ACTIVE, testBundle.getState());

        testBundle.uninstall();

        Dictionary headers = testBundle.getHeaders("en");
        Assert.assertEquals("org.papoose.test-support.bundle", headers.get("Bundle-SymbOLicName"));

        headers = testBundle.getHeaders("en");
View Full Code Here

    Bundle bundle = getBundle(args);

    if (bundle == m_context.getBundle()) {
      new SelfUninstallThread(bundle).start();
    } else {
      bundle.uninstall();
    }
  }

  private static final class SelfUninstallThread extends Thread {
    private final Bundle m_self;
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.