edu.uci.isr.yancees.plugin
Class AbstractProtocolPlugin

java.lang.Object
  extended byedu.uci.isr.yancees.plugin.AbstractPlugin
      extended byedu.uci.isr.yancees.plugin.AbstractProtocolPlugin
All Implemented Interfaces:
PluginInterface, PluginListenerInterface, ProtocolPluginInterface
Direct Known Subclasses:
MobilityProtocolPlugin, PollProtocolPlugin

public abstract class AbstractProtocolPlugin
extends AbstractPlugin
implements ProtocolPluginInterface

This abstract class defines the basic functionality of the plug-in as well as its main attributes. A protocol plug-in handles all the messages of a session. It is created and terminated by special messages, as opposed to the subscription plug-ins which only perform queries and provide events when the query is matched. A protocol plug-in on the onther hand, can perform many functionalities and can have access to many sub-components and plug-in instances of the system.


Field Summary
 
Fields inherited from class edu.uci.isr.yancees.plugin.AbstractPlugin
myListeners, myRequiredPlugins
 
Constructor Summary
AbstractProtocolPlugin(org.w3c.dom.Node subTree)
           
 
Method Summary
abstract  void receivePluginNotification(EventInterface[] evtList, PluginInterface source)
          Receives a list of events as notifications from another plug-in this plug-in depends on.
abstract  void receivePluginNotification(EventInterface evt, PluginInterface source)
          Receives a notification from another plug-in this plug-in depends on
abstract  void receiveProtocolMessage(MessageInterface msg, SubscriberInterface si)
          Receive messages from this protocol
abstract  void terminateSession()
          Gracefully terminates the current plugin as a result of the end of the communicatoin session.
 
Methods inherited from class edu.uci.isr.yancees.plugin.AbstractPlugin
addListener, addRequiredPlugin, dispose, finalize, getExpectedPluginIDs, getFullContext, getFullPath, getId, getRequiredPluginsList, getSubtree, getTag, hasChildren, publishOutput, publishOutput, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.uci.isr.yancees.plugin.PluginInterface
addListener, addRequiredPlugin, dispose, getFullContext, getFullPath, getId, getRequiredPluginsList, getSubtree, getTag, hasChildren, removeListener
 

Constructor Detail

AbstractProtocolPlugin

public AbstractProtocolPlugin(org.w3c.dom.Node subTree)
Parameters:
subTree - is the DOM tree this plugin is responsible for executing
Method Detail

receivePluginNotification

public abstract void receivePluginNotification(EventInterface evt,
                                               PluginInterface source)
Receives a notification from another plug-in this plug-in depends on

Specified by:
receivePluginNotification in interface PluginListenerInterface
Specified by:
receivePluginNotification in class AbstractPlugin
Parameters:
evt - is the event received
source - is the plug-in sending the notification.

receivePluginNotification

public abstract void receivePluginNotification(EventInterface[] evtList,
                                               PluginInterface source)
Receives a list of events as notifications from another plug-in this plug-in depends on.

Specified by:
receivePluginNotification in interface PluginListenerInterface
Specified by:
receivePluginNotification in class AbstractPlugin
Parameters:
evtList - is the list of events received
source - is the plug-in sending the notification.

terminateSession

public abstract void terminateSession()
Gracefully terminates the current plugin as a result of the end of the communicatoin session.

Specified by:
terminateSession in interface ProtocolPluginInterface

receiveProtocolMessage

public abstract void receiveProtocolMessage(MessageInterface msg,
                                            SubscriberInterface si)
                                     throws ProtocolPluginException
Receive messages from this protocol

Specified by:
receiveProtocolMessage in interface ProtocolPluginInterface
Parameters:
msg - is a message according to the protocol that the plug-in implements.
Throws:
ProtocolPluginException