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

java.lang.Object
  extended by com.continuent.tungsten.common.patterns.notification.adaptor.GroupCommunicationsNotifier
All Implemented Interfaces:
ResourceNotifier, java.lang.Runnable, org.continuent.hedera.adapters.MessageListener, org.continuent.hedera.gms.GroupMembershipListener

public class GroupCommunicationsNotifier
extends java.lang.Object
implements ResourceNotifier, org.continuent.hedera.adapters.MessageListener, org.continuent.hedera.gms.GroupMembershipListener

This class defines a GroupCommunicationsNotifier

Version:
1.0
Author:
Robert Hodges

Constructor Summary
GroupCommunicationsNotifier()
          Creates a new instance.
 
Method Summary
 void addListener(ResourceNotificationListener listener)
           
 void failedMember(org.continuent.hedera.common.Member arg0, org.continuent.hedera.common.GroupIdentifier arg1, org.continuent.hedera.common.Member arg2)
           
 int getJoinDelay()
           
 java.lang.String getLastState()
          Returns the lastState value.
 java.util.Map<java.lang.String,NotificationGroupMember> getNotificationGroupMembers()
           
 void groupComposition(org.continuent.hedera.common.Group arg0, org.continuent.hedera.common.IpAddress arg1, int arg2)
           
 void joinMember(org.continuent.hedera.common.Member arg0, org.continuent.hedera.common.GroupIdentifier arg1)
           
 void mergedMembers(org.continuent.hedera.common.GroupIdentifier arg0, org.continuent.hedera.common.Member arg1, java.util.List<org.continuent.hedera.common.Member> arg2, java.util.List<org.continuent.hedera.common.Member> arg3, java.util.List<org.continuent.hedera.common.Member> arg4)
           
 void networkPartition(org.continuent.hedera.common.GroupIdentifier arg0, java.util.List arg1)
           
 void notifyListeners(ClusterResourceNotification notification)
          
 void prepare()
          Connects the notifier to group communications using generic Hedera interfaces.
 void quitMember(org.continuent.hedera.common.Member arg0, org.continuent.hedera.common.GroupIdentifier arg1)
           
 void receive(java.io.Serializable message)
          Receives a message from group communications.
 void release()
          Releases group communication channel
 void run()
           
 void setChannelName(java.lang.String channelName)
           
 void setJoinDelay(int joinDelay)
           
 void setLastState(java.lang.String lastState)
          Sets the lastState value.
 void setProperties(java.lang.String properties)
           
 void suspectMember(org.continuent.hedera.common.Member arg0, org.continuent.hedera.common.GroupIdentifier arg1, org.continuent.hedera.common.Member arg2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupCommunicationsNotifier

public GroupCommunicationsNotifier()
Creates a new instance.

Method Detail

setProperties

public void setProperties(java.lang.String properties)

setChannelName

public void setChannelName(java.lang.String channelName)

prepare

public void prepare()
             throws java.lang.Exception
Connects the notifier to group communications using generic Hedera interfaces.

Specified by:
prepare in interface ResourceNotifier
Throws:
java.lang.Exception
See Also:
ResourceNotifier.prepare()

notifyListeners

public void notifyListeners(ClusterResourceNotification notification)
                     throws ResourceNotificationException

Specified by:
notifyListeners in interface ResourceNotifier
Throws:
ResourceNotificationException
See Also:
ResourceNotifier.notifyListeners(com.continuent.tungsten.common.cluster.resource.notification.ClusterResourceNotification)

release

public void release()
Releases group communication channel


receive

public void receive(java.io.Serializable message)
Receives a message from group communications. We only print such messages if we are in debug mode.

Specified by:
receive in interface org.continuent.hedera.adapters.MessageListener
See Also:
MessageListener.receive(java.io.Serializable)

getJoinDelay

public int getJoinDelay()

setJoinDelay

public void setJoinDelay(int joinDelay)

failedMember

public void failedMember(org.continuent.hedera.common.Member arg0,
                         org.continuent.hedera.common.GroupIdentifier arg1,
                         org.continuent.hedera.common.Member arg2)
Specified by:
failedMember in interface org.continuent.hedera.gms.GroupMembershipListener

groupComposition

public void groupComposition(org.continuent.hedera.common.Group arg0,
                             org.continuent.hedera.common.IpAddress arg1,
                             int arg2)
Specified by:
groupComposition in interface org.continuent.hedera.gms.GroupMembershipListener

joinMember

public void joinMember(org.continuent.hedera.common.Member arg0,
                       org.continuent.hedera.common.GroupIdentifier arg1)
Specified by:
joinMember in interface org.continuent.hedera.gms.GroupMembershipListener

mergedMembers

public void mergedMembers(org.continuent.hedera.common.GroupIdentifier arg0,
                          org.continuent.hedera.common.Member arg1,
                          java.util.List<org.continuent.hedera.common.Member> arg2,
                          java.util.List<org.continuent.hedera.common.Member> arg3,
                          java.util.List<org.continuent.hedera.common.Member> arg4)
Specified by:
mergedMembers in interface org.continuent.hedera.gms.GroupMembershipListener

networkPartition

public void networkPartition(org.continuent.hedera.common.GroupIdentifier arg0,
                             java.util.List arg1)
Specified by:
networkPartition in interface org.continuent.hedera.gms.GroupMembershipListener

quitMember

public void quitMember(org.continuent.hedera.common.Member arg0,
                       org.continuent.hedera.common.GroupIdentifier arg1)
Specified by:
quitMember in interface org.continuent.hedera.gms.GroupMembershipListener

suspectMember

public void suspectMember(org.continuent.hedera.common.Member arg0,
                          org.continuent.hedera.common.GroupIdentifier arg1,
                          org.continuent.hedera.common.Member arg2)
Specified by:
suspectMember in interface org.continuent.hedera.gms.GroupMembershipListener

addListener

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

getNotificationGroupMembers

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

run

public void run()
Specified by:
run in interface java.lang.Runnable

getLastState

public java.lang.String getLastState()
Returns the lastState value.

Returns:
Returns the lastState.

setLastState

public void setLastState(java.lang.String lastState)
Sets the lastState value.

Parameters:
lastState - The lastState to set.