edu.uci.isr.yancees.server
Class SubscriptionFacade.SubscriberMediator

java.lang.Object
  extended byedu.uci.isr.yancees.server.SubscriptionFacade.SubscriberMediator
All Implemented Interfaces:
PluginListenerInterface
Enclosing class:
SubscriptionFacade

public class SubscriptionFacade.SubscriberMediator
extends java.lang.Object
implements PluginListenerInterface

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. 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.SubscriberMediator(SubscriberInterface s, PluginInterface pi, long msgID)
          Constructor
 
Method Summary
protected  void finalize()
          This class is invoked by the Garbage Collector...
 long getMessageId()
           
 PluginInterface getPluginTree()
           
 void receivePluginNotification(EventInterface[] evtList, PluginInterface source)
          Receives a list of events as notifications from root plug-in's
 void receivePluginNotification(EventInterface evt, PluginInterface source)
          Receives a notification from root plug-in's
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubscriptionFacade.SubscriberMediator

public SubscriptionFacade.SubscriberMediator(SubscriberInterface s,
                                             PluginInterface 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.
Method Detail

getMessageId

public long getMessageId()

getPluginTree

public PluginInterface getPluginTree()

receivePluginNotification

public void receivePluginNotification(EventInterface evt,
                                      PluginInterface source)
Receives a notification from root plug-in's

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

receivePluginNotification

public void receivePluginNotification(EventInterface[] evtList,
                                      PluginInterface source)
Receives a list of events as notifications from root plug-in's

Specified by:
receivePluginNotification in interface PluginListenerInterface
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.

Throws:
java.lang.Throwable