org.javagroups.protocols.pbcast
Class ClientGmsImpl
java.lang.Object
|
+--org.javagroups.protocols.pbcast.GmsImpl
|
+--org.javagroups.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 implements Join
(called by clients who want to join a certain group, and
ViewChange
which is called by the coordinator that was contacted by this client, to
tell the client what its initial membership is.
- Version:
- $Revision: 1.4 $
- Author:
- Bela Ban
Fields inherited from class org.javagroups.protocols.pbcast.GmsImpl |
gms |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClientGmsImpl
public ClientGmsImpl(GMS g)
join
public void join(Address mbr)
- Will generate a CONNECT_OK event. Determines the coordinator and sends a unicast
handleJoin() message to it. The coordinator broadcasts the new view and then returns a JoinRsp, which
contains a message digest and the current membership (including the joiner). The joiner is then
supposed to install the new view and the digest and starts accepting mcast messages. Previous
mcast messages were discarded (this is done in PBCAST).
If successful, impl is changed to an instance of ParticipantGmsImpl.
Otherwise, we continue trying to send join() messages to the coordinator,
until we succeed (or there is no member in the group. In this case, we create our own singleton group).
When GMS.disable_initial_coord is set to true, then we won't become coordinator on receiving an initial
membership of 0, but instead will retry (forever) until we get an initial membership of > 0.
- Overrides:
join
in class GmsImpl
- Parameters:
mbr
- Our own address (assigned through SET_LOCAL_ADDRESS)
leave
public void leave(Address mbr)
- Overrides:
leave
in class GmsImpl
handleJoinResponse
public void handleJoinResponse(JoinRsp join_rsp)
- Overrides:
handleJoinResponse
in class GmsImpl
handleLeaveResponse
public void handleLeaveResponse()
- Overrides:
handleLeaveResponse
in class GmsImpl
suspect
public void suspect(Address mbr)
- Overrides:
suspect
in class GmsImpl
unsuspect
public void unsuspect(Address mbr)
- Overrides:
unsuspect
in class GmsImpl
handleJoin
public JoinRsp handleJoin(Address mbr)
- Overrides:
handleJoin
in class GmsImpl
handleLeave
public void handleLeave(Address mbr,
boolean suspected)
- Returns false. Clients don't handle leave() requests
- Overrides:
handleLeave
in class GmsImpl
handleViewChange
public void handleViewChange(View new_view,
Digest digest)
- Does nothing. Discards all views while still client.
- Overrides:
handleViewChange
in class GmsImpl
handleSuspect
public void handleSuspect(Address mbr)
- Returns immediately. Clients don't handle suspect() requests
- Overrides:
handleSuspect
in class GmsImpl
handleUpEvent
public boolean handleUpEvent(Event evt)
- Overrides:
handleUpEvent
in class GmsImpl
Copyright © 2001,2002 www.javagroups.com . All Rights Reserved.