Package org.pf4j
Class Plugin
- java.lang.Object
-
- org.pf4j.Plugin
-
public class Plugin extends java.lang.Object
This class will be extended by all plugins and serve as the common class between a plugin and the application.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Logger
log
Makes logging service available for descending classes.protected PluginWrapper
wrapper
Wrapper of the plugin.
-
Constructor Summary
Constructors Constructor Description Plugin(PluginWrapper wrapper)
Constructor to be used by plugin manager for plugin instantiation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
This method is called by the application when the plugin is deleted.PluginWrapper
getWrapper()
Retrieves the wrapper of this plug-in.void
start()
This method is called by the application when the plugin is started.void
stop()
This method is called by the application when the plugin is stopped.
-
-
-
Field Detail
-
log
protected final org.slf4j.Logger log
Makes logging service available for descending classes.
-
wrapper
protected PluginWrapper wrapper
Wrapper of the plugin.
-
-
Constructor Detail
-
Plugin
public Plugin(PluginWrapper wrapper)
Constructor to be used by plugin manager for plugin instantiation. Your plugins have to provide constructor with this exact signature to be successfully loaded by manager.
-
-
Method Detail
-
getWrapper
public final PluginWrapper getWrapper()
Retrieves the wrapper of this plug-in.
-
start
public void start()
This method is called by the application when the plugin is started. SeePluginManager.startPlugin(String)
.
-
stop
public void stop()
This method is called by the application when the plugin is stopped. SeePluginManager.stopPlugin(String)
.
-
delete
public void delete()
This method is called by the application when the plugin is deleted. SeePluginManager.deletePlugin(String)
.
-
-