Package org.jgroups.protocols.pbcast
Class ClientGmsImpl
- java.lang.Object
-
- org.jgroups.protocols.pbcast.GmsImpl
-
- org.jgroups.protocols.pbcast.ClientGmsImpl
-
public class ClientGmsImpl extends GmsImpl
Client part of GMS. Whenever a new member wants to join a group, it starts in the CLIENT role. No multicasts to the group will be received and processed until the member has been joined and turned into a SERVER (either coordinator or participant, mostly just participant). This class only implementsJoin
(called by clients who want to join a certain group, andViewChange
which is called by the coordinator that was contacted by this client, to tell the client what its initial membership is.- Author:
- Bela Ban
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jgroups.protocols.pbcast.GmsImpl
GmsImpl.Request
-
-
Constructor Summary
Constructors Constructor Description ClientGmsImpl(GMS g)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
firstOfAllClients(Address joiner, Responses rsps)
Handles the case where no coord responses were received.void
handleJoinResponse(JoinRsp join_rsp)
void
init()
protected boolean
installViewIfValidJoinRsp(Promise<JoinRsp> join_promise, boolean block_for_rsp)
protected boolean
isJoinResponseValid(JoinRsp rsp)
void
join(Address address)
protected void
joinInternal(Address mbr, boolean joinWithStateTransfer)
Makes this process join a group.void
joinWithStateTransfer(Address local_addr)
void
leave()
-
Methods inherited from class org.jgroups.protocols.pbcast.GmsImpl
handleCoordLeave, handleDigestResponse, handleLeaveResponse, handleMembershipChange, handleMergeCancelled, handleMergeRequest, handleMergeResponse, handleMergeView, handleViewChange, merge, sendMergeRejectedResponse, start, stop, suspect, unsuspect, wrongMethod
-
-
-
-
Constructor Detail
-
ClientGmsImpl
public ClientGmsImpl(GMS g)
-
-
Method Detail
-
init
public void init() throws java.lang.Exception
-
joinWithStateTransfer
public void joinWithStateTransfer(Address local_addr)
- Specified by:
joinWithStateTransfer
in classGmsImpl
-
joinInternal
protected void joinInternal(Address mbr, boolean joinWithStateTransfer)
Makes this process join a group. Determines the coordinator and sends a JOIN request to it. The coordinator returns a JOIN response, then broadcasts the new view, which contains a message digest and the current membership (including the joiner). The joiner then installs the new view and the digest and starts accepting messages.
If successful, impl is changed to an instance of ParticipantGmsImpl. Otherwise, we continue trying to send JOIN requests to the coordinator, until we succeed (or there is no member in the group. In this case, we create our own singleton group).- Parameters:
mbr
- Our own address
-
handleJoinResponse
public void handleJoinResponse(JoinRsp join_rsp)
- Overrides:
handleJoinResponse
in classGmsImpl
-
installViewIfValidJoinRsp
protected boolean installViewIfValidJoinRsp(Promise<JoinRsp> join_promise, boolean block_for_rsp)
-
firstOfAllClients
protected boolean firstOfAllClients(Address joiner, Responses rsps)
Handles the case where no coord responses were received. Returns true if we became the coord (caller needs to terminate the join() call), or false when the caller needs to continue
-
isJoinResponseValid
protected boolean isJoinResponseValid(JoinRsp rsp)
-
-