org.jgroups.protocols
Class TP.DefaultBundler

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

protected class TP.DefaultBundler
extends java.lang.Object
implements TP.Bundler

The sender's thread adds a message to the hashmap and - if the accumulated size has been exceeded - sends all bundled messages. The cost of sending the bundled messages is therefore distributed over different threads; whoever happens to send a message exceeding the max size gets to send the accumulated messages. We also use a number of timer tasks to send bundled messages after a certain time has elapsed. This is necessary e.g. when a message is added that doesn't exceed the max size, but then no further messages are added, so elapsed time will trigger the sending, not exceeding of the max size. TODO: reuse code for hashmap based bundling for the bundlers below


Constructor Summary
protected TP.DefaultBundler()
           
 
Method Summary
 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
 

Constructor Detail

TP.DefaultBundler

protected TP.DefaultBundler()
Method Detail

start

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

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


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