Package org.jgroups.protocols
Class SHUFFLE
- java.lang.Object
-
- org.jgroups.stack.Protocol
-
- 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
-
-
Constructor Summary
Constructors Constructor Description SHUFFLE()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetName()voidrun()Removes a random chosen message from themessages 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.booleansetProperties(java.util.Properties props)Configures the protocol initially.voidstart()Starts themessagesHandler<\code>voidstop()Stops the messagesHandlerjava.lang.Objectup(Event evt)Adds upcoming messages to themessages List<\code> where themessagesHandler<\code> retrieves them.-
Methods inherited from class org.jgroups.stack.Protocol
destroy, down, downThreadEnabled, dumpStats, enableStats, getDownProtocol, getProperties, getProtocolStack, getThreadFactory, getTransport, getUpProtocol, init, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStats, setDownProtocol, setPropertiesInternal, setProtocolStack, setUpProtocol, statsEnabled, upThreadEnabled
-
-
-
-
Method Detail
-
setProperties
public boolean setProperties(java.util.Properties props)
Description copied from class:ProtocolConfigures the protocol initially. A configuration string consists of name=value items, separated by a ';' (semicolon), e.g.:"loopback=false;unicast_inport=4444"
- Overrides:
setPropertiesin classProtocol
-
up
public java.lang.Object up(Event evt)
Adds upcoming messages to themessages List<\code> where themessagesHandler<\code> retrieves them.
-
start
public void start() throws java.lang.ExceptionStarts themessagesHandler<\code>- Overrides:
startin classProtocol- Throws:
java.lang.Exception- Thrown if protocol cannot be started successfully. This will cause the ProtocolStack to fail, soChannel.connect(String)will throw an exception
-
run
public void run()
Removes a random chosen message from themessages 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:
runin interfacejava.lang.Runnable
-
-