Package org.osgi.framework

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


     * @see org.osgi.jmx.framework.FrameworkMBean#uninstallBundle(long)
     */
    public void uninstallBundle(long bundleIdentifier) throws IOException {
        Bundle bundle = FrameworkUtils.resolveBundle(context, bundleIdentifier);
        try {
            bundle.uninstall();
        } catch (Exception be) {
            IOException ioex = new IOException("Uninstall of bundle with id " + bundleIdentifier + " failed with message: " + be.getMessage());
            ioex.initCause(be);
            throw ioex;
        }
View Full Code Here


                logger.logp(Level.WARNING, "BundleProvisioner", "uninstall",
                        "Can't uninstall bundle = {0} as it's already uninstalled", new Object[]{bundle});
                continue;
            }
            try {
                bundle.uninstall();
                noOfUninstalledBundles++;
                removeBundle(jar);
                logger.logp(Level.INFO, "BundleProvisioner", "uninstall",
                        "Uninstalled bundle {0} installed from {1} ",
                        new Object[]{bundle.getBundleId(), jar.getPath()});
View Full Code Here

            }
            try {
                if (isFrameworkExtensionBundle(bundle)) {
                    setSystemBundleUpdationRequired(true);
                }
                bundle.uninstall();
                noOfUninstalledBundles++;
                removeBundle(jar);
                logger.log(Level.INFO, LogFacade.UNINSTALLED_BUNDLE, new Object[]{bundle.getBundleId(), jar.getPath()});
            } catch (Exception e) {
                LogFacade.log(logger,
View Full Code Here

        try {
            OpsParams params = context.getCommandParameters(OpsParams.class);
            // we should clean for both undeployment and the failed deployment
            if (params.origin.isUndeploy() || params.origin.isDeploy()) {
                Bundle bundle = getApplicationBundle(context);
                bundle.uninstall();
                getPA().refreshPackages(new Bundle[]{bundle});
                System.out.println("Uninstalled " + bundle);
            }
        } catch (BundleException e) {
            throw new RuntimeException(e);
View Full Code Here

            logger.warn("Could not find Bundle for file: " + file.getCanonicalPath());
        }
        else {
            changedBundles.add(bundle);
            bundle.stop();
            bundle.uninstall();
        }
    }

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

                applicationBundles.add(bundle);
            }
        } catch (BundleException be) {
            for (Bundle bundle : applicationBundles) {
                bundle.uninstall();
            }

            applicationBundles.clear();

            throw be;
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

        expect(installedBundle.getHeaders()).andReturn(new Hashtable());
        installedBundle.start();

        // uninstalls first feature name = f2, version = 0.1
        expect(bundleContext.getBundle(12345)).andReturn(installedBundle);
        installedBundle.uninstall();

        expect(bundleContext.getDataFile(EasyMock.<String>anyObject())).andReturn(dataFile).anyTimes();

        replay(bundleContext, installedBundle);
        return bundleContext;
View Full Code Here

        expect(bundleContext.getBundles()).andReturn(new Bundle[0]);
        expect(bundleContext.installBundle(eq(bundle2), isA(InputStream.class))).andReturn(installedBundle2);
        expect(installedBundle2.getBundleId()).andReturn(54321L);
        expect(installedBundle2.getBundleId()).andReturn(54321L);
        expect(installedBundle2.getBundleId()).andReturn(54321L);
        installedBundle2.uninstall();

        expect(bundleContext.getDataFile(EasyMock.<String>anyObject())).andReturn(dataFile).anyTimes();

        replay(bundleContext, installedBundle1, installedBundle2);
View Full Code Here

        expect(installedBundle.getHeaders()).andReturn(new Hashtable());
        installedBundle.start();

        // UnInstalls f1 and 0.1
        expect(bundleContext.getBundle(12345)).andReturn(installedBundle);
        installedBundle.uninstall();

        // UnInstalls f1 and 0.2
        expect(bundleContext.getBundle(123456)).andReturn(installedBundle);
        installedBundle.uninstall();
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.