edu.uci.isr.yancees
Class SubscriptionFacade.SubscriptionMediator

java.lang.Object
  extended by edu.uci.isr.yancees.SubscriptionFacade.SubscriptionMediator
All Implemented Interfaces:
MOPluginListenerInterface
Enclosing class:
SubscriptionFacade

public class SubscriptionFacade.SubscriptionMediator
extends java.lang.Object
implements MOPluginListenerInterface

The subscriber mediator receives notifications from the plug-ins and forward them to their specific subscribers. We need a mediator here to make a mapping between the plug-in subscription tree and the subscriber interface. It is also used to handle the input and output filters. The management of active subscriptions is also performed here, so mediators represente active subscriptions. When a mediator is destroyed it triggers the garbage collection process of the whole subscription tree of plug-ins


Constructor Summary
SubscriptionFacade.SubscriptionMediator(SubscriberInterface s, MOPluginInterface pi, long msgID)
          Constructor
 
Method Summary
protected  void finalize()
          This class is invoked by the Garbage Collector...
 long getMessageId()
           
 MOPluginInterface getPluginTree()
           
 void receivePluginNotification(EventInterface[] evtList, MOPluginInterface source)
          Receives a list of events as notifications from root plug-in's and send them to the ouptut filters if they are present
 void receivePluginNotification(EventInterface evt, MOPluginInterface source)
          Receives a notification from root plug-in's, and sends it to the output filters
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubscriptionFacade.SubscriptionMediator

public SubscriptionFacade.SubscriptionMediator(SubscriberInterface s,
                                               MOPluginInterface pi,
                                               long msgID)
Constructor

Parameters:
s - is the subscriber interface to be notified when the plug-in evaluation tree is completed.
pi - is the plug-in that is the head of the parsed message. It will send a notification when the subscription is fully evaluated.
mesgId - is the id of the message (the subscription DOM), which after parsed, generated the plug-ins I am subscribing to.
Method Detail

getMessageId

public long getMessageId()

getPluginTree

public MOPluginInterface getPluginTree()

receivePluginNotification

public void receivePluginNotification(EventInterface evt,
                                      MOPluginInterface source)
Receives a notification from root plug-in's, and sends it to the output filters

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

receivePluginNotification

public void receivePluginNotification(EventInterface[] evtList,
                                      MOPluginInterface source)
Receives a list of events as notifications from root plug-in's and send them to the ouptut filters if they are present

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

finalize

protected void finalize()
                 throws java.lang.Throwable
This class is invoked by the Garbage Collector... May be used to release any resource allocated to this record.

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable