|
||||||||||
| 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.GroupCommunicationProviderImpl
public class GroupCommunicationProviderImpl
Implements the GroupCommunicationProvider interface to plug in JxtaClusterManagement layer as a Group Communication Provider for GMS.
| Constructor Summary | |
|---|---|
GroupCommunicationProviderImpl(String groupName)
|
|
| Method Summary | |
|---|---|
void |
announceClusterShutdown(GMSMessage gmsMessage)
|
void |
announceGroupStartup(String groupName,
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 |
MemberStates |
getMemberState(String memberIdentityToken)
|
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(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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GroupCommunicationProviderImpl(String groupName)
| Method Detail |
|---|
public void clusterViewEvent(ClusterViewEvent clusterViewEvent,
ClusterView clusterView)
ClusterViewEventListener
clusterViewEvent 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 GMSException
initializeGroupCommunicationProvider in interface GroupCommunicationProvidermemberName - member namegroupName - group nameidentityMap - valid configuration propertiesconfigProperties - configuration properties
GMSExceptionpublic void join()
join in interface GroupCommunicationProviderpublic void announceClusterShutdown(GMSMessage gmsMessage)
announceClusterShutdown in interface GroupCommunicationProvider
public void announceGroupStartup(String groupName,
GMSConstants.groupStartupState startupState,
List<String> memberTokens)
announceGroupStartup in interface GroupCommunicationProvidergroupName - name of groupstartupState - INITATED, COMPLETED_SUCCESS or COMPLETED_FAILEDmemberTokens - static list of members associated with startupState. Failed members if state is COMPLETED_FAILED>public void leave(boolean isClusterShutdown)
leave in interface GroupCommunicationProvider
public boolean sendMessage(PeerID id,
Serializable msg)
public void sendMessage(String targetMemberIdentityToken,
Serializable message,
boolean synchronous)
throws GMSException,
MemberNotInViewException
sendMessage in interface 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.
GMSException
MemberNotInViewException
protected void monitorDoSend(GMSMessage msg,
long sendDuration,
boolean sendSucceeded,
Exception e)
public void sendMessage(Serializable message)
throws GMSException,
MemberNotInViewException
sendMessage in interface GroupCommunicationProviderGMSException
MemberNotInViewExceptionpublic Object getLocalAddress()
public List<String> getMembers()
getMembers in interface GroupCommunicationProviderpublic boolean isGroupLeader()
isGroupLeader in interface GroupCommunicationProvider
public MemberStates getMemberState(String member,
long threshold,
long timeout)
getMemberState in interface GroupCommunicationProviderpublic MemberStates getMemberState(String memberIdentityToken)
getMemberState in interface GroupCommunicationProviderpublic String getGroupLeader()
getGroupLeader in interface GroupCommunicationProvider
public void handleClusterMessage(SystemAdvertisement adv,
Object message)
ClusterMessageListener
handleClusterMessage in interface ClusterMessageListeneradv - source system advertisementmessage - the messagepublic void assumeGroupLeadership()
assumeGroupLeadership in interface GroupCommunicationProviderpublic void setGroupStoppingState()
setGroupStoppingState in interface GroupCommunicationProviderpublic void reportJoinedAndReadyState()
reportJoinedAndReadyState in interface GroupCommunicationProvider
public void announceWatchdogObservedFailure(String serverToken)
throws GMSException
public boolean isDiscoveryInProgress()
isDiscoveryInProgress in interface GroupCommunicationProvider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||