org.priha.util
Class Pool

java.lang.Object
  extended by org.priha.util.Pool

public class Pool
extends java.lang.Object

Simple object pool.


Nested Class Summary
static class Pool.Poolable
           
static interface Pool.PoolableFactory
           
static class Pool.PoolExhaustedException
           
 
Constructor Summary
Pool(Pool.PoolableFactory factory)
           
 
Method Summary
 void dispose()
          Disposes all returned objects from the pool.
 Pool.Poolable get(int milliseconds)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pool

public Pool(Pool.PoolableFactory factory)
Method Detail

size

public int size()

get

public Pool.Poolable get(int milliseconds)
                  throws java.lang.InterruptedException,
                         Pool.PoolExhaustedException
Throws:
java.lang.InterruptedException
Pool.PoolExhaustedException

dispose

public void dispose()
Disposes all returned objects from the pool.