void uninstallPlugin()

in taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java [237:272]


	void uninstallPlugin(Plugin plugin) {
		synchronized (installedPlugins) {
			if (installedPlugins.containsKey(plugin.getId())) {
				for (Bundle bundle : plugin.getBundles()) {
					if (installedBundles.contains(bundle)) {
						// check if bundle is used by other plugins
						boolean bundleInUse = false;
						for (Plugin installedPlugin : installedPlugins.values()) {
							if (!installedPlugin.equals(plugin)) {
								if (installedPlugin.getBundles().contains(bundle)) {
									bundleInUse = true;
									break;
								}
							}
						}
						if (!bundleInUse) {
							try {
								logger.info("Uninstalling bundle " + bundle.getSymbolicName());
								bundle.uninstall();
								installedBundles.remove(bundle);
								System.out.println("Remove " + bundle.getSymbolicName());
							} catch (BundleException e) {
								logger.warn(String.format(
										"Error uninstalling bundle %1$s for plugin %2$s",
										bundle.getSymbolicName(), plugin.getName()), e);
							}
						}
					}
				}
				installedPlugins.remove(plugin.getId());
				pluginUpdates.remove(plugin.getId());
				updateAvailablePlugins = true;
				postEvent(PluginManager.PLUGIN_UNINSTALLED);
			}
		}
	}