org.jgroups.protocols

Class TOTAL_TOKEN

Implemented Interfaces:
RequestHandler

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.

Version:
$Revision: 1.7 $
Author:
Vladimir Blagojevic vladimir@cs.yorku.ca
See Also:
RingNodeFlowControl, RingNode, TcpRingNode, UdpRingNode

Nested Class Summary

static class
TOTAL_TOKEN.RingTokenHeader
static class
TOTAL_TOKEN.TotalTokenHeader

Field Summary

static String
prot_name

Fields inherited from class org.jgroups.stack.MessageProtocol

_corr, members

Fields inherited from class org.jgroups.stack.Protocol

down_handler, down_prot, down_queue, down_thread, down_thread_prio, log, observer, props, stack, up_handler, up_prot, up_queue, up_thread, up_thread_prio

Method Summary

long
getAllReceivedUpTo()
String
getName()
IpAddress
getTokenReceiverAddress()
boolean
handleDownEvent(Event evt)
Handle down event.
boolean
handleUpEvent(Event evt)
Handle up event.
void
installTransitionalView(Vector members)
Vector
providedUpServices()
List of events that are provided to layers above (they will be handled when sent down from above).
boolean
setProperties(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)

Methods inherited from class org.jgroups.stack.RpcProtocol

callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethods, callRemoteMethods, callRemoteMethods, getName, handle, handleDownEvent, handleUpEvent

Methods inherited from class org.jgroups.stack.MessageProtocol

castMessage, down, handle, handleDownEvent, handleUpEvent, sendMessage, start, stop, up, updateView

Methods inherited from class org.jgroups.stack.Protocol

destroy, down, getDownProtocol, getDownQueue, getName, getProperties, getUpProtocol, getUpQueue, handleSpecialDownEvent, init, passDown, passUp, providedDownServices, providedUpServices, receiveDownEvent, receiveUpEvent, requiredDownServices, requiredUpServices, setDownProtocol, setObserver, setProperties, setPropertiesInternal, setProtocolStack, setUpProtocol, start, startDownHandler, startUpHandler, stop, stopInternal, up

Field Details

prot_name

public static final String prot_name

Method Details

getAllReceivedUpTo

public long getAllReceivedUpTo()

getName

public String getName()
Overrides:
getName in interface RpcProtocol

getTokenReceiverAddress

public IpAddress getTokenReceiverAddress()

handleDownEvent

public boolean handleDownEvent(Event evt)
Handle down event. Return false if it should not be passed down the stack.
Overrides:
handleDownEvent in interface RpcProtocol

handleUpEvent

public boolean handleUpEvent(Event evt)
Handle up event. Return false if it should not be passed up the stack.
Overrides:
handleUpEvent in interface RpcProtocol

installTransitionalView

public void installTransitionalView(Vector members)

providedUpServices

public Vector providedUpServices()
List of events that are provided to layers above (they will be handled when sent down from above).
Overrides:
providedUpServices in interface Protocol
Returns:
Vector (of Integers)

setProperties

public boolean setProperties(Properties props)
Setup the Protocol instance acording to the configuration string
Overrides:
setProperties in interface Protocol

start

public void start()
            throws Exception
This method is called on a Channel.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.
Overrides:
start in interface MessageProtocol

stop

public void stop()
Overrides @org.jgroups.stack.MessageProtocol#stop().
Overrides:
stop in interface MessageProtocol

updateView

protected void updateView(View newMembers)
Overrides:
updateView in interface MessageProtocol

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