com.ibatis.common.util
Class Throttle

java.lang.Object
  extended bycom.ibatis.common.util.Throttle

public class Throttle
extends java.lang.Object

This is to help keep from getting too many resources


Constructor Summary
Throttle(int limit)
          Create a throttle object with just a limit
Throttle(int limit, long maxWait)
          Create a throttle object with a limit and a wait time
 
Method Summary
 void decrement()
          Remove a reference
 void increment()
          Add a reference; if a reference is not available, an exception is thrown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Throttle

public Throttle(int limit)
Create a throttle object with just a limit

Parameters:
limit - - the number of references to allow

Throttle

public Throttle(int limit,
                long maxWait)
Create a throttle object with a limit and a wait time

Parameters:
limit - - the number of references to allow
maxWait - - the maximum wait time allowed for a reference
Method Detail

increment

public void increment()
Add a reference; if a reference is not available, an exception is thrown


decrement

public void decrement()
Remove a reference