org.jgroups.protocols
Class SHUFFLE

java.lang.Object
  extended by org.jgroups.stack.Protocol
      extended by org.jgroups.protocols.SHUFFLE
All Implemented Interfaces:
java.lang.Runnable

public class SHUFFLE
extends Protocol
implements java.lang.Runnable

This layer shuffles upcoming messages, put it just above your bottom layer. If you system sends less than 2 messages per sec you can notice a latency due to this layer.

Author:
Gianluca Collot

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, trace, up_handler, up_prot, up_queue, up_thread, up_thread_prio, warn
 
Constructor Summary
SHUFFLE()
           
 
Method Summary
 java.lang.String getName()
           
 void run()
          Removes a random chosen message from the messages List<\code> if there are less than 10 messages in the List it waits some time to ensure to chose from a set of messages > 1.
 boolean setProperties(java.util.Properties props)
          Configures the protocol initially.
 void start()
          Starts the messagesHandler<\code>
 void stop()
          Stops the messagesHandler
 void up(Event evt)
          Adds upcoming messages to the messages List<\code> where the messagesHandler<\code> retrieves them.
 
Methods inherited from class org.jgroups.stack.Protocol
destroy, down, downThreadEnabled, dumpStats, enableStats, getDownProtocol, getDownQueue, getProperties, getUpProtocol, getUpQueue, handleSpecialDownEvent, init, isTrace, isWarn, passDown, passUp, printStats, providedDownServices, providedUpServices, receiveDownEvent, receiveUpEvent, requiredDownServices, requiredUpServices, resetStats, setDownProtocol, setObserver, setPropertiesInternal, setProtocolStack, setTrace, setUpProtocol, setWarn, 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

SHUFFLE

public SHUFFLE()
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in class Protocol

setProperties

public boolean setProperties(java.util.Properties props)
Description copied from class: Protocol
Configures the protocol initially. A configuration string consists of name=value items, separated by a ';' (semicolon), e.g.:
 "loopback=false;unicast_inport=4444"
 

Overrides:
setProperties in class Protocol

up

public void up(Event evt)
Adds upcoming messages to the messages List<\code> where the messagesHandler<\code> retrieves them.

Overrides:
up in class Protocol

start

public void start()
           throws java.lang.Exception
Starts the messagesHandler<\code>

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()
Stops the messagesHandler

Overrides:
stop in class Protocol

run

public void run()
Removes a random chosen message from the messages List<\code> if there are less than 10 messages in the List it waits some time to ensure to chose from a set of messages > 1.

Specified by:
run in interface java.lang.Runnable


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