Browse Source

stop only started plugins

pull/3/head
Decebal Suiu 12 years ago
parent
commit
ded0b1f519
  1. 7
      pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginManager.java

7
pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginManager.java

@ -113,9 +113,6 @@ public class DefaultPluginManager implements PluginManager {
System.setProperty("pf4j.pluginsDir", pluginsDirectory.getAbsolutePath()); System.setProperty("pf4j.pluginsDir", pluginsDirectory.getAbsolutePath());
} }
/**
* Retrieves all active plugins.
*/
public List<PluginWrapper> getPlugins() { public List<PluginWrapper> getPlugins() {
return new ArrayList<PluginWrapper>(plugins.values()); return new ArrayList<PluginWrapper>(plugins.values());
} }
@ -144,7 +141,6 @@ public class DefaultPluginManager implements PluginManager {
* Start all active plugins. * Start all active plugins.
*/ */
public void startPlugins() { public void startPlugins() {
List<PluginWrapper> resolvedPlugins = getResolvedPlugins();
for (PluginWrapper pluginWrapper : resolvedPlugins) { for (PluginWrapper pluginWrapper : resolvedPlugins) {
try { try {
LOG.info("Start plugin '" + pluginWrapper.getDescriptor().getPluginId() + "'"); LOG.info("Start plugin '" + pluginWrapper.getDescriptor().getPluginId() + "'");
@ -160,8 +156,7 @@ public class DefaultPluginManager implements PluginManager {
* Stop all active plugins. * Stop all active plugins.
*/ */
public void stopPlugins() { public void stopPlugins() {
List<PluginWrapper> resolvedPlugins = getResolvedPlugins(); for (PluginWrapper pluginWrapper : startedPlugins) {
for (PluginWrapper pluginWrapper : resolvedPlugins) {
try { try {
LOG.info("Stop plugin '" + pluginWrapper.getDescriptor().getPluginId() + "'"); LOG.info("Stop plugin '" + pluginWrapper.getDescriptor().getPluginId() + "'");
pluginWrapper.getPlugin().stop(); pluginWrapper.getPlugin().stop();

Loading…
Cancel
Save