/** * Stop the specified plugin and it's dependents. */ @Override public PluginState stopPlugin(String pluginId) { return stopPlugin(pluginId, true); }
PluginState pluginState = stopPlugin(pluginId, false); if (PluginState.STARTED == pluginState) { return false;
@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); }
while (!dependents.isEmpty()) { String dependent = dependents.remove(0); stopPlugin(dependent, false); dependents.addAll(0, dependencyResolver.getDependents(dependent));
@Override public boolean disablePlugin(String pluginId) { checkPluginId(pluginId); PluginWrapper pluginWrapper = getPlugin(pluginId); PluginDescriptor pluginDescriptor = pluginWrapper.getDescriptor(); PluginState pluginState = pluginWrapper.getPluginState(); if (PluginState.DISABLED == pluginState) { log.debug("Already disabled plugin '{}'", getPluginLabel(pluginDescriptor)); return true; } if (PluginState.STOPPED == stopPlugin(pluginId)) { pluginWrapper.setPluginState(PluginState.DISABLED); firePluginStateEvent(new PluginStateEvent(this, pluginWrapper, PluginState.STOPPED)); if (!pluginStatusProvider.disablePlugin(pluginId)) { return false; } log.info("Disabled plugin '{}'", getPluginLabel(pluginDescriptor)); return true; } return false; }
/** * Stop the specified plugin and it's dependents. */ @Override public PluginState stopPlugin(String pluginId) { return stopPlugin(pluginId, true); }
PluginState pluginState = stopPlugin(pluginId, false); if (PluginState.STARTED == pluginState) { return false;
@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); }
while (!dependents.isEmpty()) { String dependent = dependents.remove(0); stopPlugin(dependent, false); dependents.addAll(0, dependencyResolver.getDependents(dependent));
@Override public boolean disablePlugin(String pluginId) { checkPluginId(pluginId); PluginWrapper pluginWrapper = getPlugin(pluginId); PluginDescriptor pluginDescriptor = pluginWrapper.getDescriptor(); PluginState pluginState = pluginWrapper.getPluginState(); if (PluginState.DISABLED == pluginState) { log.debug("Already disabled plugin '{}'", getPluginLabel(pluginDescriptor)); return true; } if (PluginState.STOPPED == stopPlugin(pluginId)) { pluginWrapper.setPluginState(PluginState.DISABLED); firePluginStateEvent(new PluginStateEvent(this, pluginWrapper, PluginState.STOPPED)); if (!pluginStatusProvider.disablePlugin(pluginId)) { return false; } log.info("Disabled plugin '{}'", getPluginLabel(pluginDescriptor)); return true; } return false; }