Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jgroups.protocols.pbcast
Class ParticipantGmsImpl  view ParticipantGmsImpl download ParticipantGmsImpl.java

java.lang.Object
  extended byorg.jgroups.protocols.pbcast.GmsImpl
      extended byorg.jgroups.protocols.pbcast.ParticipantGmsImpl

public class ParticipantGmsImpl
extends GmsImpl


Field Summary
private  org.jgroups.util.Promise leave_promise
           
private  java.util.Vector suspected_mbrs
           
 
Fields inherited from class org.jgroups.protocols.pbcast.GmsImpl
gms, leaving, log, trace, warn
 
Constructor Summary
ParticipantGmsImpl(GMS g)
           
 
Method Summary
 void handleJoin(org.jgroups.Address mbr)
           
 void handleJoinResponse(JoinRsp join_rsp)
           
 void handleLeave(org.jgroups.Address mbr, boolean suspected)
           
 void handleLeaveResponse()
           
 void handleSuspect(org.jgroups.Address mbr)
           
 void handleViewChange(org.jgroups.View new_view, Digest digest)
          If we are leaving, we have to wait for the view change (last msg in the current view) that excludes us before we can leave.
 void init()
           
 void join(org.jgroups.Address mbr)
           
 void leave(org.jgroups.Address mbr)
          Loop: determine coord.
(package private)  void sendLeaveMessage(org.jgroups.Address coord, org.jgroups.Address mbr)
           
 void suspect(org.jgroups.Address mbr)
           
 void unsuspect(org.jgroups.Address mbr)
          Removes previously suspected member from list of currently suspected members
(package private)  boolean wouldIBeCoordinator()
          Determines whether this member is the new coordinator given a list of suspected members.
 
Methods inherited from class org.jgroups.protocols.pbcast.GmsImpl
handleDownEvent, handleExit, handleMergeCancelled, handleMergeRequest, handleMergeResponse, handleMergeView, handleUpEvent, iWouldBeCoordinator, merge, start, stop, wrongMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

suspected_mbrs

private final java.util.Vector suspected_mbrs

leave_promise

private final org.jgroups.util.Promise leave_promise
Constructor Detail

ParticipantGmsImpl

public ParticipantGmsImpl(GMS g)
Method Detail

init

public void init()
          throws java.lang.Exception
Overrides:
init in class GmsImpl

join

public void join(org.jgroups.Address mbr)
Specified by:
join in class GmsImpl

leave

public void leave(org.jgroups.Address mbr)
Loop: determine coord. If coord is me --> handleLeave(). Else send handleLeave() to coord until success

Specified by:
leave in class GmsImpl

handleJoinResponse

public void handleJoinResponse(JoinRsp join_rsp)
Specified by:
handleJoinResponse in class GmsImpl

handleLeaveResponse

public void handleLeaveResponse()
Specified by:
handleLeaveResponse in class GmsImpl

suspect

public void suspect(org.jgroups.Address mbr)
Specified by:
suspect in class GmsImpl

unsuspect

public void unsuspect(org.jgroups.Address mbr)
Removes previously suspected member from list of currently suspected members

Specified by:
unsuspect in class GmsImpl

handleJoin

public void handleJoin(org.jgroups.Address mbr)
Specified by:
handleJoin in class GmsImpl

handleLeave

public void handleLeave(org.jgroups.Address mbr,
                        boolean suspected)
Specified by:
handleLeave in class GmsImpl

handleViewChange

public void handleViewChange(org.jgroups.View new_view,
                             Digest digest)
If we are leaving, we have to wait for the view change (last msg in the current view) that excludes us before we can leave.

Specified by:
handleViewChange in class GmsImpl

handleSuspect

public void handleSuspect(org.jgroups.Address mbr)
Specified by:
handleSuspect in class GmsImpl

wouldIBeCoordinator

boolean wouldIBeCoordinator()
Determines whether this member is the new coordinator given a list of suspected members. This is computed as follows: the list of currently suspected members (suspected_mbrs) is removed from the current membership. If the first member of the resulting list is equals to the local_addr, then it is true, otherwise false. Example: own address is B, current membership is {A, B, C, D}, suspected members are {A, D}. The resulting list is {B, C}. The first member of {B, C} is B, which is equal to the local_addr. Therefore, true is returned.


sendLeaveMessage

void sendLeaveMessage(org.jgroups.Address coord,
                      org.jgroups.Address mbr)