Browse Source

Resolve #242

tags/release-2.5.0
Decebal Suiu 5 years ago
parent
commit
74865ee6da

+ 7
- 0
pf4j/src/main/java/org/pf4j/AbstractPluginManager.java View File

@@ -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);

+ 11
- 2
pf4j/src/main/java/org/pf4j/Plugin.java View File

@@ -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