com.go.trove.util.plugin
Class PluginContext

java.lang.Object
  |
  +--com.go.trove.util.plugin.PluginContext

public class PluginContext
extends java.lang.Object

Plugin can reference other Plugins through the PluginContext. If a Plugin is not immediately available the Plugin can register itself as a listener with the PluginContext so as to be notified when new Plugins are added to the PluginContext. When Plugins are fully initialized and want to make themselves available to other Plugins they should add themselves to the PluginContext.

Version:
1 - 01/03/23
Author:
Scott Jappinen

Constructor Summary
PluginContext()
           
 
Method Summary
 void addPlugin(Plugin plugin)
          Adds a Plugin to the PluginContext.
 void addPluginListener(PluginListener listener)
          Adds a PluginListener to the PluginContext.
protected  void firePluginAddedEvent(PluginEvent event)
           
 Plugin getPlugin(java.lang.String name)
          Returns a Plugin by name.
 java.util.Map getPlugins()
          Returns a Map of all of the Plugins.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginContext

public PluginContext()
Method Detail

addPluginListener

public void addPluginListener(PluginListener listener)
Adds a PluginListener to the PluginContext. Plugins or anything else that want to listen to PluginEvents should add themselves to the PluginContext through this method.
Parameters:
listener - the PluginListener to be added.

addPlugin

public void addPlugin(Plugin plugin)
Adds a Plugin to the PluginContext. Plugins that want to make themselves available to other Plugins should add themselves to the PluginContext through this method. All PluginListeners will be notified of the new addition.
Parameters:
plugin - the Plugin to be added.

getPlugin

public Plugin getPlugin(java.lang.String name)
Returns a Plugin by name.
Parameters:
name - the name of the Plugin.
Returns:
Plugin the Plugin object.

getPlugins

public java.util.Map getPlugins()
Returns a Map of all of the Plugins.
Returns:
Map the map of Plugins.

firePluginAddedEvent

protected void firePluginAddedEvent(PluginEvent event)