Package org.jgroups.protocols.pbcast
Class Leaver
java.lang.Object
org.jgroups.protocols.pbcast.Leaver
Handles the leaving of a member from a group. On leave(), a LEAVE-REQ is sent to the coordinator and the caller is
blocked until a LEAVE-RSP has been received.
If the coordinator changes before the response has been received, the LEAVE-REQ will be resent to the new cordinator. If the coordinator is null, leave() returns.
- Since:
- 4.1.4
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final GMSprotected final AtomicBooleanprotected final Log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcoordChanged(Address new_coord) Callback to notify Leaver that the coord changed.voidhandleLeaveResponse(Address sender) voidleave()Sends a LEAVE-REQ to the coordinator.voidreset()Interrupts and stops the current leave process (if one is in progress).protected voidsendLeaveRequest(Address coord, Address leaving_mbr)
-
Field Details
-
gms
-
log
-
leave_promise
-
leaving
-
-
Constructor Details
-
Leaver
-
-
Method Details
-
leave
public void leave()Sends a LEAVE-REQ to the coordinator. Blocks the caller until a LEAVE-RSP has been received, or no coord is found. -
handleLeaveResponse
-
coordChanged
Callback to notify Leaver that the coord changed. This will result in resending the LEAVE-REQ to the new coordinator. If there's no new coord (e.g. because we're the last member),leave()(if there is one in progress) will return and unblock the caller. -
reset
public void reset()Interrupts and stops the current leave process (if one is in progress). No-op is no leave process is in progress. This unblocks the caller ofleave()(if present). -
sendLeaveRequest
-