Package org.jorigin.plugin
Interface IPlugin
-
public interface IPluginThis interface represent an application plugin. An aplication plugin enable to extends an application with various functions. The plugin interface specifies the method necessary to the plugin manager for managing the plugin.- Since:
- 1.0.0
- Version:
- "1.0.8" - b201801141330L
- Author:
- Julien Seinturier - COMEX S.A. - contact@jorigin.org - https://github.com/jorigin/jeometry
-
-
Field Summary
Fields Modifier and Type Field Description static intPLUGIN_INITIALIZEDFinal identifier for the plugin state corresponding to initialized.static intPLUGIN_STARTEDIdentifier for the plugin state corresponding to started.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String[]getDependencies()Return the dependencies of the plugin.java.lang.StringgetName()Get the name of the plugin.intgetPluginState()Return the state of the plugin.booleanisPluginInitialized()Returntrueif the plugin is initialized.booleanisPluginStarted()Returntrueif the plugin is started,falseotherwise.booleanpluginInit(IPlugger plugger)Init the plugin and give the plugin a reference to the plugger where it is registered.booleanpluginStart()Method called when the plugger starts the pluginbooleanpluginStop()Method called when the plugger stop the plugin
-
-
-
Field Detail
-
PLUGIN_INITIALIZED
static final int PLUGIN_INITIALIZED
Final identifier for the plugin state corresponding to initialized.- See Also:
getPluginState(), Constant Field Values
-
PLUGIN_STARTED
static final int PLUGIN_STARTED
Identifier for the plugin state corresponding to started.- See Also:
getPluginState(), Constant Field Values
-
-
Method Detail
-
pluginInit
boolean pluginInit(IPlugger plugger) throws java.lang.Exception
Init the plugin and give the plugin a reference to the plugger where it is registered.- Parameters:
plugger- plugger the reference to the plugger- Returns:
- true if the plugin is correctly initialized, false otherwise.
- Throws:
java.lang.Exception- if an error occurs.
-
pluginStart
boolean pluginStart()
Method called when the plugger starts the plugin- Returns:
trueif the plugin is started,falseotherwise.
-
pluginStop
boolean pluginStop()
Method called when the plugger stop the plugin- Returns:
trueif the plugin is stopped,falseotherwise.
-
getName
java.lang.String getName()
Get the name of the plugin. The name must be unique. The canonical name of the plugin class can be used.- Returns:
- the name of the plugin.
-
getDependencies
java.lang.String[] getDependencies()
Return the dependencies of the plugin. Dependencies are represented by the name of the required plugins to make this plugin to work.- Returns:
- An array of plugin names.
-
getPluginState
int getPluginState()
Return the state of the plugin. State can be composed by:PLUGIN_INITIALIZED,PLUGIN_STARTED.- Returns:
- the plugin state.
-
isPluginInitialized
boolean isPluginInitialized()
Returntrueif the plugin is initialized.- Returns:
trueif the plugin is initialized,falseotherwise.
-
isPluginStarted
boolean isPluginStarted()
Returntrueif the plugin is started,falseotherwise.- Returns:
trueif the plugin is started,falseotherwise.
-
-