edu.uci.isr.yancees.core
Class ActivePluginInstancesRegistry

java.lang.Object
  extended by edu.uci.isr.yancees.core.ActivePluginInstancesRegistry

public class ActivePluginInstancesRegistry
extends java.lang.Object

This class represents a global record of parsed subscription and notification trees. it is used by the protocol plug-ins as a blackboard, to collect infromation about these trees and perform necessary interaction with active plug-ins. This is kept updated by the SubscriberAPI.


Method Summary
 MOPluginInterface[] getActivePlugins(SubscriberInterface si, java.lang.String tag)
           
 MOPluginInterface[] getActiveTrees(SubscriberInterface si)
           
 MOPluginInterface[] getActiveTrees(SubscriberInterface si, java.lang.String tag)
           
static ActivePluginInstancesRegistry getInstance()
           
 void registerPluginTree(MOPluginInterface pi, SubscriberInterface si)
          Associates the plug-in tree headed by pi under si
 void unregisterPluginTree(MOPluginInterface pi, SubscriberInterface si)
          removes the reference to pi from the record of si
 void uregisterSubscriber(SubscriberInterface si)
          Removes all the records for a provides subscriber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ActivePluginInstancesRegistry getInstance()

registerPluginTree

public void registerPluginTree(MOPluginInterface pi,
                               SubscriberInterface si)
Associates the plug-in tree headed by pi under si

Parameters:
pi - is the HEAD plugin interface of the parsed tree
si - is the subscriber that originated the creation of the plug-in evaluation tree headed by pi

unregisterPluginTree

public void unregisterPluginTree(MOPluginInterface pi,
                                 SubscriberInterface si)
removes the reference to pi from the record of si

Parameters:
pi - is the HEAD of the plug-in evaluation tree to be removed from the si record.
si - is the record to be updated.

uregisterSubscriber

public void uregisterSubscriber(SubscriberInterface si)
Removes all the records for a provides subscriber

Parameters:
si - is the record locator for a subscriber, which is its subscriber interface

getActiveTrees

public MOPluginInterface[] getActiveTrees(SubscriberInterface si)
Parameters:
si - is the subscriber interface which active plug-ins are returned
Returns:
a list of PluginInterface instances for the proviced subscriber or an empty list if not found.

getActiveTrees

public MOPluginInterface[] getActiveTrees(SubscriberInterface si,
                                          java.lang.String tag)
Parameters:
si - is the subscriber interface that originated the creation of this tree
tag - is the XML tag which the HEAD plug-in was creted to evaluate.
Returns:
a list of head plug-ins or an empty list if not found.

getActivePlugins

public MOPluginInterface[] getActivePlugins(SubscriberInterface si,
                                            java.lang.String tag)
Parameters:
si - is the subscriber interface that originated the creation of this plug-in in a given tree. All the active trees for this subscriber are searched and the plug-ins matching the tag are returned.
tag - is the XML tag of the plug-in to look for
Returns:
a list of plug-ins or an empty list if not found.