Browse Source

Resolve #242

pull/255/head
Decebal Suiu 6 years ago
parent
commit
74865ee6da
  1. 7
      pf4j/src/main/java/org/pf4j/AbstractPluginManager.java
  2. 13
      pf4j/src/main/java/org/pf4j/Plugin.java

7
pf4j/src/main/java/org/pf4j/AbstractPluginManager.java

@ -303,6 +303,13 @@ public abstract class AbstractPluginManager implements PluginManager {
return false;
}
try {
pluginWrapper.getPlugin().delete();
} catch (PluginException e) {
log.error(e.getMessage(), e);
return false;
}
Path pluginPath = pluginWrapper.getPluginPath();
return pluginRepository.deletePluginPath(pluginPath);

13
pf4j/src/main/java/org/pf4j/Plugin.java

@ -57,15 +57,24 @@ public class Plugin {
}
/**
* Start method is called by the application when the plugin is loaded.
* This method is called by the application when the plugin is started.
* See {@link PluginManager#startPlugin(String)}.
*/
public void start() throws PluginException {
}
/**
* Stop method is called by the application when the plugin is unloaded.
* This method is called by the application when the plugin is stopped.
* See {@link PluginManager#stopPlugin(String)}.
*/
public void stop() throws PluginException {
}
/**
* This method is called by the application when the plugin is deleted.
* See {@link PluginManager#deletePlugin(String)}.
*/
public void delete() throws PluginException {
}
}

Loading…
Cancel
Save