/** * Unload the specified plugin and it's dependents. */ @Override public boolean unloadPlugin(String pluginId) { return unloadPlugin(pluginId, true); }
while (!dependents.isEmpty()) { String dependent = dependents.remove(0); unloadPlugin(dependent, false); dependents.addAll(0, dependencyResolver.getDependents(dependent));
@Override public boolean deletePlugin(String pluginId) { checkPluginId(pluginId); PluginWrapper pluginWrapper = getPlugin(pluginId); PluginState pluginState = stopPlugin(pluginId); if (PluginState.STARTED == pluginState) { log.error("Failed to stop plugin '{}' on delete", pluginId); return false; } if (!unloadPlugin(pluginId)) { log.error("Failed to unload plugin '{}' on delete", pluginId); return false; } try { pluginWrapper.getPlugin().delete(); } catch (PluginException e) { log.error(e.getMessage(), e); return false; } Path pluginPath = pluginWrapper.getPluginPath(); return pluginRepository.deletePluginPath(pluginPath); }
/** * Unload the specified plugin and it's dependents. */ @Override public boolean unloadPlugin(String pluginId) { return unloadPlugin(pluginId, true); }
while (!dependents.isEmpty()) { String dependent = dependents.remove(0); unloadPlugin(dependent, false); dependents.addAll(0, dependencyResolver.getDependents(dependent));
@Override public boolean deletePlugin(String pluginId) { checkPluginId(pluginId); PluginWrapper pluginWrapper = getPlugin(pluginId); PluginState pluginState = stopPlugin(pluginId); if (PluginState.STARTED == pluginState) { log.error("Failed to stop plugin '{}' on delete", pluginId); return false; } if (!unloadPlugin(pluginId)) { log.error("Failed to unload plugin '{}' on delete", pluginId); return false; } try { pluginWrapper.getPlugin().delete(); } catch (PluginException e) { log.error(e.getMessage(), e); return false; } Path pluginPath = pluginWrapper.getPluginPath(); return pluginRepository.deletePluginPath(pluginPath); }