com.continuent.tungsten.common.patterns.notification.adaptor
Class ManagerNotificationAdaptor

java.lang.Object
  extended by com.continuent.tungsten.common.patterns.notification.adaptor.ManagerNotificationAdaptor
All Implemented Interfaces:
ResourceNotifier, java.lang.Runnable

public class ManagerNotificationAdaptor
extends java.lang.Object
implements ResourceNotifier

This class represents a means to receive monitoring information about datasources that are pushed from a manager directly to the process that wants to receive the notifications. This class, in effect, can act as a relay between the manager and the host process.

Version:
1.0
Author:
Ed Archibald

Constructor Summary
ManagerNotificationAdaptor()
           
 
Method Summary
 void addListener(ResourceNotificationListener listener)
          Add a listener that will be informed in the event of a resource notification.
 void deliver(ClusterResourceNotification notification)
           
 java.util.Map<java.lang.String,NotificationGroupMember> getNotificationGroupMembers()
           
 void notifyListeners(ClusterResourceNotification notification)
          Deliver notification to listeners.
 void prepare()
           
 void run()
          Run start the listener thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagerNotificationAdaptor

public ManagerNotificationAdaptor()
Method Detail

addListener

public void addListener(ResourceNotificationListener listener)
Add a listener that will be informed in the event of a resource notification.

Specified by:
addListener in interface ResourceNotifier
Parameters:
listener -

notifyListeners

public void notifyListeners(ClusterResourceNotification notification)
                     throws ResourceNotificationException
Deliver notification to listeners.

Specified by:
notifyListeners in interface ResourceNotifier
Parameters:
notification -
Throws:
ResourceNotificationException

run

public void run()
Run start the listener thread. It turns out that Group communications don't really need a separate thread since the group comm adapters have their own threads. So we start group comm instead.

Specified by:
run in interface java.lang.Runnable

deliver

public void deliver(ClusterResourceNotification notification)
             throws ResourceNotificationException
Throws:
ResourceNotificationException

getNotificationGroupMembers

public java.util.Map<java.lang.String,NotificationGroupMember> getNotificationGroupMembers()
Specified by:
getNotificationGroupMembers in interface ResourceNotifier

prepare

public void prepare()
             throws java.lang.Exception
Specified by:
prepare in interface ResourceNotifier
Throws:
java.lang.Exception