org.jgroups.protocols

Class SHUFFLE

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

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, up_handler, up_prot, up_queue, up_thread, up_thread_prio

Constructor Summary

SHUFFLE()

Method Summary

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(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, getDownProtocol, getDownQueue, getName, getProperties, getUpProtocol, getUpQueue, handleSpecialDownEvent, init, passDown, passUp, providedDownServices, providedUpServices, receiveDownEvent, receiveUpEvent, requiredDownServices, requiredUpServices, setDownProtocol, setObserver, setProperties, setPropertiesInternal, setProtocolStack, setUpProtocol, start, startDownHandler, startUpHandler, stop, stopInternal, up

Constructor Details

SHUFFLE

public SHUFFLE()

Method Details

getName

public String getName()
Overrides:
getName in interface 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.

setProperties

public boolean setProperties(Properties props)
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 interface Protocol

start

public void start()
            throws Exception
Starts the messagesHandler<\code>
Overrides:
start in interface Protocol

stop

public void stop()
Stops the messagesHandler
Overrides:
stop in interface Protocol

up

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

Copyright B) 2001,2002 www.jgroups.com . All Rights Reserved.