public interface Plugin
If a plugin wants to take advantage of the "Configure plugin" button displayed in the Plugin manager,
the plugin has to implement the
The plugin may store settings and persistent files which will be saved in the plugin's own context. This plugin context is bound to the main class of the plugin, so the main class cannot be changed. If the main class of the plugin is changed (the package name and/or the class name), a new context will be assigned to the plugin.
|Modifier and Type||Field and Description|
Plugin API version.
static final java.lang.String API_VERSION
static final java.lang.String VERSION
void init(PluginDescriptor pluginDescriptor, PluginServices pluginServices, GeneralServices generalServices)
This method is only called once in the lifetime of a plugin.
The plugin may start a new
Thread if the initialization takes long or if it intends to perform a background job.
If this method throws an
destroy() method will be called and the plugin will be discarded.
If initialization fails, an
Exception should be thrown to indicate the failure.
pluginDescriptor- the plugin descriptor; this reference should be stored by the plugin if the plugin needs it later
pluginServices- reference to the plugin services; this reference should be stored by the plugin if the plugin intends to use it later
generalServices- reference to the general services; this reference should be stored by the plugin if the plugin intends to use it later
The plugin should release all allocated resources and stop all background jobs and threads created by it.
The plugin cannot perform any tasks after returning from this method because the application may be terminated at any time.
This method will be called even if the plugin is instantiated successfully (the constructor throws no exception)
init(PluginDescriptor, PluginServices, GeneralServices) throws an exception.
Exception will be silently discarded.