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 [EMAIL PROTECTED] #close} has been
called on this pool.
* @throws Exception when [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
KeyedPoolableObjectFactory#makeObject} fails.
+ * @throws IllegalStateException after [EMAIL PROTECTED] #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 [EMAIL PROTECTED] #addObject} or [EMAIL PROTECTED]
#borrowObject} after invoking
+ * this method on a pool will cause them to throw an
+ * [EMAIL PROTECTED] 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 [EMAIL PROTECTED]
NoSuchElementException}.
*
* @return an instance from this pool.
+ * @throws IllegalStateException after [EMAIL PROTECTED] #close} has been
called on this pool.
* @throws Exception when [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
PoolableObjectFactory#makeObject} fails.
+ * @throws IllegalStateException after [EMAIL PROTECTED] #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 [EMAIL PROTECTED] #borrowObject borrowed}
* without creating any new instances.
@@ -139,6 +143,12 @@
/**
* Close this pool, and free any resources associated with it.
+ * <p>
+ * Calling [EMAIL PROTECTED] #addObject} or [EMAIL PROTECTED]
#borrowObject} after invoking
+ * this method on a pool will cause them to throw an
+ * [EMAIL PROTECTED] 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]