org.jgroups.protocols
Class TOTAL

java.lang.Object
  extended by org.jgroups.stack.Protocol
      extended by org.jgroups.protocols.TOTAL

public class TOTAL
extends Protocol

Implements the total ordering layer using a message sequencer

The protocol guarantees that all bcast sent messages will be delivered in the same order to all members. For that it uses a sequencer which assignes monotonically increasing sequence ID to broadcasts. Then all group members deliver the bcasts in ascending sequence ID order.

Please note that once a BLOCK_OK is acknowledged messages coming from above are discarded! Either the application must stop sending messages when a BLOCK event is received from the channel or a QUEUE layer should be placed above this one. Received messages are still delivered above though.

bcast requests are retransmitted periodically until a bcast reply is received. In case a BCAST_REP is on its way during a BCAST_REQ retransmission, then the next BCAST_REP will be to a non-existing BCAST_REQ. So, a null BCAST message is sent to fill the created gap in the seqID of all members.

Author:
i.georgiadis@doc.ic.ac.uk, Bela Ban

Nested Class Summary
static class TOTAL.Header
          The header processed by the TOTAL layer and intended for TOTAL inter-stack communication
 
Field Summary
 
Fields inherited from class org.jgroups.stack.Protocol
down_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 Summary
TOTAL()
          Create the TOTAL layer
 
Method Summary
 void down(Event event)
          Process an event coming from the layer above
 java.lang.String getName()
           
 java.util.Vector requiredDownServices()
          Events that some layer below must handle
 java.util.Vector requiredUpServices()
          Events that some layer above must handle
 boolean setProperties(java.util.Properties properties)
          Configure the protocol based on the given list of properties
 void start()
          Prepare this layer to receive messages from above
 void stop()
          Handle the stop() method travelling down the stack.
 void up(Event event)
          Process an event coming from the layer below
 
Methods inherited from class org.jgroups.stack.Protocol
destroy, downThreadEnabled, dumpStats, enableStats, getDownProtocol, getDownQueue, getProperties, getUpProtocol, getUpQueue, handleSpecialDownEvent, init, passDown, passUp, printStats, providedDownServices, providedUpServices, receiveDownEvent, receiveUpEvent, resetStats, setDownProtocol, setObserver, setPropertiesInternal, setProtocolStack, setUpProtocol, startDownHandler, startUpHandler, statsEnabled, stopInternal, upThreadEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TOTAL

public TOTAL()
Create the TOTAL layer

Method Detail

getName

public java.lang.String getName()
Specified by:
getName in class Protocol
Returns:
this protocol's name

setProperties

public boolean setProperties(java.util.Properties properties)
Configure the protocol based on the given list of properties

Overrides:
setProperties in class Protocol
Parameters:
properties - the list of properties to use to setup this layer
Returns:
false if there was any unrecognized property or a property with an invalid value

requiredDownServices

public java.util.Vector requiredDownServices()
Events that some layer below must handle

Overrides:
requiredDownServices in class Protocol
Returns:
the set of Events that must be handled by some layer below

requiredUpServices

public java.util.Vector requiredUpServices()
Events that some layer above must handle

Overrides:
requiredUpServices in class Protocol
Returns:
the set of Events that must be handled by some layer above

start

public void start()
           throws java.lang.Exception
Prepare this layer to receive messages from above

Overrides:
start in class Protocol
Throws:
java.lang.Exception - Thrown if protocol cannot be started successfully. This will cause the ProtocolStack to fail, so Channel.connect(String) will throw an exception

stop

public void stop()
Handle the stop() method travelling down the stack.

The local addr is set to null, since after a Start->Stop->Start sequence this member's addr is not guaranteed to be the same

Overrides:
stop in class Protocol

up

public void up(Event event)
Process an event coming from the layer below

Overrides:
up in class Protocol
Parameters:
event - the event to process

down

public void down(Event event)
Process an event coming from the layer above

Overrides:
down in class Protocol
Parameters:
event - the event to process


Copyright ? 1998-2006 Bela Ban. All Rights Reserved.