@Override public void uninstallBundle(long bundleId) throws Exception { try { frameworkMBean.uninstallBundle(bundleId); logger.info("Bundle '" + bundleId + " was uninstalled"); } catch (Exception ex) { throw new LifecycleException("Cannot uninstall " + bundleId, ex); } }
@Override public void uninstallBundle(long bundleId) throws IOException { if (log.isTraceEnabled()) log.trace("uninstallBundle: " + bundleId); getFrameworkMBean().uninstallBundle(bundleId); }
private void undeploy(String symbolicName) throws DeploymentException { BundleHandle handle = deployedBundles.remove(symbolicName); if (handle != null) { String bundleState = null; try { long bundleId = handle.getBundleId(); CompositeData bundleType = bundleStateMBean.getBundle(bundleId); if (bundleType != null) { bundleState = (String) bundleType.get(BundleStateMBean.STATE); } } catch (IOException e) { // ignore non-existent bundle return; } if (bundleState != null && !bundleState.equals(BundleStateMBean.UNINSTALLED)) { try { long bundleId = handle.getBundleId(); frameworkMBean.uninstallBundle(bundleId); } catch (IOException ex) { logger.error("Cannot undeploy: " + symbolicName, ex); } } } }
@Override protected void uninstallInternal() throws BundleException { assertNotUninstalled(); try { getRuntime().getFrameworkMBean().uninstallBundle(bundleId); OSGiRuntimeImpl runtimeImpl = (OSGiRuntimeImpl)getRuntime(); runtimeImpl.unregisterBundle(this); uninstalled = true; } catch (RuntimeException rte) { throw rte; } catch (Exception ex) { log.error("Cannot uninstall: " + getLocation(), ex); } }