|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.jaspira.plugin.PluginMgr
public final class PluginMgr
The PluginMgr is the central instance for managing classes and instances of plugins. It has methods for loading plugin-classr files, creating new instances of a given plugin and retrieving instances of already created plugins.
| Nested Class Summary | |
|---|---|
protected class |
PluginMgr.PluginEntry
A PluginEntry contains various information about a particular plugin type. |
| Field Summary | |
|---|---|
static int |
PLUGIN_CLASS_LOADED
Plugin entry status: The class file has been loaded, but there a no instances. |
static int |
PLUGIN_HAS_INSTANCES
Plugin entry status: The plugin has instances. |
static int |
PLUGIN_LOAD_FAILED
Plugin entry status: An exception occurred during loading of class or instantiation. |
static int |
PLUGIN_NOT_LOADED
Plugin entry status: The class file has not yet been loaded. |
| Method Summary | |
|---|---|
Plugin |
createCopy(Plugin source)
Creates a duplicate of the supplied plugin via its state object. |
Plugin |
createInstance(java.lang.Class cls,
Plugin parent)
Create a new instance of the given class. |
Plugin |
createInstance(PluginProfile profile,
java.lang.ClassLoader pluginClassLoader,
Plugin parent)
Creates a new instance of the given plugin. |
Plugin |
createInstance(PluginState state,
Plugin parent)
Creates a new instance via a supplied state object. |
Plugin |
createInstance(java.lang.String classname,
Plugin parent)
Creates a new instance of the given plugin. |
VisiblePlugin |
createVisibleInstance(java.lang.Class cls,
Plugin parent)
Create a new instance of the given class. |
VisiblePlugin |
createVisibleInstance(PluginState state,
Plugin parent)
Creates a new instance via a supplied state object. |
VisiblePlugin |
createVisibleInstance(java.lang.String classname,
Plugin parent)
Creates a new instance of the given plugin. |
static PluginMgr |
getInstance()
Returns the singleton instance of the plugin manager. |
Plugin |
getPlugin(java.lang.String uniqueId)
Returns the (already existing instance) of a plugin with the given unique ID or null if there is no such instance. |
Plugin |
getPluginInstance(java.lang.String classname)
Gets the instance of a given plugin (identified by its class name). |
java.util.List |
getPluginInstances()
Returns a list of all loaded plugins. |
java.util.Iterator |
getPluginInstances(java.lang.String classname)
Gets all currently available instances of a given plugin (identified by its class name). |
void |
loadCustomPlugins(java.lang.String settingName)
This method loads custom plugins that may be specified in a property file. |
void |
loadPluginsFromResource()
This method loads custom plugins from the 'plugin' directory. |
void |
registerPlugin(Plugin plugin)
Registers an externally created Plugin with the manager. |
boolean |
removeInstance(Plugin plugin)
Removes a plugin from its container, uninstalls it and deletes it. |
boolean |
removeInstance(java.lang.String uniqueId)
Removes the instance of a plugin with the given uniqueID. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int PLUGIN_NOT_LOADED
public static final int PLUGIN_CLASS_LOADED
public static final int PLUGIN_HAS_INSTANCES
public static final int PLUGIN_LOAD_FAILED
| Method Detail |
|---|
public static PluginMgr getInstance()
public Plugin getPlugin(java.lang.String uniqueId)
public Plugin createInstance(java.lang.String classname,
Plugin parent)
classname - Plugin classparent - Parent for the new plugin in the plugin tree
public Plugin createInstance(PluginProfile profile,
java.lang.ClassLoader pluginClassLoader,
Plugin parent)
profile - Plugin profilepluginClassLoader - Separate class loader for the plugin or nullparent - Parent for the new plugin in the plugin tree
public Plugin createInstance(java.lang.Class cls,
Plugin parent)
cls - Plugin classparent - Parent for the new plugin in the plugin tree
public Plugin createInstance(PluginState state,
Plugin parent)
state - Plugin state for the new pluginparent - Parent for the new plugin in the plugin tree
public VisiblePlugin createVisibleInstance(java.lang.String classname,
Plugin parent)
classname - Plugin classparent - Parent for the new plugin in the plugin tree
public VisiblePlugin createVisibleInstance(java.lang.Class cls,
Plugin parent)
cls - Plugin classparent - Parent for the new plugin in the plugin tree
public VisiblePlugin createVisibleInstance(PluginState state,
Plugin parent)
state - Plugin state for the new pluginparent - Parent for the new plugin in the plugin tree
public Plugin createCopy(Plugin source)
source - Plugin to copy
public void registerPlugin(Plugin plugin)
plugin - Plugin to registerpublic boolean removeInstance(java.lang.String uniqueId)
uniqueId - Id of the plugin to remove
public boolean removeInstance(Plugin plugin)
plugin - Plugin to remove
public java.util.Iterator getPluginInstances(java.lang.String classname)
classname - Plugin class
Plugin objectspublic Plugin getPluginInstance(java.lang.String classname)
classname - Plugin class
public java.util.List getPluginInstances()
Plugin objectspublic void loadCustomPlugins(java.lang.String settingName)
settingName - Name of the property file entry (e. g.public void loadPluginsFromResource()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||