Daisy Open Source CMS

org.outerj.daisy.plugin
Interface PluginRegistry


public interface PluginRegistry

The place where plugins are registered.


Method Summary
<T> void
addPlugin(Class<T> pluginType, String name, T plugin)
          Adds (registers) a plugin.
<T> void
removePlugin(Class<T> pluginType, String name, T plugin)
          Removes (unregisters) a plugin.
<T> void
setPluginUser(Class<T> pluginType, PluginUser<T> pluginUser)
          Sets the user for a specific type of plugins.
<T> void
unsetPluginUser(Class<T> pluginType, PluginUser<T> pluginUser)
           
 

Method Detail

addPlugin

<T> void addPlugin(Class<T> pluginType,
                   String name,
                   T plugin)
Adds (registers) a plugin.

Parameters:
pluginType - type of the plugin (usually an interface)
name - a unique name (within a certain plugin type) for this plugin
plugin - the actual plugin implementation

removePlugin

<T> void removePlugin(Class<T> pluginType,
                      String name,
                      T plugin)
Removes (unregisters) a plugin.

Plugins should only be removed by the components which register them.


setPluginUser

<T> void setPluginUser(Class<T> pluginType,
                       PluginUser<T> pluginUser)
Sets the user for a specific type of plugins.

There can be at most one user for each type of plugin.

Upon setting the plugin user, any plugins already available of that type are passed to the plugin user using PluginUser.pluginAdded(org.outerj.daisy.plugin.PluginHandle).

Parameters:
pluginType -
pluginUser -

unsetPluginUser

<T> void unsetPluginUser(Class<T> pluginType,
                         PluginUser<T> pluginUser)

Daisy Open Source CMS