edu.uci.isr.yancees.plugin
Interface PluginInterface

All Superinterfaces:
PluginListenerInterface
All Known Subinterfaces:
ProtocolPluginInterface, SharedPluginInterface
All Known Implementing Classes:
AbstractPlugin, AbstractProtocolPlugin

public interface PluginInterface
extends PluginListenerInterface

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(PluginListenerInterface 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(PluginInterface 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 listenres of this plug-in in order to make it eligible for garbage collection.
 java.lang.String getFullContext()
           
 java.lang.String getFullPath()
           
 long getId()
           
 PluginInterface[] getRequiredPluginsList()
           
 org.w3c.dom.Node getSubtree()
           
 java.lang.String getTag()
           
 boolean hasChildren()
          Determines whether this plug-in requires other plug-ins or not
 void removeListener(PluginListenerInterface plugin)
          Removes a plug-in registered as listener of this plug-in
 
Methods inherited from interface edu.uci.isr.yancees.plugin.PluginListenerInterface
receivePluginNotification, receivePluginNotification
 

Method Detail

getId

public long getId()
Returns:
the unique Id of this plugin

getTag

public java.lang.String getTag()
Returns:
the tag name that this plugin is representing. It corresponds to the type of this plugin instance. For example, if this is a plug-in that handles a subtree headed by the tag, its type will be "followed-by"

getFullContext

public 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 subscripton 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

public 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 subscripton 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

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

addListener

public void addListener(PluginListenerInterface 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

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


addRequiredPlugin

public void addRequiredPlugin(PluginInterface 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

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

hasChildren

public 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

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