org.openbp.jaspira.plugin
Class PluginMgr.PluginEntry

java.lang.Object
  extended by org.openbp.jaspira.plugin.PluginMgr.PluginEntry
Enclosing class:
PluginMgr

protected class PluginMgr.PluginEntry
extends java.lang.Object

A PluginEntry contains various information about a particular plugin type.


Field Summary
protected  java.util.Map instances
          Table containing the existing instances of this plugin as unique id (String) - Plugin pair.
protected  java.lang.Class pluginClass
          Class of this plugin.
protected  int status
          Status of this plugin
 
Constructor Summary
PluginMgr.PluginEntry(PluginProfile profile)
          Creates a new plugin entry for a plugin based on the given profile.
PluginMgr.PluginEntry(java.lang.String pluginClassName)
          Creates a new plugin entry for a plugin with the given name.
 
Method Summary
 void addInstance(Plugin plugin, Plugin parent)
          Adds an existing instance of a plugin.
 Plugin createInstance(Plugin parent)
          Creates a new instance of the plugin.
 Plugin createInstance(PluginState state, Plugin parent)
          Creates a new instance of a plugin with the given state data.
 java.lang.ClassLoader getPluginClassLoader()
          Gets the separate class loader for the plugin or null.
 java.lang.String getPluginClassName()
          Gets the class name.
 Plugin getPluginInstance(java.lang.String uniqueId)
          Returns the instance of the plugin with the given unique id or null if none such present.
 java.util.Iterator getPluginInstances()
          Returns an iterator over all instances of this plugin.
 boolean removeInstance(Plugin plugin)
          Removes the given plugin from the user interface structure as well as from the plugin manager itself.
 void setPluginClassLoader(java.lang.ClassLoader pluginClassLoader)
          Sets the separate class loader for the plugin or null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pluginClass

protected transient java.lang.Class pluginClass
Class of this plugin. Can be null if the class is not yet loaded.


instances

protected java.util.Map instances
Table containing the existing instances of this plugin as unique id (String) - Plugin pair.


status

protected int status
Status of this plugin

Constructor Detail

PluginMgr.PluginEntry

public PluginMgr.PluginEntry(java.lang.String pluginClassName)
Creates a new plugin entry for a plugin with the given name.

Parameters:
pluginClassName - Plugin class name

PluginMgr.PluginEntry

public PluginMgr.PluginEntry(PluginProfile profile)
Creates a new plugin entry for a plugin based on the given profile.

Parameters:
profile - Plugin profile
Method Detail

getPluginClassName

public java.lang.String getPluginClassName()
Gets the class name.


getPluginClassLoader

public java.lang.ClassLoader getPluginClassLoader()
Gets the separate class loader for the plugin or null.


setPluginClassLoader

public void setPluginClassLoader(java.lang.ClassLoader pluginClassLoader)
Sets the separate class loader for the plugin or null.


getPluginInstance

public Plugin getPluginInstance(java.lang.String uniqueId)
Returns the instance of the plugin with the given unique id or null if none such present.


getPluginInstances

public java.util.Iterator getPluginInstances()
Returns an iterator over all instances of this plugin.


createInstance

public Plugin createInstance(PluginState state,
                             Plugin parent)
Creates a new instance of a plugin with the given state data.

Parameters:
state - Plugin state for the new plugin
parent - Parent for the new plugin in the plugin tree
Returns:
The new plugin or null if it could not be instantiated

createInstance

public Plugin createInstance(Plugin parent)
Creates a new instance of the plugin.

Parameters:
parent - Parent for the new plugin in the plugin tree
Returns:
The new plugin or null if it could not be instantiated

addInstance

public void addInstance(Plugin plugin,
                        Plugin parent)
Adds an existing instance of a plugin.

Parameters:
plugin - Plugin to add

removeInstance

public boolean removeInstance(Plugin plugin)
Removes the given plugin from the user interface structure as well as from the plugin manager itself. Causes the Plugin to uninstall itself before closing.

Parameters:
plugin - Plugin to remove
Returns:
true There are no instances of this plugin left.
false There is at least one instance alive.


Copyright © 2011. All Rights Reserved.