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

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

public class ResourceNotifierStub
extends java.lang.Object
implements ResourceNotifier

This is a stub that demonstrates the components of a ResourceNotifier in action.

Version:
1.0
Author:
Ed Archibald

Constructor Summary
ResourceNotifierStub()
           
 
Method Summary
 void addListener(ResourceNotificationListener listener)
           
 java.util.Map<java.lang.String,NotificationGroupMember> getNotificationGroupMembers()
           
static void main(java.lang.String[] argv)
           
 void notifyListeners(ClusterResourceNotification notification)
           
 void prepare()
           
 void run()
          Simulates the reception of a notification every 20 seconds.
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceNotifierStub

public ResourceNotifierStub()
Method Detail

main

public static void main(java.lang.String[] argv)
Parameters:
argv -

addListener

public void addListener(ResourceNotificationListener listener)
Specified by:
addListener in interface ResourceNotifier
Parameters:
listener -

notifyListeners

public void notifyListeners(ClusterResourceNotification notification)
                     throws ResourceNotificationException
Specified by:
notifyListeners in interface ResourceNotifier
Parameters:
notification -
Throws:
ResourceNotificationException

run

public void run()
Simulates the reception of a notification every 20 seconds.

Specified by:
run in interface java.lang.Runnable

shutdown

public void shutdown()

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