|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.ee.cms.impl.base.GroupHandleImpl
public final class GroupHandleImpl
Implementation of GroupHandle interface.
| Constructor Summary | |
|---|---|
GroupHandleImpl(String groupName,
String serverToken)
|
|
| Method Summary | |
|---|---|
void |
announceWatchdogObservedFailure(String serverToken)
|
List<String> |
getAllCurrentMembers()
returns a List containing the current group membership including spectator members. |
List<String> |
getAllCurrentMembersWithStartTimes()
|
AliveAndReadyView |
getCurrentAliveAndReadyCoreView()
|
List<String> |
getCurrentAliveOrReadyMembers()
|
List<String> |
getCurrentCoreMembers()
returns a List containing the current core members in the group. |
List<String> |
getCurrentCoreMembersWithStartTimes()
|
List<GMSMember> |
getCurrentView()
|
DistributedStateCache |
getDistributedStateCache()
returns a DistributedStateCache object that provides the ability to set and retrieve CachedStates. |
String |
getGroupLeader()
|
MemberStates |
getMemberState(String member)
|
MemberStates |
getMemberState(String member,
long threshold,
long timeout)
|
AliveAndReadyView |
getPreviousAliveAndReadyCoreView()
|
List<GMSMember> |
getPreviousView()
|
List<String> |
getSuspectList()
|
boolean |
isFenced(String componentName,
String memberToken)
Provides the status of a member component's fence, if any. |
boolean |
isGroupLeader()
|
boolean |
isMemberAlive(String memberToken)
|
boolean |
isWatchdog()
|
void |
lowerFence(String componentName,
String failedMemberToken)
Enables the caller to lower a logical fence that was earlier raised on a target member component. |
void |
raiseFence(String componentName,
String failedMemberToken)
Enables the caller to raise a logical fence on a specified target member token's component. |
void |
removeRecoveryAppointments(String failedMemberToken,
String componentName)
|
void |
sendMessage(List<String> targetServerTokens,
String targetComponentName,
byte[] message)
|
void |
sendMessage(String componentName,
byte[] message)
Sends a message to all members of the Group. |
void |
sendMessage(String targetServerToken,
String targetComponentName,
byte[] message)
Sends a message to a single member of the group Expects a targetServerToken representing the recipient member's id, the target component name in the target recipient member, and a byte array as parameter carrying the payload. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public GroupHandleImpl(String groupName,
String serverToken)
| Method Detail |
|---|
public void sendMessage(String componentName,
byte[] message)
throws GMSException
sendMessage in interface GroupHandlecomponentName - Destination component in remote members.message - Payload in byte array to be delivered to the destination.
GMSException
public void sendMessage(String targetServerToken,
String targetComponentName,
byte[] message)
throws GMSException
sendMessage in interface GroupHandletargetServerToken - destination member's identificationtargetComponentName - destination member's target componentmessage - Payload in byte array to be delivered to the destination.
GMSException
public void sendMessage(List<String> targetServerTokens,
String targetComponentName,
byte[] message)
throws GMSException
sendMessage in interface GroupHandleGMSExceptionpublic DistributedStateCache getDistributedStateCache()
getDistributedStateCache in interface GroupHandleDistributedStateCachepublic List<String> getCurrentCoreMembers()
getCurrentCoreMembers in interface GroupHandlepublic List<String> getAllCurrentMembers()
getAllCurrentMembers in interface GroupHandlepublic List<String> getCurrentCoreMembersWithStartTimes()
getCurrentCoreMembersWithStartTimes in interface GroupHandlepublic List<String> getAllCurrentMembersWithStartTimes()
getAllCurrentMembersWithStartTimes in interface GroupHandle
public void raiseFence(String componentName,
String failedMemberToken)
throws GMSException
Failure Fencing is a group-wide protocol that, on one hand, requires members to update a shared/distributed datastructure if any of their components need to perform operations on another members' corresponding component. On the other hand, the group-wide protocol requires members to observe "Netiquette" during their startup so as to check if any of their components are being operated upon by other group members. Typically this check is performed by the respective components themselves. See the isFenced() method below for this check. When the operation is completed by the remote member component, it removes the entry from the shared datastructure. See the lowerFence() method below.
Raising the fence, places an entry into a distributed datastructure that is accessed by other members during their startup
raiseFence in interface GroupHandlecomponentName - failedMemberToken -
GMSException
public void lowerFence(String componentName,
String failedMemberToken)
throws GMSException
lowerFence in interface GroupHandlecomponentName - target member componentfailedMemberToken -
GMSException
public void removeRecoveryAppointments(String failedMemberToken,
String componentName)
throws GMSException
removeRecoveryAppointments in interface GroupHandleGMSException
public boolean isFenced(String componentName,
String memberToken)
This check is mandatorily done at the time a member component is in the process of starting(note that at this point we assume that this member failed in its previous lifetime).
The boolean value returned would indicate if this member component is being recovered by any other member. The criteria for returning a boolean "true" is that this componentName-memberToken combo is present as a value for any key in the GMS DistributedStateCache. If a true is returned, for instance, this could mean that the client component should continue its startup without attempting to perform its own recovery operations.
The criteria for returning a boolean "false" is that the componentId-memberTokenId combo is not present in the list of values in the DistributedStateCache.If a boolean "false" is returned, this could mean that the client component can continue with its lifecycle startup per its normal startup policies.
isFenced in interface GroupHandlecomponentName - memberToken -
public boolean isMemberAlive(String memberToken)
isMemberAlive in interface GroupHandlepublic String getGroupLeader()
getGroupLeader in interface GroupHandlepublic boolean isGroupLeader()
isGroupLeader in interface GroupHandlepublic List<String> getSuspectList()
public String toString()
toString in class Objectpublic List<String> getCurrentAliveOrReadyMembers()
getCurrentAliveOrReadyMembers in interface GroupHandlepublic MemberStates getMemberState(String member)
getMemberState in interface GroupHandle
public MemberStates getMemberState(String member,
long threshold,
long timeout)
getMemberState in interface GroupHandlepublic boolean isWatchdog()
public void announceWatchdogObservedFailure(String serverToken)
throws GMSException
announceWatchdogObservedFailure in interface GroupHandleGMSExceptionpublic List<GMSMember> getCurrentView()
getCurrentView in interface GroupHandlepublic List<GMSMember> getPreviousView()
getPreviousView in interface GroupHandlepublic AliveAndReadyView getPreviousAliveAndReadyCoreView()
getPreviousAliveAndReadyCoreView in interface GroupHandlepublic AliveAndReadyView getCurrentAliveAndReadyCoreView()
getCurrentAliveAndReadyCoreView in interface GroupHandle
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||