Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.ibatis.common.util
Class Throttle  view Throttle download Throttle.java

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


Field Summary
private  int count
           
private  int limit
           
private  java.lang.Object LOCK
           
private  long maxWait
           
 
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
 

Field Detail

LOCK

private final java.lang.Object LOCK

count

private int count

limit

private int limit

maxWait

private long maxWait
Constructor Detail

Throttle

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


Throttle

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

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