org.javagroups.protocols
Class TOTAL_TOKEN

java.lang.Object
  extended byorg.javagroups.stack.Protocol
      extended byorg.javagroups.stack.MessageProtocol
          extended byorg.javagroups.stack.RpcProtocol
              extended byorg.javagroups.protocols.TOTAL_TOKEN
All 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.javagroups.demos.TotalTokenDemo and total-token.xml configuration file provided with this distribution of JavaGroups.

Version:
$Revision: 1.16 $
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 java.lang.String prot_name
           
 
Fields inherited from class org.javagroups.stack.MessageProtocol
_corr, members
 
Fields inherited from class org.javagroups.stack.Protocol
down_handler, down_prot, down_queue, down_thread, down_thread_prio, observer, props, stack, up_handler, up_prot, up_queue, up_thread, up_thread_prio
 
Constructor Summary
TOTAL_TOKEN()
           
 
Method Summary
 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.javagroups.stack.MessageProtocol#stop().
protected  void updateView(View newMembers)
           
 
Methods inherited from class org.javagroups.stack.RpcProtocol
callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethod, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, handle
 
Methods inherited from class org.javagroups.stack.MessageProtocol
castMessage, down, sendMessage, up
 
Methods inherited from class org.javagroups.stack.Protocol
destroy, getDownProtocol, getDownQueue, getProperties, getUpProtocol, getUpQueue, init, passDown, passUp, providedDownServices, receiveDownEvent, receiveUpEvent, requiredDownServices, requiredUpServices, setDownProtocol, setObserver, setPropertiesInternal, setProtocolStack, setUpProtocol, startDownHandler, startUpHandler, stopInternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prot_name

public static final java.lang.String prot_name
See Also:
Constant Field Values
Constructor Detail

TOTAL_TOKEN

public TOTAL_TOKEN()
Method Detail

getName

public java.lang.String getName()
Overrides:
getName in class RpcProtocol

start

public void start()
           throws java.lang.Exception
Description copied from class: Protocol
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 class MessageProtocol
Throws:
java.lang.Exception

stop

public void stop()
Overrides @org.javagroups.stack.MessageProtocol#stop().

Overrides:
stop in class MessageProtocol

setProperties

public boolean setProperties(java.util.Properties props)
Setup the Protocol instance acording to the configuration string

Overrides:
setProperties in class Protocol

getTokenReceiverAddress

public IpAddress getTokenReceiverAddress()

providedUpServices

public java.util.Vector providedUpServices()
Description copied from class: Protocol
List of events that are provided to layers above (they will be handled when sent down from above).

Overrides:
providedUpServices in class Protocol
Returns:
Vector (of Integers)

handleUpEvent

public boolean handleUpEvent(Event evt)
Description copied from class: RpcProtocol
Handle up event. Return false if it should not be passed up the stack.

Overrides:
handleUpEvent in class RpcProtocol

handleDownEvent

public boolean handleDownEvent(Event evt)
Description copied from class: RpcProtocol
Handle down event. Return false if it should not be passed down the stack.

Overrides:
handleDownEvent in class RpcProtocol

getAllReceivedUpTo

public long getAllReceivedUpTo()

installTransitionalView

public void installTransitionalView(java.util.Vector members)

updateView

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


Copyright © 2001,2002 www.javagroups.com . All Rights Reserved.