Save This Page
Home » jdo2-util-2.3-ea-src » org.apache.jdo.util » [javadoc | source]
org.apache.jdo.util
public class: Pool [javadoc | source]
java.lang.Object
   org.apache.jdo.util.Pool
A general purpose pooling class.
Field Summary
static final  Log test     
Constructor:
 public Pool(int size) 
Method from org.apache.jdo.util.Pool Summary:
get,   put
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.jdo.util.Pool Detail:
 public synchronized Object get() throws InterruptedException 
    Gets an object from the pool, if one is available. If an object is not available, waits until one is. The waiting is governed by two variables, which are currently fixed: waitMillis and waitNumber. If no object is available from the pool within (waitNumber) times (waitMillis) milliseconds, then a RuntimeException is thrown. In future, the waitMillis and waitNumber should be configurable.
 public synchronized  void put(Object o) throws InterruptedException 
    Puts the given object into the pool, if there the pool has fewer than the number of elements specifed when created. If the pool is full, blocks until an element is removed.