edu.uci.isr.yancees.plugin
Interface MOPluginInterface

All Superinterfaces:
MOPluginListenerInterface, PluginInterface
All Known Subinterfaces:
MOSharedPluginInterface
All Known Implementing Classes:
AbstractMOPlugin, AbstractMOSharedPlugin, GenericPlugin, NotificationPlugin, SubscriptionPlugin

public interface MOPluginInterface
extends PluginInterface, MOPluginListenerInterface

This is the interface of the plug-ins of the core of the system. A plug-in is a listener of the events generated by other plug-ins.


Method Summary
 void addListener(MOPluginListenerInterface plugin)
          Makes this plug-in notify another provided plugin whenever it computers its output The output here is data (events) obtained as a result of a subscription
 void addRequiredPlugin(MOPluginInterface plugin)
          This method is used by the subscription parser to inform the plugin of all the IDs of the plug-ins that are supposed to notify this plugin when they are finished with their processing.
 void dispose()
          Releases all the listeners of this plug-in in order to make it eligible for garbage collection.
 java.lang.String getFullContext()
           
 java.lang.String getFullPath()
           
 MOPluginInterface[] getRequiredPluginsList()
           
 SubscriberInterface getSubscriber()
           
 SubscriptionInterface getSubscription()
           
 org.w3c.dom.Node getSubtree()
           
 boolean hasChildren()
          Determines whether this plug-in requires other plug-ins or not
 void removeListener(MOPluginListenerInterface plugin)
          Removes a plug-in registered as listener of this plug-in
 
Methods inherited from interface edu.uci.isr.yancees.plugin.PluginInterface
getId, getTag
 
Methods inherited from interface edu.uci.isr.yancees.plugin.MOPluginListenerInterface
receivePluginNotification, receivePluginNotification
 

Method Detail

getSubscriber

SubscriberInterface getSubscriber()
Returns:
a reference of the subscriber that triggered the creation of the plug-in

getSubscription

SubscriptionInterface getSubscription()
Returns:
a reference to the subscription this plug-in participates

getFullContext

java.lang.String getFullContext()
Returns:
a string separated by '/' that expresses the context, or sequence of tags from the root of a subscription DOM subtree to the subtree that this plug-in represents. For example, if this plug-in will handle the subtree headed by the tag in a subscription like: ... ... ... its full context will be 'subscription/rule' because followed-by is inside this path. The context is the path without the tag name. This information will be part of all events produced by this component. This information helps the subscription node to identify the events coming from this component, knowing that that specific branch of his was evaluated and the answer comes in that event.

getFullPath

java.lang.String getFullPath()
Returns:
a string separated by '/' that expresses the path, or sequence of tags from the root of a subscription DOM subtree to the subtree that this plug-in represents. For example, if this plug-in will handle the subtree headed by the tag in a subscription like: ... ... ... its full path will be 'subscription/rule/followed-by' This information will be part of all events produced by this component. This information helps the subscription node to identify the events coming from this component, knowing that that specific branch of his was evaluated and the answer comes in that event.

getSubtree

org.w3c.dom.Node getSubtree()
Returns:
the DOM subtree that is handled (and headed) by this plug-in

addListener

void addListener(MOPluginListenerInterface plugin)
Makes this plug-in notify another provided plugin whenever it computers its output The output here is data (events) obtained as a result of a subscription


removeListener

void removeListener(MOPluginListenerInterface plugin)
Removes a plug-in registered as listener of this plug-in


addRequiredPlugin

void addRequiredPlugin(MOPluginInterface plugin)
This method is used by the subscription parser to inform the plugin of all the IDs of the plug-ins that are supposed to notify this plugin when they are finished with their processing. This method is invoked in the BFS order in which the tags each plugin processes are parsed in the DOM tree. This information is necessary for plug-ins as the sequence detection in which the order of notifications may be important.


getRequiredPluginsList

MOPluginInterface[] getRequiredPluginsList()
Returns:
a list of PluginsInterface instances that this plug-in requires.

hasChildren

boolean hasChildren()
Determines whether this plug-in requires other plug-ins or not

Returns:
true if this plug-in requires other plug-ins or false if not

dispose

void dispose()
Releases all the listeners of this plug-in in order to make it eligible for garbage collection.