public class TOTAL_TOKEN extends RpcProtocol
Total order implementation based on The Totem Single-Ring Ordering and Membership Protocol.
However, this is an adaption of algorithm mentioned in the research paper above since we reuse our own membership protocol and failure detectors. Somewhat different flow control mechanism is also implemented.
Token passing is done through reliable point-to-point udp channels provided by UNICAST layer. Process groups nodes members are organized in a logical ring.
Total token layer doesn't need NAKACK nor STABLE layer beneath it since it implements it's own retransmission and tracks stability of the messages from the information piggybacked on the token itself.
For the typical protocol stack configuration used, see org.jgroups.demos.TotalTokenDemo and total-token.xml configuration file provided with this distribution of JGroups.
RingNodeFlowControl,
RingNode,
TcpRingNode,
UdpRingNode| Modifier and Type | Class and Description |
|---|---|
static class |
TOTAL_TOKEN.RingTokenHeader |
static class |
TOTAL_TOKEN.TotalTokenHeader |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
prot_name |
_corr, membersdown_handler, down_prot, down_queue, down_thread, down_thread_prio, log, observer, props, stack, stats, up_handler, up_prot, up_queue, up_thread, up_thread_prio| Constructor and Description |
|---|
TOTAL_TOKEN() |
| Modifier and Type | Method and Description |
|---|---|
long |
getAllReceivedUpTo() |
java.lang.String |
getName() |
IpAddress |
getTokenReceiverAddress() |
boolean |
handleDownEvent(Event evt)
Handle down event.
|
boolean |
handleUpEvent(Event evt)
Handle up event.
|
void |
installTransitionalView(java.util.Vector members) |
java.util.Vector |
providedUpServices()
List of events that are provided to layers above (they will be handled when sent down from
above).
|
boolean |
setProperties(java.util.Properties props)
Setup the Protocol instance acording to the configuration string
|
void |
start()
This method is called on a
Channel.connect(String). |
void |
stop()
Overrides @org.jgroups.stack.MessageProtocol#stop().
|
protected void |
updateView(View newMembers) |
callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethods, callRemoteMethods, callRemoteMethods, handlecastMessage, down, sendMessage, updestroy, downThreadEnabled, dumpStats, enableStats, getDownProtocol, getDownQueue, getProperties, getUpProtocol, getUpQueue, handleSpecialDownEvent, init, passDown, passUp, printStats, providedDownServices, receiveDownEvent, receiveUpEvent, requiredDownServices, requiredUpServices, resetStats, setDownProtocol, setObserver, setPropertiesInternal, setProtocolStack, setUpProtocol, startDownHandler, startUpHandler, statsEnabled, stopInternal, upThreadEnabledpublic static final java.lang.String prot_name
public java.lang.String getName()
getName in class RpcProtocolpublic void start()
throws java.lang.Exception
ProtocolChannel.connect(String). Starts work.
Protocols are connected and queues are ready to receive events.
Will be called from bottom to top. This call will replace
the START and START_OK events.start in class MessageProtocoljava.lang.Exception - Thrown if protocol cannot be started successfully. This will cause the ProtocolStack
to fail, so Channel.connect(String) will throw an exceptionpublic void stop()
stop in class MessageProtocolpublic boolean setProperties(java.util.Properties props)
setProperties in class Protocolpublic IpAddress getTokenReceiverAddress()
public java.util.Vector providedUpServices()
ProtocolprovidedUpServices in class Protocolpublic boolean handleUpEvent(Event evt)
RpcProtocolhandleUpEvent in class RpcProtocolpublic boolean handleDownEvent(Event evt)
RpcProtocolhandleDownEvent in class RpcProtocolpublic long getAllReceivedUpTo()
public void installTransitionalView(java.util.Vector members)
protected void updateView(View newMembers)
updateView in class MessageProtocolCopyright ? 1998-2006 Bela Ban. All Rights Reserved.