Package org.jorigin.plugin
Class DefaultPluginManager
- java.lang.Object
-
- org.jorigin.plugin.DefaultPluginManager
-
- All Implemented Interfaces:
IPluginManager
public class DefaultPluginManager extends java.lang.Object implements IPluginManager
This class is a default implementation of theIPluginManagerinterface. The plugins are stored in an underlyingArrayList.- Since:
- 1.0.0
- Version:
- "1.0.9" - b201903071030L
- Author:
- Julien Seinturier - COMEX S.A. - contact@jorigin.org - https://github.com/jorigin/jeometry
-
-
Constructor Summary
Constructors Constructor Description DefaultPluginManager(IPlugger plugger)Create a default plugin manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddPluginExclude(java.lang.String pluginName)Add a plugin name to the exclude list.booleanaddPluginInclude(java.lang.String pluginName)Add a plugin name to the include list.booleanaddPluginManagerListener(PluginManagerListener listener)Add a plugin manager listener to the plugin manager.java.util.ArrayList<java.lang.String>getPluginExcludes()Get the list of the name of the excluded plugins.java.util.ArrayList<java.lang.String>getPluginIncludes()Get the list of the name of the included plugins.voidpluginAllInit()Init all plugins registered to this manager.voidpluginAllRestart()Restart all plugins registered to this manager.voidpluginAllStart()Start all plugins registered to this manager.voidpluginAllStop()Stop all plugins registered to theis manager.voidpluginInit(IPlugin plugin)Initialize the plugin given in parameter.voidpluginRegister(IPlugin plugin)Register a plugin to the plugin manager.voidpluginRestart(IPlugin plugin)Restart the plugin given in parameter.voidpluginStart(IPlugin plugin)Start the plugin given in parameter.voidpluginStop(IPlugin plugin)Stop the plugin given in parameter.voidpluginUnregister(IPlugin plugin)Unregister the given plugin from the plugin managerbooleanremovePluginExclude(java.lang.String pluginName)Remove a plugin name from the exclude list.booleanremovePluginInclude(java.lang.String pluginName)Remove a plugin name from the include list.booleanremovePluginManagerListener(PluginManagerListener listener)Remove a plugin manager listener from the plugin manager.
-
-
-
Method Detail
-
addPluginExclude
public boolean addPluginExclude(java.lang.String pluginName)
Description copied from interface:IPluginManagerAdd a plugin name to the exclude list.- Specified by:
addPluginExcludein interfaceIPluginManager- Parameters:
pluginName- the name of the plugin to exclude.- Returns:
trueif the plugin has been successfully added to the exclude list, false otherwise. Please note that if the plugin name is already in the exclude list it will not be added twice.- See Also:
IPluginManager.removePluginExclude(String),IPluginManager.addPluginInclude(String),IPluginManager.removePluginInclude(String)
-
addPluginInclude
public boolean addPluginInclude(java.lang.String pluginName)
Description copied from interface:IPluginManagerAdd a plugin name to the include list.- Specified by:
addPluginIncludein interfaceIPluginManager- Parameters:
pluginName- the name of the plugin to include.- Returns:
trueif the plugin has been succesfully added to the include list, false otherwise. Please note that if the plugin name is already in the include list it will not be added twice.- See Also:
IPluginManager.addPluginExclude(String),IPluginManager.removePluginExclude(String),IPluginManager.removePluginInclude(String)
-
getPluginExcludes
public java.util.ArrayList<java.lang.String> getPluginExcludes()
Description copied from interface:IPluginManagerGet the list of the name of the excluded plugins.- Specified by:
getPluginExcludesin interfaceIPluginManager- Returns:
- the list of the name of the excluded plugins.
- See Also:
IPluginManager.addPluginExclude(String),IPluginManager.removePluginExclude(String),IPluginManager.addPluginInclude(String),IPluginManager.removePluginInclude(String)
-
getPluginIncludes
public java.util.ArrayList<java.lang.String> getPluginIncludes()
Description copied from interface:IPluginManagerGet the list of the name of the included plugins.- Specified by:
getPluginIncludesin interfaceIPluginManager- Returns:
- the list of the name of the excluded plugins.
- See Also:
IPluginManager.addPluginExclude(String),IPluginManager.removePluginExclude(String),IPluginManager.addPluginInclude(String),IPluginManager.removePluginInclude(String)
-
pluginAllInit
public void pluginAllInit()
Description copied from interface:IPluginManagerInit all plugins registered to this manager.- Specified by:
pluginAllInitin interfaceIPluginManager
-
pluginAllRestart
public void pluginAllRestart()
Description copied from interface:IPluginManagerRestart all plugins registered to this manager.- Specified by:
pluginAllRestartin interfaceIPluginManager
-
pluginAllStart
public void pluginAllStart()
Description copied from interface:IPluginManagerStart all plugins registered to this manager.- Specified by:
pluginAllStartin interfaceIPluginManager
-
pluginAllStop
public void pluginAllStop()
Description copied from interface:IPluginManagerStop all plugins registered to theis manager.- Specified by:
pluginAllStopin interfaceIPluginManager
-
pluginInit
public void pluginInit(IPlugin plugin)
Description copied from interface:IPluginManagerInitialize the plugin given in parameter. Most of the time, this function call the functionIPlugin.pluginInit(IPlugger plugger).- Specified by:
pluginInitin interfaceIPluginManager- Parameters:
plugin- the plugin to initialize.- See Also:
IPlugin
-
pluginRegister
public void pluginRegister(IPlugin plugin)
Description copied from interface:IPluginManagerRegister a plugin to the plugin manager.- Specified by:
pluginRegisterin interfaceIPluginManager- Parameters:
plugin- the plugin to register.
-
pluginRestart
public void pluginRestart(IPlugin plugin)
Description copied from interface:IPluginManagerRestart the plugin given in parameter. Most of the time, this function call the methodIPlugin.pluginStop()then the methodIPlugin.pluginStart().- Specified by:
pluginRestartin interfaceIPluginManager- Parameters:
plugin- the plugin to restart.- See Also:
IPlugin
-
pluginStart
public void pluginStart(IPlugin plugin)
Description copied from interface:IPluginManagerStart the plugin given in parameter. Most of the time, this function call the functionIPlugin.pluginStart().- Specified by:
pluginStartin interfaceIPluginManager- Parameters:
plugin- the plugin to start.- See Also:
IPlugin
-
pluginStop
public void pluginStop(IPlugin plugin)
Description copied from interface:IPluginManagerStop the plugin given in parameter. Most of the time, this function call the functionIPlugin.pluginStop().- Specified by:
pluginStopin interfaceIPluginManager- Parameters:
plugin- the plugin to stop.- See Also:
IPlugin
-
pluginUnregister
public void pluginUnregister(IPlugin plugin)
Description copied from interface:IPluginManagerUnregister the given plugin from the plugin manager- Specified by:
pluginUnregisterin interfaceIPluginManager- Parameters:
plugin- the plugin to unregister
-
removePluginExclude
public boolean removePluginExclude(java.lang.String pluginName)
Description copied from interface:IPluginManagerRemove a plugin name from the exclude list.- Specified by:
removePluginExcludein interfaceIPluginManager- Parameters:
pluginName- the name of the plugin to remove from exclusion.- Returns:
trueif the plugin has been successfully removed from the exclude list, false otherwise.- See Also:
IPluginManager.addPluginExclude(String),IPluginManager.addPluginInclude(String),IPluginManager.removePluginInclude(String)
-
removePluginInclude
public boolean removePluginInclude(java.lang.String pluginName)
Description copied from interface:IPluginManagerRemove a plugin name from the include list.- Specified by:
removePluginIncludein interfaceIPluginManager- Parameters:
pluginName- the name of the plugin to remove from inclusion.- Returns:
trueif the plugin has been successfully removed from the include list, false otherwise.- See Also:
IPluginManager.addPluginExclude(String),IPluginManager.removePluginExclude(String),IPluginManager.addPluginInclude(String)
-
addPluginManagerListener
public boolean addPluginManagerListener(PluginManagerListener listener)
Description copied from interface:IPluginManagerAdd a plugin manager listener to the plugin manager. This method returntrueis the listener has been successfully registered to the plugin andfalseotherwise.- Specified by:
addPluginManagerListenerin interfaceIPluginManager- Parameters:
listener- the listener to register to the plugin manager- Returns:
trueis the listener has been successfully registered to the plugin andfalseotherwise.- See Also:
PluginManagerListener
-
removePluginManagerListener
public boolean removePluginManagerListener(PluginManagerListener listener)
Description copied from interface:IPluginManagerRemove a plugin manager listener from the plugin manager. This method returntrueis the listener has been successfully removed from the plugin andfalseotherwise.- Specified by:
removePluginManagerListenerin interfaceIPluginManager- Parameters:
listener- the listener to remove from the plugin manager- Returns:
trueis the listener has been successfully removed from the plugin andfalseotherwise.- See Also:
PluginManagerListener
-
-