jPOS 1.6.7 API Documentation

org.jpos.util
Class ThroughputControl

java.lang.Object
  extended by org.jpos.util.ThroughputControl

public class ThroughputControl
extends java.lang.Object

ThroughputControl can be used to limit the throughput of a system to a maximum number of transactions in a given period of time.


Constructor Summary
ThroughputControl(int[] maxTransactions, int[] periodInMillis)
           
ThroughputControl(int maxTransactions, int periodInMillis)
           
 
Method Summary
 long control()
          control should be called on every transaction.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThroughputControl

public ThroughputControl(int maxTransactions,
                         int periodInMillis)
Parameters:
maxTransactions - ditto
periodInMillis - ditto

ThroughputControl

public ThroughputControl(int[] maxTransactions,
                         int[] periodInMillis)
Parameters:
maxTransactions - ditto
periodInMillis - ditto
Method Detail

control

public long control()
control should be called on every transaction. it may sleep for a while in order to control the system throughput

Returns:
aprox sleep time or zero if no sleep

jPOS.org