org.jgroups.protocols

Class 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.6 $

Author:
Bela Ban

Field Summary

Fields inherited from class org.jgroups.protocols.GmsImpl

gms, log

Constructor Summary

ClientGmsImpl(GMS g)

Method Summary

boolean
handleJoin(Address mbr)
void
handleLeave(Address mbr, boolean suspected)
Returns false.
View
handleMerge(ViewId other_view, Vector other_members)
Returns immediately.
void
handleSuspect(Address mbr)
Returns immediately.
boolean
handleUpEvent(Event evt)
void
handleViewChange(ViewId new_view, Vector mems)
Install the first view in which we are a member.
void
init()
void
join(Address mbr)
Will generate a CONNECT_OK event.
void
leave(Address mbr)
void
merge(Vector other_coords)
void
suspect(Address mbr)

Methods inherited from class org.jgroups.protocols.GmsImpl

handleDownEvent, handleJoin, handleLeave, handleMerge, handleSuspect, handleUpEvent, handleViewChange, iWouldBeCoordinator, init, join, leave, merge, suspect, wrongMethod

Constructor Details

ClientGmsImpl

public ClientGmsImpl(GMS g)

Method Details

handleJoin

public boolean handleJoin(Address mbr)
Overrides:
handleJoin in interface GmsImpl


handleLeave

public void handleLeave(Address mbr,
                        boolean suspected)
Returns false. Clients don't handle leave() requests
Overrides:
handleLeave in interface GmsImpl


handleMerge

public View handleMerge(ViewId other_view,
                        Vector other_members)
Returns immediately. Clients don't handle merge() requests
Overrides:
handleMerge in interface GmsImpl


handleSuspect

public void handleSuspect(Address mbr)
Returns immediately. Clients don't handle suspect() requests
Overrides:
handleSuspect in interface GmsImpl


handleUpEvent

public boolean handleUpEvent(Event evt)
Overrides:
handleUpEvent in interface GmsImpl


handleViewChange

public void handleViewChange(ViewId new_view,
                             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 interface GmsImpl


init

public void init()
Overrides:
init in interface GmsImpl


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).

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 interface GmsImpl

Parameters:
mbr - Our own address (assigned through SET_LOCAL_ADDRESS)


leave

public void leave(Address mbr)
Overrides:
leave in interface GmsImpl


merge

public void merge(Vector other_coords)
Overrides:
merge in interface GmsImpl


suspect

public void suspect(Address mbr)
Overrides:
suspect in interface GmsImpl


Copyright B) 2001,2002 www.jgroups.com . All Rights Reserved.