edu.uci.isr.yancees.plugin
Class PluginManager

java.lang.Object
  extended byedu.uci.isr.yancees.plugin.PluginManager
All Implemented Interfaces:
PluginManagerInterface

public class PluginManager
extends java.lang.Object
implements PluginManagerInterface

Manages the plug-in instances used by the parsers (managers)


Constructor Summary
PluginManager()
          this is the constructor.
 
Method Summary
 void addFactory(PluginFactoryInterface factory)
          Registers a new factory in the plug-in manager to process the set of tags provided
 void addGenericFactory(PluginFactoryInterface factory)
          Registers the generic factory that handles unknown tags in the subscription process
 PluginInterface createPluginInstance(java.lang.String tag, org.w3c.dom.Node subTree)
           
 PluginFactoryInterface[] getFactoriesList()
          Gets the list of all factories registered in the PluginManager
 java.lang.String[] getRegisteredTags()
           
 void removeFactory(PluginFactoryInterface factory)
          Registers a new factory in the plug-in manager
 void setDispatcher(EventDispatcherInterface disp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginManager

public PluginManager()
this is the constructor. There can be many instances of the plug-in manager. This allows the subscription manager have a different plug-in manager than the notificatoin manager, hence, avoiding naming clashes.

Method Detail

setDispatcher

public void setDispatcher(EventDispatcherInterface disp)

addFactory

public void addFactory(PluginFactoryInterface factory)
Registers a new factory in the plug-in manager to process the set of tags provided

Specified by:
addFactory in interface PluginManagerInterface
Parameters:
factory - the factory instance

addGenericFactory

public void addGenericFactory(PluginFactoryInterface factory)
Registers the generic factory that handles unknown tags in the subscription process

Specified by:
addGenericFactory in interface PluginManagerInterface
Parameters:
factory - the factory instance

removeFactory

public void removeFactory(PluginFactoryInterface factory)
Registers a new factory in the plug-in manager

Specified by:
removeFactory in interface PluginManagerInterface

getFactoriesList

public PluginFactoryInterface[] getFactoriesList()
Gets the list of all factories registered in the PluginManager

Specified by:
getFactoriesList in interface PluginManagerInterface

getRegisteredTags

public java.lang.String[] getRegisteredTags()
Specified by:
getRegisteredTags in interface PluginManagerInterface
Returns:
a list of all the supported tags in this plugin manager. In other words, returs the list of tags registered for all plugins installed.

createPluginInstance

public PluginInterface createPluginInstance(java.lang.String tag,
                                            org.w3c.dom.Node subTree)
                                     throws PluginManagerException
Specified by:
createPluginInstance in interface PluginManagerInterface
Returns:
a new instance of a plugin to handle the provided tag
Throws:
an - exception in case the creation is not successfull.
PluginManagerException