You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by rd...@apache.org on 2006/02/18 20:41:11 UTC

svn commit: r378764 - in /jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool: KeyedObjectPool.java ObjectPool.java

Author: rdonkin
Date: Sat Feb 18 11:41:10 2006
New Revision: 378764

URL: http://svn.apache.org/viewcvs?rev=378764&view=rev
Log:
Updates to javadoc contracts for 2.0. Contributed by Sandy McArthur. Issue#38667.

Modified:
    jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedObjectPool.java
    jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/ObjectPool.java

Modified: jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedObjectPool.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedObjectPool.java?rev=378764&r1=378763&r2=378764&view=diff
==============================================================================
--- jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedObjectPool.java (original)
+++ jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedObjectPool.java Sat Feb 18 11:41:10 2006
@@ -77,10 +77,11 @@
      *
      * @param key the key used to obtain the object
      * @return an instance from this pool.
+     * @throws IllegalStateException after {@link #close} has been called on this pool.
      * @throws Exception when {@link KeyedPoolableObjectFactory#makeObject} throws an exception.
      * @throws NoSuchElementException when the pool is exhaused and cannot or will not return another instance.
      */
-    Object borrowObject(Object key) throws Exception, NoSuchElementException;
+    Object borrowObject(Object key) throws Exception, NoSuchElementException, IllegalStateException;
 
     /**
      * Return an instance to my pool.
@@ -120,8 +121,11 @@
      * implementation dependent mechanism, and place it into the pool.
      * addObject() is useful for "pre-loading" a pool with idle objects.
      * (Optional operation).
+     *
+     * @throws Exception when {@link KeyedPoolableObjectFactory#makeObject} fails.
+     * @throws IllegalStateException after {@link #close} has been called on this pool.
      */
-    void addObject(Object key) throws Exception;
+    void addObject(Object key) throws Exception, IllegalStateException;
 
     /**
      * Returns the number of instances
@@ -195,6 +199,12 @@
 
     /**
      * Close this pool, and free any resources associated with it.
+     * <p>
+     * Calling {@link #addObject} or {@link #borrowObject} after invoking
+     * this method on a pool will cause them to throw an
+     * {@link IllegalStateException}.
+     *
+     * @throws Exception <strong>deprecated</strong>: implementations should silently fail if not all reasources can be freed.
      */
     void close() throws Exception;
 

Modified: jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/ObjectPool.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/ObjectPool.java?rev=378764&r1=378763&r2=378764&view=diff
==============================================================================
--- jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/ObjectPool.java (original)
+++ jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/ObjectPool.java Sat Feb 18 11:41:10 2006
@@ -64,10 +64,11 @@
      * newer versions are encouraged to throw a {@link NoSuchElementException}.
      *
      * @return an instance from this pool.
+     * @throws IllegalStateException after {@link #close} has been called on this pool.
      * @throws Exception when {@link PoolableObjectFactory#makeObject} throws an exception.
      * @throws NoSuchElementException when the pool is exhaused and cannot or will not return another instance.
      */
-    Object borrowObject() throws Exception, NoSuchElementException;
+    Object borrowObject() throws Exception, NoSuchElementException, IllegalStateException;
 
     /**
      * Return an instance to my pool.
@@ -102,12 +103,15 @@
      * implementation dependent mechanism, and place it into the pool.
      * addObject() is useful for "pre-loading" a pool with idle objects.
      * (Optional operation).
+     *
+     * @throws Exception when {@link PoolableObjectFactory#makeObject} fails.
+     * @throws IllegalStateException after {@link #close} has been called on this pool.
      */
-    void addObject() throws Exception;
+    void addObject() throws Exception, IllegalStateException;
 
     /**
      * Return the number of instances
-     * currently idle in my pool (optional operation).  
+     * currently idle in my pool (optional operation).
      * This may be considered an approximation of the number
      * of objects that can be {@link #borrowObject borrowed}
      * without creating any new instances.
@@ -139,6 +143,12 @@
 
     /**
      * Close this pool, and free any resources associated with it.
+     * <p>
+     * Calling {@link #addObject} or {@link #borrowObject} after invoking
+     * this method on a pool will cause them to throw an
+     * {@link IllegalStateException}.
+     *
+     * @throws Exception <strong>deprecated</strong>: implementations should silently fail if not all reasources can be freed.
      */
     void close() throws Exception;
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org