net.sf.groovydice.plugin
Class PluginManager

java.lang.Object
  extended by net.sf.groovydice.plugin.PluginManager
All Implemented Interfaces:
groovy.lang.GroovyObject

public class PluginManager
extends Object
implements groovy.lang.GroovyObject

This class is responsible to manage the registered plugin instances.

Since:
1.3
Version:
1
Author:
Daniel F. Martins

Constructor Summary
PluginManager()
           
 
Method Summary
 groovy.lang.MetaClass getMetaClass()
           
 List getPluginStack()
           
 Object getProperty(String name)
           
 Object invokeMethod(String name, Object args)
           
 void onInitialize(Object config)
          Triggers the initialization of all registered plugins.
 void register(Object plugins)
          Register the given plugin instances.
 void setMetaClass(groovy.lang.MetaClass metaClass)
           
 void setProperty(String name, Object value)
           
 void unregister(Object plugins)
          Unregister plugins.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginManager

public PluginManager()
Method Detail

getPluginStack

public final List getPluginStack()

register

public void register(Object plugins)
Register the given plugin instances. A plugin is always added to the top of the plugin stack to allow newly registered plugins to bypass operations defined by previously registered plugins.

Parameters:
plugins - Plugin instances to register.

unregister

public void unregister(Object plugins)
Unregister plugins.

Parameters:
plugins - If this parameter is null, then all registered plugins are removed. If this parameter is a Class, then all plug-ins that shares an is-a relationship with that class are removed. Otherwise, the plug-in instance represented by this parameter is removed from the stack.

onInitialize

public void onInitialize(Object config)
Triggers the initialization of all registered plugins.

Parameters:
config - Configuration context.
See Also:
GroovyDice.initialize()

getMetaClass

public groovy.lang.MetaClass getMetaClass()
Specified by:
getMetaClass in interface groovy.lang.GroovyObject

setMetaClass

public void setMetaClass(groovy.lang.MetaClass metaClass)
Specified by:
setMetaClass in interface groovy.lang.GroovyObject

invokeMethod

public Object invokeMethod(String name,
                           Object args)
Specified by:
invokeMethod in interface groovy.lang.GroovyObject

getProperty

public Object getProperty(String name)
Specified by:
getProperty in interface groovy.lang.GroovyObject

setProperty

public void setProperty(String name,
                        Object value)
Specified by:
setProperty in interface groovy.lang.GroovyObject


Copyright © 2008-2010 Daniel F. Martins. All Rights Reserved.