JavaGroups.JavaStack.Protocols
Class ClientGmsImpl

java.lang.Object
  |
  +--JavaGroups.JavaStack.Protocols.GmsImpl
        |
        +--JavaGroups.JavaStack.Protocols.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.


Method Summary
static ClientGmsImpl CreateInstance(GMS gms)
           
 boolean HandleJoin(Address mbr)
           
 void HandleLeave(Address mbr, boolean suspected)
          Returns false.
 void HandleMerge(java.util.Vector new_mems)
          Returns immediately.
 void HandleSuspect(Address mbr)
          Returns immediately.
 boolean HandleUpEvent(Event evt)
           
 void HandleViewChange(ViewId new_view, java.util.Vector mems)
          Install the first view in which we are a member.
 void Join(Address mbr)
          Will generate a CONNECT_OK event.
 void Leave(Address mbr)
           
 void Merge(java.util.Vector new_mbrs)
           
 void Suspect(Address mbr)
           
 
Methods inherited from class JavaGroups.JavaStack.Protocols.GmsImpl
HandleDownEvent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

CreateInstance

public static ClientGmsImpl CreateInstance(GMS gms)

Join

public void Join(Address mbr)
Will generate a CONNECT_OK event. Determines the coordinator and sends a unicast Join() message to it. If successful, we wait for a ViewChange (can time out). If view change is received, 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).
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

Suspect

public void Suspect(Address mbr)
Overrides:
Suspect in class GmsImpl

Merge

public void Merge(java.util.Vector new_mbrs)
Overrides:
Merge in class GmsImpl

HandleJoin

public boolean 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(ViewId new_view,
                             java.util.Vector mems)
Install the first view in which we are a member. This is essentially a confirmation of our JOIN request (see Join() above).
Overrides:
HandleViewChange in class GmsImpl

HandleMerge

public void HandleMerge(java.util.Vector new_mems)
Returns immediately. Clients don't handle Merge() requests
Overrides:
HandleMerge 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