public class GroupCommunicationProviderImpl extends Object implements com.sun.enterprise.ee.cms.spi.GroupCommunicationProvider, ClusterViewEventListener, ClusterMessageListener
| Constructor and Description |
|---|
GroupCommunicationProviderImpl(String groupName) |
| Modifier and Type | Method and Description |
|---|---|
void |
announceClusterShutdown(com.sun.enterprise.ee.cms.spi.GMSMessage gmsMessage) |
void |
announceGroupStartup(String groupName,
com.sun.enterprise.ee.cms.core.GMSConstants.groupStartupState startupState,
List<String> memberTokens)
Demarcate the INITIATION and COMPLETION of group startup.
|
void |
announceWatchdogObservedFailure(String serverToken)
implements Callable.
|
void |
assumeGroupLeadership() |
void |
clusterViewEvent(ClusterViewEvent clusterViewEvent,
ClusterView clusterView)
Called when a cluster view event occurs.
|
String |
getGroupLeader() |
Object |
getLocalAddress()
Returns the address representing the peer identified by this process.
|
List<String> |
getMembers()
returns a list of members that are currently alive in the group
|
com.sun.enterprise.ee.cms.spi.MemberStates |
getMemberState(String memberIdentityToken) |
com.sun.enterprise.ee.cms.spi.MemberStates |
getMemberState(String member,
long threshold,
long timeout) |
void |
handleClusterMessage(SystemAdvertisement adv,
Object message)
Called when a message is received from another member.
|
void |
initializeGroupCommunicationProvider(String memberName,
String groupName,
Map<String,String> identityMap,
Map configProperties)
Initializes the Group Communication Service Provider with the requisite
values of group identity, member(self) identity, and a Map containing
recognized and valid configuration properties that can be set/overriden
by the employing application.
|
boolean |
isDiscoveryInProgress() |
boolean |
isGroupLeader() |
void |
join()
Joins the group using semantics specified by the underlying GCP system
|
void |
leave(boolean isClusterShutdown)
Leaves the group as a result of a planned administrative action to
shutdown.
|
protected void |
monitorDoSend(com.sun.enterprise.ee.cms.spi.GMSMessage msg,
long sendDuration,
boolean sendSucceeded,
Exception e) |
void |
reportJoinedAndReadyState() |
boolean |
sendMessage(PeerID id,
Serializable msg) |
void |
sendMessage(Serializable message) |
void |
sendMessage(String targetMemberIdentityToken,
Serializable message,
boolean synchronous)
Sends a message using the underlying group communication
providers'(GCP's) APIs.
|
void |
setGroupStoppingState() |
public GroupCommunicationProviderImpl(String groupName)
public void clusterViewEvent(ClusterViewEvent clusterViewEvent, ClusterView clusterView)
ClusterViewEventListenerclusterViewEvent in interface ClusterViewEventListenerclusterViewEvent - The event that occurred.clusterView - the current membership snapshot after the event.public void initializeGroupCommunicationProvider(String memberName, String groupName, Map<String,String> identityMap, Map configProperties) throws com.sun.enterprise.ee.cms.core.GMSException
initializeGroupCommunicationProvider in interface com.sun.enterprise.ee.cms.spi.GroupCommunicationProvidermemberName - member namegroupName - group nameidentityMap - valid configuration propertiesconfigProperties - configuration propertiescom.sun.enterprise.ee.cms.core.GMSExceptionpublic void join()
join in interface com.sun.enterprise.ee.cms.spi.GroupCommunicationProviderpublic void announceClusterShutdown(com.sun.enterprise.ee.cms.spi.GMSMessage gmsMessage)
announceClusterShutdown in interface com.sun.enterprise.ee.cms.spi.GroupCommunicationProviderpublic void announceGroupStartup(String groupName, com.sun.enterprise.ee.cms.core.GMSConstants.groupStartupState startupState, List<String> memberTokens)
announceGroupStartup in interface com.sun.enterprise.ee.cms.spi.GroupCommunicationProvidergroupName - name of groupstartupState - INITATED, COMPLETED_SUCCESS or COMPLETED_FAILEDmemberTokens - static list of members associated with startupState. Failed members if state is COMPLETED_FAILEDpublic void leave(boolean isClusterShutdown)
leave in interface com.sun.enterprise.ee.cms.spi.GroupCommunicationProviderpublic boolean sendMessage(PeerID id, Serializable msg)
public void sendMessage(String targetMemberIdentityToken, Serializable message, boolean synchronous) throws com.sun.enterprise.ee.cms.core.GMSException, com.sun.enterprise.ee.cms.core.MemberNotInViewException
sendMessage in interface com.sun.enterprise.ee.cms.spi.GroupCommunicationProvidertargetMemberIdentityToken - The member token string that identifies
the target member to which this message is addressed.
The implementation is expected to provide a mapping
the member token to the GCP's addressing semantics.
If null, the entire group would receive this message.message - a Serializable object that wraps the user specified
message in order to allow remote GMS instances to
unpack this message appropriately.synchronous - setting true here will call the underlying GCP's api
that corresponds to a synchronous message, if
available.com.sun.enterprise.ee.cms.core.GMSException - the GMS generic expectioncom.sun.enterprise.ee.cms.core.MemberNotInViewExceptionprotected void monitorDoSend(com.sun.enterprise.ee.cms.spi.GMSMessage msg,
long sendDuration,
boolean sendSucceeded,
Exception e)
public void sendMessage(Serializable message) throws com.sun.enterprise.ee.cms.core.GMSException, com.sun.enterprise.ee.cms.core.MemberNotInViewException
sendMessage in interface com.sun.enterprise.ee.cms.spi.GroupCommunicationProvidercom.sun.enterprise.ee.cms.core.GMSExceptioncom.sun.enterprise.ee.cms.core.MemberNotInViewExceptionpublic Object getLocalAddress()
public List<String> getMembers()
getMembers in interface com.sun.enterprise.ee.cms.spi.GroupCommunicationProviderpublic boolean isGroupLeader()
isGroupLeader in interface com.sun.enterprise.ee.cms.spi.GroupCommunicationProviderpublic com.sun.enterprise.ee.cms.spi.MemberStates getMemberState(String member, long threshold, long timeout)
getMemberState in interface com.sun.enterprise.ee.cms.spi.GroupCommunicationProviderpublic com.sun.enterprise.ee.cms.spi.MemberStates getMemberState(String memberIdentityToken)
getMemberState in interface com.sun.enterprise.ee.cms.spi.GroupCommunicationProviderpublic String getGroupLeader()
getGroupLeader in interface com.sun.enterprise.ee.cms.spi.GroupCommunicationProviderpublic void handleClusterMessage(SystemAdvertisement adv, Object message)
ClusterMessageListenerhandleClusterMessage in interface ClusterMessageListeneradv - source system advertisementmessage - the messagepublic void assumeGroupLeadership()
assumeGroupLeadership in interface com.sun.enterprise.ee.cms.spi.GroupCommunicationProviderpublic void setGroupStoppingState()
setGroupStoppingState in interface com.sun.enterprise.ee.cms.spi.GroupCommunicationProviderpublic void reportJoinedAndReadyState()
reportJoinedAndReadyState in interface com.sun.enterprise.ee.cms.spi.GroupCommunicationProviderpublic void announceWatchdogObservedFailure(String serverToken) throws com.sun.enterprise.ee.cms.core.GMSException
announceWatchdogObservedFailure in interface com.sun.enterprise.ee.cms.spi.GroupCommunicationProvidercom.sun.enterprise.ee.cms.core.GMSExceptionpublic boolean isDiscoveryInProgress()
isDiscoveryInProgress in interface com.sun.enterprise.ee.cms.spi.GroupCommunicationProviderCopyright © 2017–2019 Eclipse Foundation. All rights reserved.