org.jgroups.protocols
Class TP.TransferQueueBundler

java.lang.Object
  extended by org.jgroups.protocols.TP.TransferQueueBundler
All Implemented Interfaces:
java.lang.Runnable, TP.Bundler
Enclosing class:
TP

protected class TP.TransferQueueBundler
extends java.lang.Object
implements TP.Bundler, java.lang.Runnable

Uses a queue to transfer messages between the sender's thread and a single bundler thread. The latter continually removes messages from the queue and adds them to a hashmap. If a max size has been exceeded or max time has elapsed, all accumulated messages are sent by the bundler thread. The advantage here is that the sender's thread doesn't have to send the accumulated messages, although it might block when adding a message to the (bounded) queue when the queue is full.


Field Summary
static java.lang.String THREAD_NAME
           
 
Method Summary
 int getBufferSize()
           
 java.lang.Thread getThread()
           
 void run()
           
 void send(Message msg)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THREAD_NAME

public static final java.lang.String THREAD_NAME
See Also:
Constant Field Values
Method Detail

start

public void start()
Specified by:
start in interface TP.Bundler

getThread

public java.lang.Thread getThread()

stop

public void stop()
Specified by:
stop in interface TP.Bundler

send

public void send(Message msg)
          throws java.lang.Exception
Specified by:
send in interface TP.Bundler
Throws:
java.lang.Exception

getBufferSize

public int getBufferSize()

run

public void run()
Specified by:
run in interface java.lang.Runnable


Copyright © 1998-2012 Bela Ban / Red Hat. All Rights Reserved.