PluginWrapper pluginWrapper = getPlugin(pluginId); log.info("Unload plugin '{}'", getPluginLabel(pluginWrapper.getDescriptor()));
@Override public boolean enablePlugin(String pluginId) { checkPluginId(pluginId); PluginWrapper pluginWrapper = getPlugin(pluginId); if (!isPluginValid(pluginWrapper)) { log.warn("Plugin '{}' can not be enabled", getPluginLabel(pluginWrapper.getDescriptor())); return false; } PluginDescriptor pluginDescriptor = pluginWrapper.getDescriptor(); PluginState pluginState = pluginWrapper.getPluginState(); if (PluginState.DISABLED != pluginState) { log.debug("Plugin '{}' is not disabled", getPluginLabel(pluginDescriptor)); return true; } if (!pluginStatusProvider.enablePlugin(pluginId)) { return false; } pluginWrapper.setPluginState(PluginState.CREATED); firePluginStateEvent(new PluginStateEvent(this, pluginWrapper, pluginState)); log.info("Enabled plugin '{}'", getPluginLabel(pluginDescriptor)); return true; }
@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); }
@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; }
PluginWrapper pluginWrapper = getPlugin(pluginId); log.info("Unload plugin '{}'", getPluginLabel(pluginWrapper.getDescriptor()));
@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); }
private PluginState stopPlugin(String pluginId, boolean stopDependents) { checkPluginId(pluginId); PluginWrapper pluginWrapper = getPlugin(pluginId); PluginDescriptor pluginDescriptor = pluginWrapper.getDescriptor(); PluginState pluginState = pluginWrapper.getPluginState();
checkPluginId(pluginId); PluginWrapper pluginWrapper = getPlugin(pluginId); PluginDescriptor pluginDescriptor = pluginWrapper.getDescriptor(); PluginState pluginState = pluginWrapper.getPluginState();
@Override public boolean enablePlugin(String pluginId) { checkPluginId(pluginId); PluginWrapper pluginWrapper = getPlugin(pluginId); if (!isPluginValid(pluginWrapper)) { log.warn("Plugin '{}' can not be enabled", getPluginLabel(pluginWrapper.getDescriptor())); return false; } PluginDescriptor pluginDescriptor = pluginWrapper.getDescriptor(); PluginState pluginState = pluginWrapper.getPluginState(); if (PluginState.DISABLED != pluginState) { log.debug("Plugin '{}' is not disabled", getPluginLabel(pluginDescriptor)); return true; } if (!pluginStatusProvider.enablePlugin(pluginId)) { return false; } pluginWrapper.setPluginState(PluginState.CREATED); firePluginStateEvent(new PluginStateEvent(this, pluginWrapper, pluginState)); log.info("Enabled plugin '{}'", getPluginLabel(pluginDescriptor)); return true; }
@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; }
private PluginState stopPlugin(String pluginId, boolean stopDependents) { checkPluginId(pluginId); PluginWrapper pluginWrapper = getPlugin(pluginId); PluginDescriptor pluginDescriptor = pluginWrapper.getDescriptor(); PluginState pluginState = pluginWrapper.getPluginState();
checkPluginId(pluginId); PluginWrapper pluginWrapper = getPlugin(pluginId); PluginDescriptor pluginDescriptor = pluginWrapper.getDescriptor(); PluginState pluginState = pluginWrapper.getPluginState();