public final class GroupHandleImpl extends Object implements com.sun.enterprise.ee.cms.core.GroupHandle
| Constructor and Description |
|---|
GroupHandleImpl(String groupName,
String serverToken) |
| Modifier and Type | Method and Description |
|---|---|
void |
announceWatchdogObservedFailure(String serverToken) |
List<String> |
getAllCurrentMembers()
returns a List containing the current group membership including
spectator members.
|
List<String> |
getAllCurrentMembersWithStartTimes() |
com.sun.enterprise.ee.cms.core.AliveAndReadyView |
getCurrentAliveAndReadyCoreView() |
List<String> |
getCurrentAliveOrReadyMembers() |
List<String> |
getCurrentCoreMembers()
returns a List containing the current core members
in the group.
|
List<String> |
getCurrentCoreMembersWithStartTimes() |
List<com.sun.enterprise.ee.cms.core.GMSMember> |
getCurrentView() |
com.sun.enterprise.ee.cms.core.DistributedStateCache |
getDistributedStateCache()
returns a DistributedStateCache object that provides the ability to
set and retrieve CachedStates.
|
String |
getGroupLeader() |
com.sun.enterprise.ee.cms.spi.MemberStates |
getMemberState(String member) |
com.sun.enterprise.ee.cms.spi.MemberStates |
getMemberState(String member,
long threshold,
long timeout) |
com.sun.enterprise.ee.cms.core.AliveAndReadyView |
getPreviousAliveAndReadyCoreView() |
List<com.sun.enterprise.ee.cms.core.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() |
public void sendMessage(String componentName, byte[] message) throws com.sun.enterprise.ee.cms.core.GMSException
sendMessage in interface com.sun.enterprise.ee.cms.core.GroupHandlecomponentName - Destination component in remote members.message - Payload in byte array to be delivered to the destination.com.sun.enterprise.ee.cms.core.GMSExceptionpublic void sendMessage(String targetServerToken, String targetComponentName, byte[] message) throws com.sun.enterprise.ee.cms.core.GMSException
sendMessage in interface com.sun.enterprise.ee.cms.core.GroupHandletargetServerToken - destination member's identificationtargetComponentName - destination member's target componentmessage - Payload in byte array to be delivered to the destination.com.sun.enterprise.ee.cms.core.GMSExceptionpublic void sendMessage(List<String> targetServerTokens, String targetComponentName, byte[] message) throws com.sun.enterprise.ee.cms.core.GMSException
sendMessage in interface com.sun.enterprise.ee.cms.core.GroupHandlecom.sun.enterprise.ee.cms.core.GMSExceptionpublic com.sun.enterprise.ee.cms.core.DistributedStateCache getDistributedStateCache()
getDistributedStateCache in interface com.sun.enterprise.ee.cms.core.GroupHandleDistributedStateCachepublic List<String> getCurrentCoreMembers()
getCurrentCoreMembers in interface com.sun.enterprise.ee.cms.core.GroupHandlepublic List<String> getAllCurrentMembers()
getAllCurrentMembers in interface com.sun.enterprise.ee.cms.core.GroupHandlepublic List<String> getCurrentCoreMembersWithStartTimes()
getCurrentCoreMembersWithStartTimes in interface com.sun.enterprise.ee.cms.core.GroupHandlepublic List<String> getAllCurrentMembersWithStartTimes()
getAllCurrentMembersWithStartTimes in interface com.sun.enterprise.ee.cms.core.GroupHandlepublic void raiseFence(String componentName, String failedMemberToken) throws com.sun.enterprise.ee.cms.core.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 com.sun.enterprise.ee.cms.core.GroupHandlecomponentName - the component namefailedMemberToken - the member tokencom.sun.enterprise.ee.cms.core.GMSException - the GMS generic exceptionpublic void lowerFence(String componentName, String failedMemberToken) throws com.sun.enterprise.ee.cms.core.GMSException
lowerFence in interface com.sun.enterprise.ee.cms.core.GroupHandlecomponentName - target member componentfailedMemberToken - the member token of the failed membercom.sun.enterprise.ee.cms.core.GMSException - the GMS Generic Exceptionpublic void removeRecoveryAppointments(String failedMemberToken, String componentName) throws com.sun.enterprise.ee.cms.core.GMSException
removeRecoveryAppointments in interface com.sun.enterprise.ee.cms.core.GroupHandlecom.sun.enterprise.ee.cms.core.GMSExceptionpublic 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 com.sun.enterprise.ee.cms.core.GroupHandlecomponentName - the component namememberToken - the member tokenpublic boolean isMemberAlive(String memberToken)
isMemberAlive in interface com.sun.enterprise.ee.cms.core.GroupHandlepublic String getGroupLeader()
getGroupLeader in interface com.sun.enterprise.ee.cms.core.GroupHandlepublic boolean isGroupLeader()
isGroupLeader in interface com.sun.enterprise.ee.cms.core.GroupHandlepublic List<String> getCurrentAliveOrReadyMembers()
getCurrentAliveOrReadyMembers in interface com.sun.enterprise.ee.cms.core.GroupHandlepublic com.sun.enterprise.ee.cms.spi.MemberStates getMemberState(String member)
getMemberState in interface com.sun.enterprise.ee.cms.core.GroupHandlepublic com.sun.enterprise.ee.cms.spi.MemberStates getMemberState(String member, long threshold, long timeout)
getMemberState in interface com.sun.enterprise.ee.cms.core.GroupHandlepublic boolean isWatchdog()
public void announceWatchdogObservedFailure(String serverToken) throws com.sun.enterprise.ee.cms.core.GMSException
announceWatchdogObservedFailure in interface com.sun.enterprise.ee.cms.core.GroupHandlecom.sun.enterprise.ee.cms.core.GMSExceptionpublic List<com.sun.enterprise.ee.cms.core.GMSMember> getCurrentView()
getCurrentView in interface com.sun.enterprise.ee.cms.core.GroupHandlepublic List<com.sun.enterprise.ee.cms.core.GMSMember> getPreviousView()
getPreviousView in interface com.sun.enterprise.ee.cms.core.GroupHandlepublic com.sun.enterprise.ee.cms.core.AliveAndReadyView getPreviousAliveAndReadyCoreView()
getPreviousAliveAndReadyCoreView in interface com.sun.enterprise.ee.cms.core.GroupHandlepublic com.sun.enterprise.ee.cms.core.AliveAndReadyView getCurrentAliveAndReadyCoreView()
getCurrentAliveAndReadyCoreView in interface com.sun.enterprise.ee.cms.core.GroupHandleCopyright © 2017–2019 Eclipse Foundation. All rights reserved.