Class SHUFFLE

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

public class SHUFFLE extends Protocol implements 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
  • Constructor Details

    • SHUFFLE

      public SHUFFLE()
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in class Protocol
    • setProperties

      public boolean setProperties(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 Object up(Event evt)
      Adds upcoming messages to the messages Listinvalid input: '<'\code> where the messagesHandlerinvalid input: '<'\code> retrieves them.
      Overrides:
      up in class Protocol
    • start

      public void start() throws Exception
      Starts the messagesHandlerinvalid input: '<'\code>
      Overrides:
      start in class Protocol
      Throws:
      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 Listinvalid input: '<'\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 Runnable