Package org.osgi.framework

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


        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


            // stale bundle, save a copy for rolling back and uninstall it
            String symbolicName = bundleInfo.getSymbolicName();
            try {
                Bundle bundle = target.getBundle(symbolicName);
                if (bundle != null) {
                    bundle.uninstall();
                    addRollback(new InstallBundleRunnable(bundle, target, log));
                }
            }
            catch (Exception be) {
                log.log(LogService.LOG_WARNING, "Bundle '" + symbolicName + "' could not be uninstalled", be);
View Full Code Here

            if (!bundleInfo.isCustomizer() && source.getBundleInfoByName(symbolicName) == null) {
                // stale bundle, save a copy for rolling back and uninstall it
                try {
                    Bundle bundle = target.getBundle(symbolicName);
                    bundle.uninstall();
                    addRollback(new InstallBundleRunnable(bundle, target, log));
                }
                catch (Exception be) {
                    log.log(LogService.LOG_WARNING, "Bundle '" + symbolicName + "' could not be uninstalled", be);
                }
View Full Code Here

                          persistenceBundle.getSymbolicName());
               
                Bundle fragment = fragmentMap.remove(persistenceBundle);
                if (fragment != null) {
                    try {
                        fragment.uninstall();
                    } catch (BundleException e) {
                        // ignore
                    }
                }
            }
View Full Code Here

                if (bundle != null) {
                    if (BundleUtils.canStop(bundle)) {
                        bundle.stop(Bundle.STOP_TRANSIENT);
                    }
                    if (BundleUtils.canUninstall(bundle)) {
                        bundle.uninstall();
                    }
                }
            } catch (BundleException e) {
                monitor.finished();
                throw new LifecycleException("unload", configurationId, e);
View Full Code Here

       
        // uninstall bundle
        Bundle bundle = bundleContext.getBundle(bundleId);
        String bundleLocation = bundle.getLocation();
        try {
            bundle.uninstall();
        } catch (BundleException e) {
            log.error("Bundle uninstallation failed: " + bundleLocation);
        }
       
        Artifact artifact = getArtifactFromMvnLocation(bundleLocation);
View Full Code Here

                        addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.bundlemanager.info.start", symbolicName, id));
                    } else if (STOP_OPERATION.equals(operation)) {
                        bundle.stop();
                        addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.bundlemanager.info.stop", symbolicName, id));
                    } else if (UNINSTALL_OPERATION.equals(operation)) {
                        bundle.uninstall();
                        addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.bundlemanager.info.uninstall", symbolicName, id));
                    } else if (UPDATE_OPERATION.equals(operation)) {
                        bundle.update();
                        addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.bundlemanager.info.update", symbolicName, id));
                    } else if (REFRESH_OPERATION.equals(operation)) {
View Full Code Here

        }
        finally
        {
            b.stop();
            b.uninstall();
            f.uninstall();
        }
    }

    private File createBundle(String manifest) throws IOException
    {
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

                }
                log(Logger.LOG_DEBUG,
                    "Uninstalling bundle "
                    + bundle.getBundleId() + " ("
                    + bundle.getSymbolicName() + ")", null);
                bundle.uninstall();
            }
            log(Logger.LOG_INFO, "Uninstalled " + path, null);
        }
        catch (Exception e)
        {
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.