You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ps...@apache.org on 2009/05/21 13:12:59 UTC
svn commit: r777065 [1/2] - in
/commons/proper/pool/trunk/src/java/org/apache/commons/pool: ./ impl/
Author: psteitz
Date: Thu May 21 11:12:58 2009
New Revision: 777065
URL: http://svn.apache.org/viewvc?rev=777065&view=rev
Log:
Removed tabs and trailing spaces. No code change.
Modified:
commons/proper/pool/trunk/src/java/org/apache/commons/pool/BaseKeyedObjectPool.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/BaseKeyedPoolableObjectFactory.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/BaseObjectPool.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/BasePoolableObjectFactory.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedObjectPool.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedObjectPoolFactory.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedPoolableObjectFactory.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/ObjectPool.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/ObjectPoolFactory.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/PoolUtils.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/PoolableObjectFactory.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/CursorableLinkedList.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/EvictionTimer.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPoolFactory.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPoolFactory.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/SoftReferenceObjectPool.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPoolFactory.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackObjectPool.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackObjectPoolFactory.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/package.html
commons/proper/pool/trunk/src/java/org/apache/commons/pool/overview.html
commons/proper/pool/trunk/src/java/org/apache/commons/pool/package.html
Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/BaseKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/BaseKeyedObjectPool.java?rev=777065&r1=777064&r2=777065&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/BaseKeyedObjectPool.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/BaseKeyedObjectPool.java Thu May 21 11:12:58 2009
@@ -4,10 +4,10 @@
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
+ * the License. You may obtain a copy of the License a
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/BaseKeyedPoolableObjectFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/BaseKeyedPoolableObjectFactory.java?rev=777065&r1=777064&r2=777065&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/BaseKeyedPoolableObjectFactory.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/BaseKeyedPoolableObjectFactory.java Thu May 21 11:12:58 2009
@@ -4,10 +4,10 @@
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
+ * the License. You may obtain a copy of the License a
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -51,7 +51,7 @@
}
/** No-op. */
- public void passivateObject(Object key, Object obj)
+ public void passivateObject(Object key, Object obj)
throws Exception {
}
}
Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/BaseObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/BaseObjectPool.java?rev=777065&r1=777064&r2=777065&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/BaseObjectPool.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/BaseObjectPool.java Thu May 21 11:12:58 2009
@@ -4,10 +4,10 @@
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
+ * the License. You may obtain a copy of the License a
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -99,6 +99,6 @@
throw new IllegalStateException("Pool not open");
}
}
-
+
private volatile boolean closed = false;
}
Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/BasePoolableObjectFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/BasePoolableObjectFactory.java?rev=777065&r1=777064&r2=777065&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/BasePoolableObjectFactory.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/BasePoolableObjectFactory.java Thu May 21 11:12:58 2009
@@ -4,10 +4,10 @@
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
+ * the License. You may obtain a copy of the License a
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -52,7 +52,7 @@
}
/** No-op. */
- public void passivateObject(Object obj)
+ public void passivateObject(Object obj)
throws Exception {
}
}
Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedObjectPool.java?rev=777065&r1=777064&r2=777065&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedObjectPool.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedObjectPool.java Thu May 21 11:12:58 2009
@@ -4,10 +4,10 @@
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
+ * the License. You may obtain a copy of the License a
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -47,7 +47,7 @@
* }</pre>
* </p>
* <p>
- * {@link KeyedObjectPool} implementations <i>may</i> choose to store at most
+ * {@link KeyedObjectPool} implementations <i>may</i> choose to store at mos
* one instance per key value, or may choose to maintain a pool of instances
* for each key (essentially creating a {@link java.util.Map Map} of
* {@link ObjectPool pools}).
@@ -84,7 +84,7 @@
* Older versions of this method would return <code>null</code> to indicate exhaustion,
* newer versions are encouraged to throw a {@link NoSuchElementException}.
*
- * @param key the key used to obtain the object
+ * @param key the key used to obtain the objec
* @return an instance from this pool.
* @throws IllegalStateException after {@link #close close} has been called on this pool
* @throws Exception when {@link KeyedPoolableObjectFactory#makeObject makeObject} throws an exception
@@ -97,11 +97,11 @@
* By contract, <code>obj</code> <strong>must</strong> have been obtained
* using {@link #borrowObject borrowObject}
* or a related method as defined in an implementation
- * or sub-interface
+ * or sub-interface
* using a <code>key</code> that is equivalent to the one used to
* borrow the instance in the first place.
*
- * @param key the key used to obtain the object
+ * @param key the key used to obtain the objec
* @param obj a {@link #borrowObject borrowed} instance to be returned.
* @throws Exception <b>deprecated</b>: as of Pool 2.0 pool implementations should swallow
* exceptions that occur when a poolable object is returned. For future source compatability
@@ -114,7 +114,7 @@
* By contract, <code>obj</code> <strong>must</strong> have been obtained
* using {@link #borrowObject borrowObject}
* or a related method as defined in an implementation
- * or sub-interface
+ * or sub-interface
* using a <code>key</code> that is equivalent to the one used to
* borrow the <code>Object</code> in the first place.
* <p>
@@ -122,7 +122,7 @@
* is determined (due to an exception or other problem) to be invalid.
* </p>
*
- * @param key the key used to obtain the object
+ * @param key the key used to obtain the objec
* @param obj a {@link #borrowObject borrowed} instance to be returned.
* @throws Exception <b>deprecated</b>: as of Pool 2.0 pool implementations should swallow
* exceptions that occur when a poolable object is returned. For future source compatability
@@ -180,7 +180,7 @@
/**
* Returns the total number of instances
- * current borrowed from this pool but not
+ * current borrowed from this pool but no
* yet returned (optional operation).
* Returns a negative value if this information is not available.
*
Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedObjectPoolFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedObjectPoolFactory.java?rev=777065&r1=777064&r2=777065&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedObjectPoolFactory.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedObjectPoolFactory.java Thu May 21 11:12:58 2009
@@ -4,10 +4,10 @@
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
+ * the License. You may obtain a copy of the License a
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedPoolableObjectFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedPoolableObjectFactory.java?rev=777065&r1=777064&r2=777065&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedPoolableObjectFactory.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/KeyedPoolableObjectFactory.java Thu May 21 11:12:58 2009
@@ -4,10 +4,10 @@
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
+ * the License. You may obtain a copy of the License a
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -59,13 +59,13 @@
* </p>
* <p>
* {@link KeyedPoolableObjectFactory} must be thread-safe. The only promise
- * an {@link KeyedObjectPool} makes is that the same instance of an object will not
+ * an {@link KeyedObjectPool} makes is that the same instance of an object will no
* be passed to more than one method of a <code>KeyedPoolableObjectFactory</code>
* at a time.
* </p>
*
* @see KeyedObjectPool
- *
+ *
* @author Rodney Waldhoff
* @author Sandy McArthur
* @version $Revision$ $Date$
@@ -79,7 +79,7 @@
* {@link #activateObject activated}. They will not be
* activated before being served by the pool.
*
- * @param key the key used when constructing the object
+ * @param key the key used when constructing the objec
* @return an instance that can be served by the pool.
* @throws Exception if there is a problem creating a new instance,
* this will be propagated to the code requesting an object.
@@ -95,7 +95,7 @@
* unexpected errors.
* </p>
* <p>
- * Also, an implementation must take in to consideration that
+ * Also, an implementation must take in to consideration tha
* instances lost to the garbage collector may never be destroyed.
* </p>
*
@@ -103,8 +103,8 @@
* @param obj the instance to be destroyed
* @throws Exception should be avoided as it may be swallowed by
* the pool implementation.
- * @see #validateObject
- * @see KeyedObjectPool#invalidateObject
+ * @see #validateObjec
+ * @see KeyedObjectPool#invalidateObjec
*/
void destroyObject(Object key, Object obj) throws Exception;
@@ -112,7 +112,7 @@
* Ensures that the instance is safe to be returned by the pool.
* Returns <code>false</code> if <code>obj</code> should be destroyed.
*
- * @param key the key used when selecting the object
+ * @param key the key used when selecting the objec
* @param obj the instance to be validated
* @return <code>false</code> if <code>obj</code> is not valid and should
* be dropped from the pool, <code>true</code> otherwise.
@@ -122,22 +122,22 @@
/**
* Reinitialize an instance to be returned by the pool.
*
- * @param key the key used when selecting the object
+ * @param key the key used when selecting the objec
* @param obj the instance to be activated
* @throws Exception if there is a problem activating <code>obj</code>,
* this exception may be swallowed by the pool.
- * @see #destroyObject
+ * @see #destroyObjec
*/
void activateObject(Object key, Object obj) throws Exception;
/**
* Uninitialize an instance to be returned to the idle object pool.
*
- * @param key the key used when selecting the object
+ * @param key the key used when selecting the objec
* @param obj the instance to be passivated
* @throws Exception if there is a problem passivating <code>obj</code>,
* this exception may be swallowed by the pool.
- * @see #destroyObject
+ * @see #destroyObjec
*/
void passivateObject(Object key, Object obj) throws Exception;
}
Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/ObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/ObjectPool.java?rev=777065&r1=777064&r2=777065&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/ObjectPool.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/ObjectPool.java Thu May 21 11:12:58 2009
@@ -4,10 +4,10 @@
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
+ * the License. You may obtain a copy of the License a
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,7 +22,7 @@
/**
* A pooling interface.
* <p>
- * <code>ObjectPool</code> defines a trivially simple pooling interface. The only
+ * <code>ObjectPool</code> defines a trivially simple pooling interface. The only
* required methods are {@link #borrowObject borrowObject}, {@link #returnObject returnObject}
* and {@link #invalidateObject invalidateObject}.
* </p>
Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/ObjectPoolFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/ObjectPoolFactory.java?rev=777065&r1=777064&r2=777065&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/ObjectPoolFactory.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/ObjectPoolFactory.java Thu May 21 11:12:58 2009
@@ -4,10 +4,10 @@
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
+ * the License. You may obtain a copy of the License a
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -19,7 +19,7 @@
/**
* A factory interface for creating {@link ObjectPool}s.
- *
+ *
* @see ObjectPool
*
* @author Rodney Waldhoff
Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/PoolUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/PoolUtils.java?rev=777065&r1=777064&r2=777065&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/PoolUtils.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/PoolUtils.java Thu May 21 11:12:58 2009
@@ -4,7 +4,7 @@
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * the License. You may obtain a copy of the License a
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -183,7 +183,7 @@
* {@link Timer#schedule(TimerTask, long, long)}.
* @return the {@link TimerTask} that will periodically check the pools idle object count.
* @throws IllegalArgumentException when <code>pool</code> is <code>null</code> or
- * when <code>minIdle</code> is negative or when <code>period</code> isn't
+ * when <code>minIdle</code> is negative or when <code>period</code> isn'
* valid for {@link Timer#schedule(TimerTask, long, long)}.
* @since Pool 1.3
*/
@@ -211,7 +211,7 @@
* {@link Timer#schedule(TimerTask, long, long)}.
* @return the {@link TimerTask} that will periodically check the pools idle object count.
* @throws IllegalArgumentException when <code>keyedPool</code>, <code>key</code> is <code>null</code> or
- * when <code>minIdle</code> is negative or when <code>period</code> isn't
+ * when <code>minIdle</code> is negative or when <code>period</code> isn'
* valid for {@link Timer#schedule(TimerTask, long, long)}.
* @since Pool 1.3
*/
@@ -241,7 +241,7 @@
* {@link Timer#schedule(TimerTask, long, long)}.
* @return a {@link Map} of key and {@link TimerTask} pairs that will periodically check the pools idle object count.
* @throws IllegalArgumentException when <code>keyedPool</code>, <code>keys</code>, or any of the values in the
- * collection is <code>null</code> or when <code>minIdle</code> is negative or when <code>period</code> isn't
+ * collection is <code>null</code> or when <code>minIdle</code> is negative or when <code>period</code> isn'
* valid for {@link Timer#schedule(TimerTask, long, long)}.
* @see #checkMinIdle(KeyedObjectPool, Object, int, long)
* @since Pool 1.3
@@ -330,7 +330,7 @@
*
* <p><b>Note:</b>
* This should not be used on pool implementations that already provide proper synchronization
- * such as the pools provided in the Commons Pool library. Wrapping a pool that
+ * such as the pools provided in the Commons Pool library. Wrapping a pool tha
* {@link #wait() waits} for poolable objects to be returned before allowing another one to be
* borrowed with another layer of synchronization will cause liveliness issues or a deadlock.
* </p>
@@ -361,7 +361,7 @@
*
* <p><b>Note:</b>
* This should not be used on pool implementations that already provide proper synchronization
- * such as the pools provided in the Commons Pool library. Wrapping a pool that
+ * such as the pools provided in the Commons Pool library. Wrapping a pool tha
* {@link #wait() waits} for poolable objects to be returned before allowing another one to be
* borrowed with another layer of synchronization will cause liveliness issues or a deadlock.
* </p>
@@ -1386,7 +1386,7 @@
'}';
}
}
-
+
private static class ErodingObjectPool implements ObjectPool {
private final ObjectPool pool;
private final ErodingFactor factor;
@@ -1478,7 +1478,7 @@
protected ErodingKeyedObjectPool(final KeyedObjectPool keyedPool, final ErodingFactor erodingFactor) {
if (keyedPool == null) {
- throw new IllegalArgumentException("keyedPool must not be null.");
+ throw new IllegalArgumentException("keyedPool must not be null.");
}
this.keyedPool = keyedPool;
this.erodingFactor = erodingFactor;
@@ -1612,4 +1612,4 @@
'}';
}
}
-}
\ No newline at end of file
+}
Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/PoolableObjectFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/PoolableObjectFactory.java?rev=777065&r1=777064&r2=777065&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/PoolableObjectFactory.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/PoolableObjectFactory.java Thu May 21 11:12:58 2009
@@ -4,10 +4,10 @@
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
+ * the License. You may obtain a copy of the License a
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -59,7 +59,7 @@
* </p>
* <p>
* {@link PoolableObjectFactory} must be thread-safe. The only promise
- * an {@link ObjectPool} makes is that the same instance of an object will not
+ * an {@link ObjectPool} makes is that the same instance of an object will no
* be passed to more than one method of a <code>PoolableObjectFactory</code>
* at a time.
* </p>
@@ -94,15 +94,15 @@
* unexpected errors.
* </p>
* <p>
- * Also, an implementation must take in to consideration that
+ * Also, an implementation must take in to consideration tha
* instances lost to the garbage collector may never be destroyed.
* </p>
*
* @param obj the instance to be destroyed
* @throws Exception should be avoided as it may be swallowed by
* the pool implementation.
- * @see #validateObject
- * @see ObjectPool#invalidateObject
+ * @see #validateObjec
+ * @see ObjectPool#invalidateObjec
*/
void destroyObject(Object obj) throws Exception;
@@ -122,7 +122,7 @@
* @param obj the instance to be activated
* @throws Exception if there is a problem activating <code>obj</code>,
* this exception may be swallowed by the pool.
- * @see #destroyObject
+ * @see #destroyObjec
*/
void activateObject(Object obj) throws Exception;
@@ -132,7 +132,7 @@
* @param obj the instance to be passivated
* @throws Exception if there is a problem passivating <code>obj</code>,
* this exception may be swallowed by the pool.
- * @see #destroyObject
+ * @see #destroyObjec
*/
void passivateObject(Object obj) throws Exception;
}
Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/CursorableLinkedList.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/CursorableLinkedList.java?rev=777065&r1=777064&r2=777065&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/CursorableLinkedList.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/CursorableLinkedList.java Thu May 21 11:12:58 2009
@@ -4,7 +4,7 @@
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * the License. You may obtain a copy of the License a
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -37,10 +37,10 @@
* to prevent its inclusion in the pool public API. The class declaration below
* should *not* be changed to public.
* </p>
- *
+ *
* A doubly-linked list implementation of the {@link List} interface,
* supporting a {@link ListIterator} that allows concurrent modifications
- * to the underlying list.
+ * to the underlying list.
* <p>
*
* Implements all of the optional {@link List} operations, the
@@ -50,16 +50,16 @@
* <p>
* <b>Note that this implementation is not synchronized.</b>
*
- * @see java.util.LinkedList
- *
+ * @see java.util.LinkedLis
+ *
* @version $Revision: 480452 $ $Date: 2006-11-29 00:45:14 -0700 (Wed, 29 Nov 2006) $
- *
+ *
* @author Rodney Waldhoff
* @author Janek Bogucki
* @author Simon Kitching
*/
class CursorableLinkedList implements List, Serializable {
- /** Ensure serialization compatibility */
+ /** Ensure serialization compatibility */
private static final long serialVersionUID = 8836393098519411393L;
//--- public methods ---------------------------------------------
@@ -77,18 +77,18 @@
/**
* Inserts the specified element at the specified position in this list.
- * Shifts the element currently at that position (if any) and any subsequent
+ * Shifts the element currently at that position (if any) and any subsequen
* elements to the right (adds one to their indices).
*
* @param index index at which the specified element is to be inserted.
* @param element element to be inserted.
*
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this list.
+ * @throws ClassCastException if the class of the specified elemen
+ * prevents it from being added to this list.
* @throws IllegalArgumentException if some aspect of the specified
- * element prevents it from being added to this list.
+ * element prevents it from being added to this list.
* @throws IndexOutOfBoundsException if the index is out of range
- * (index < 0 || index > size()).
+ * (index < 0 || index > size()).
*/
public void add(int index, Object element) {
if(index == _size) {
@@ -115,7 +115,7 @@
* @return <tt>true</tt> if this list changed as a result of the call.
*
* @throws ClassCastException if the class of an element in the specified
- * collection prevents it from being added to this list.
+ * collection prevents it from being added to this list.
* @throws IllegalArgumentException if some aspect of an element in the
* specified collection prevents it from being added to this
* list.
@@ -133,8 +133,8 @@
/**
* Inserts all of the elements in the specified collection into this
- * list at the specified position. Shifts the element currently at
- * that position (if any) and any subsequent elements to the right
+ * list at the specified position. Shifts the element currently a
+ * that position (if any) and any subsequent elements to the righ
* (increases their indices). The new elements will appear in this
* list in the order that they are returned by the specified
* {@link Collection}'s {@link Iterator}. The behavior of this operation is
@@ -143,18 +143,18 @@
* collection is this list, and it's nonempty.)
*
* @param index index at which to insert first element from the specified
- * collection.
+ * collection.
* @param c elements to be inserted into this list.
* @return <tt>true</tt> if this list changed as a result of the call.
*
* @throws ClassCastException if the class of one of elements of the
- * specified collection prevents it from being added to this
- * list.
+ * specified collection prevents it from being added to this
+ * list.
* @throws IllegalArgumentException if some aspect of one of elements of
* the specified collection prevents it from being added to
* this list.
* @throws IndexOutOfBoundsException if the index is out of range (index
- * < 0 || index > size()).
+ * < 0 || index > size()).
*/
public boolean addAll(int index, Collection c) {
if(c.isEmpty()) {
@@ -220,7 +220,7 @@
/**
* Returns <tt>true</tt> if this list contains the specified element.
* More formally, returns <tt>true</tt> if and only if this list contains
- * at least one element <tt>e</tt> such that
+ * at least one element <tt>e</tt> such tha
* <tt>(o==null ? e==null : o.equals(e))</tt>.
*
* @param o element whose presence in this list is to be tested.
@@ -228,7 +228,7 @@
*/
public boolean contains(Object o) {
for(Listable elt = _head.next(), past = null; null != elt && past != _head.prev(); elt = (past = elt).next()) {
- if((null == o && null == elt.value()) ||
+ if((null == o && null == elt.value()) ||
(o != null && o.equals(elt.value()))) {
return true;
}
@@ -271,8 +271,8 @@
* {@link ListIterator#nextIndex} and {@link ListIterator#previousIndex}
* methods (they throw {@link UnsupportedOperationException} when invoked.
* <p>
- * Historical Note: In previous versions of this class, the object
- * returned from this method was required to be explicitly closed. This
+ * Historical Note: In previous versions of this class, the objec
+ * returned from this method was required to be explicitly closed. This
* is no longer necessary.
*
* @see #cursor(int)
@@ -285,8 +285,8 @@
/**
* Returns a {@link ListIterator} for iterating through the
- * elements of this list, initialized such that
- * {@link ListIterator#next} will return the element at
+ * elements of this list, initialized such tha
+ * {@link ListIterator#next} will return the element a
* the specified index (if any) and {@link ListIterator#previous}
* will return the element immediately preceding it (if any).
* Unlike {@link #iterator}, a cursor
@@ -297,7 +297,7 @@
* @see #listIterator(int)
* @see CursorableLinkedList.Cursor
* @throws IndexOutOfBoundsException if the index is out of range (index
- * < 0 || index > size()).
+ * < 0 || index > size()).
*/
public CursorableLinkedList.Cursor cursor(int i) {
return new Cursor(i);
@@ -339,7 +339,7 @@
* @return the element at the specified position in this list.
*
* @throws IndexOutOfBoundsException if the index is out of range (index
- * < 0 || index >= size()).
+ * < 0 || index >= size()).
*/
public Object get(int index) {
return getListableAt(index).value();
@@ -368,7 +368,7 @@
}
/**
- * Returns the hash code value for this list. The hash code of a list
+ * Returns the hash code value for this list. The hash code of a lis
* is defined to be the result of the following calculation:
* <pre>
* hashCode = 1;
@@ -378,7 +378,7 @@
* hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode());
* }
* </pre>
- * This ensures that <tt>list1.equals(list2)</tt> implies that
+ * This ensures that <tt>list1.equals(list2)</tt> implies tha
* <tt>list1.hashCode()==list2.hashCode()</tt> for any two lists,
* <tt>list1</tt> and <tt>list2</tt>, as required by the general
* contract of <tt>Object.hashCode</tt>.
@@ -399,7 +399,7 @@
/**
* Returns the index in this list of the first occurrence of the specified
* element, or -1 if this list does not contain this element.
- * More formally, returns the lowest index <tt>i</tt> such that
+ * More formally, returns the lowest index <tt>i</tt> such tha
* <tt>(o==null ? get(i)==null : o.equals(get(i)))</tt>,
* or -1 if there is no such index.
*
@@ -450,13 +450,13 @@
/**
* Returns the index in this list of the last occurrence of the specified
* element, or -1 if this list does not contain this element.
- * More formally, returns the highest index <tt>i</tt> such that
+ * More formally, returns the highest index <tt>i</tt> such tha
* <tt>(o==null ? get(i)==null : o.equals(get(i)))</tt>,
* or -1 if there is no such index.
*
* @param o element to search for.
* @return the index in this list of the last occurrence of the specified
- * element, or -1 if this list does not contain this element.
+ * element, or -1 if this list does not contain this element.
*/
public int lastIndexOf(Object o) {
int ndx = _size-1;
@@ -622,12 +622,12 @@
* @param element element to be stored at the specified position.
* @return the element previously at the specified position.
*
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this list.
+ * @throws ClassCastException if the class of the specified elemen
+ * prevents it from being added to this list.
* @throws IllegalArgumentException if some aspect of the specified
- * element prevents it from being added to this list.
+ * element prevents it from being added to this list.
* @throws IndexOutOfBoundsException if the index is out of range
- * (index < 0 || index >= size()).
+ * (index < 0 || index >= size()).
*/
public Object set(int index, Object element) {
Listable elt = getListableAt(index);
@@ -684,7 +684,7 @@
a[i++] = elt.value();
}
if(a.length > _size) {
- a[_size] = null; // should we null out the rest of the array also? java.util.LinkedList doesn't
+ a[_size] = null; // should we null out the rest of the array also? java.util.LinkedList doesn'
}
return a;
}
@@ -725,9 +725,9 @@
/**
* Inserts a new <i>value</i> into my
* list, after the specified <i>before</i> element, and before the
- * specified <i>after</i> element
+ * specified <i>after</i> elemen
*
- * @return the newly created
+ * @return the newly created
* {@link org.apache.commons.collections.CursorableLinkedList.Listable}
*/
protected Listable insertListable(Listable before, Listable after, Object value) {
@@ -750,8 +750,8 @@
}
/**
- * Removes the given
- * {@link org.apache.commons.collections.CursorableLinkedList.Listable}
+ * Removes the given
+ * {@link org.apache.commons.collections.CursorableLinkedList.Listable}
* from my list.
*/
protected void removeListable(Listable elt) {
@@ -773,8 +773,8 @@
}
/**
- * Returns the
- * {@link org.apache.commons.collections.CursorableLinkedList.Listable}
+ * Returns the
+ * {@link org.apache.commons.collections.CursorableLinkedList.Listable}
* at the specified index.
*
* @throws IndexOutOfBoundsException if index is less than zero or
@@ -804,7 +804,7 @@
* of changes to this list.
*/
protected void registerCursor(Cursor cur) {
- // We take this opportunity to clean the _cursors list
+ // We take this opportunity to clean the _cursors lis
// of WeakReference objects to garbage-collected cursors.
for (Iterator it = _cursors.iterator(); it.hasNext(); ) {
WeakReference ref = (WeakReference) it.next();
@@ -812,7 +812,7 @@
it.remove();
}
}
-
+
_cursors.add( new WeakReference(cur) );
}
@@ -825,11 +825,11 @@
WeakReference ref = (WeakReference) it.next();
Cursor cursor = (Cursor) ref.get();
if (cursor == null) {
- // some other unrelated cursor object has been
+ // some other unrelated cursor object has been
// garbage-collected; let's take the opportunity to
// clean up the cursors list anyway..
it.remove();
-
+
} else if (cursor == cur) {
ref.clear();
it.remove();
@@ -867,7 +867,7 @@
WeakReference ref = (WeakReference) it.next();
Cursor cursor = (Cursor) ref.get();
if (cursor == null) {
- it.remove(); // clean up list
+ it.remove(); // clean up lis
} else {
cursor.listableChanged(elt);
}
@@ -884,7 +884,7 @@
WeakReference ref = (WeakReference) it.next();
Cursor cursor = (Cursor) ref.get();
if (cursor == null) {
- it.remove(); // clean up list
+ it.remove(); // clean up lis
} else {
cursor.listableRemoved(elt);
}
@@ -901,7 +901,7 @@
WeakReference ref = (WeakReference) it.next();
Cursor cursor = (Cursor) ref.get();
if (cursor == null) {
- it.remove(); // clean up list
+ it.remove(); // clean up lis
} else {
cursor.listableInserted(elt);
}
@@ -943,8 +943,8 @@
* <tt>_head.next().prev()</tt> and <tt>_head.prev().next()</tt> to be
* non-null, as when I am a sublist for some larger list.
* Use <tt>== _head.next()</tt> and <tt>== _head.prev()</tt> to determine
- * if a given
- * {@link org.apache.commons.collections.CursorableLinkedList.Listable}
+ * if a given
+ * {@link org.apache.commons.collections.CursorableLinkedList.Listable}
* is the first or last element in the list.
*/
protected transient Listable _head = new Listable(null,null,null);
@@ -1400,7 +1400,7 @@
/**
* Inserts a new <i>value</i> into my
* list, after the specified <i>before</i> element, and before the
- * specified <i>after</i> element
+ * specified <i>after</i> elemen
*
* @return the newly created {@link CursorableLinkedList.Listable}
*/
Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/EvictionTimer.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/EvictionTimer.java?rev=777065&r1=777064&r2=777065&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/EvictionTimer.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/EvictionTimer.java Thu May 21 11:12:58 2009
@@ -4,10 +4,10 @@
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
+ * the License. You may obtain a copy of the License a
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,16 +32,16 @@
* <p>
* This class has package scope to prevent its inclusion in the pool public API.
* The class declaration below should *not* be changed to public.
- * </p>
+ * </p>
*/
class EvictionTimer {
private static Timer _timer;
private static int _usageCount;
-
+
private EvictionTimer() {
// Hide the default constuctor
}
-
+
/**
* Add the specified eviction task to the timer. Tasks that are added with a
* call to this method *must* call {@link #cancel(TimerTask)} to cancel the
@@ -58,7 +58,7 @@
_usageCount++;
_timer.schedule(task, delay, period);
}
-
+
/**
* Remove the specified eviction task from the timer.
* @param task Task to be scheduled
Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java?rev=777065&r1=777064&r2=777065&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java Thu May 21 11:12:58 2009
@@ -4,10 +4,10 @@
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
+ * the License. You may obtain a copy of the License a
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -39,7 +39,7 @@
* When coupled with the appropriate {@link KeyedPoolableObjectFactory},
* <code>GenericKeyedObjectPool</code> provides robust pooling functionality for
* keyed objects. A <code>GenericKeyedObjectPool</code> can be viewed as a map
- * of pools, keyed on the (unique) key values provided to the
+ * of pools, keyed on the (unique) key values provided to the
* {@link #preparePool preparePool}, {@link #addObject addObject} or
* {@link #borrowObject borrowObject} methods. Each time a new key value is
* provided to one of these methods, a new pool is created under the given key
@@ -51,7 +51,7 @@
* <li>
* {@link #setMaxActive maxActive} controls the maximum number of objects
* (per key) that can allocated by the pool (checked out to client threads,
- * or idle in the pool) at one time. When non-positive, there is no limit
+ * or idle in the pool) at one time. When non-positive, there is no limi
* to the number of objects per key. When {@link #setMaxActive maxActive} is
* reached, the keyed pool is said to be exhausted. The default setting for
* this parameter is 8.
@@ -94,7 +94,7 @@
* is {@link #WHEN_EXHAUSTED_BLOCK}, {@link #borrowObject borrowObject} will block
* (invoke {@link Object#wait() wait} until a new or idle object is available.
* If a positive {@link #setMaxWait maxWait}
- * value is supplied, the {@link #borrowObject borrowObject} will block for at
+ * value is supplied, the {@link #borrowObject borrowObject} will block for a
* most that many milliseconds, after which a {@link NoSuchElementException}
* will be thrown. If {@link #setMaxWait maxWait} is non-positive,
* the {@link #borrowObject borrowObject} method will block indefinitely.
@@ -136,7 +136,7 @@
* {@link #setTimeBetweenEvictionRunsMillis timeBetweenEvictionRunsMillis}
* indicates how long the eviction thread should sleep before "runs" of examining
* idle objects. When non-positive, no eviction thread will be launched. The
- * default setting for this parameter is -1 (i.e., by default, idle object
+ * default setting for this parameter is -1 (i.e., by default, idle objec
* eviction is disabled).
* </li>
* <li>
@@ -144,7 +144,7 @@
* specifies the minimum amount of time that an object may sit idle in the
* pool before it is eligible for eviction due to idle time. When
* non-positive, no object will be dropped from the pool due to idle time
- * alone. This setting has no effect unless
+ * alone. This setting has no effect unless
* <code>timeBetweenEvictionRunsMillis > 0.</code> The default setting
* for this parameter is 30 minutes.
* </li>
@@ -153,16 +153,16 @@
* objects should be validated using the factory's
* {@link KeyedPoolableObjectFactory#validateObject validateObject} method
* during idle object eviction runs. Objects that fail to validate will be
- * dropped from the pool. This setting has no effect unless
+ * dropped from the pool. This setting has no effect unless
* <code>timeBetweenEvictionRunsMillis > 0.</code> The default setting
* for this parameter is <code>false.</code>
* </li>
* <li>
* {@link #setMinIdle minIdle} sets a target value for the minimum number of
* idle objects (per key) that should always be available. If this parameter
- * is set to a positive number and
- * <code>timeBetweenEvictionRunsMillis > 0,</code> each time the idle object
- * eviction thread runs, it will try to create enough idle instances so that
+ * is set to a positive number and
+ * <code>timeBetweenEvictionRunsMillis > 0,</code> each time the idle objec
+ * eviction thread runs, it will try to create enough idle instances so tha
* there will be <code>minIdle</code> idle instances available under each
* key. This parameter is also used by {@link #preparePool preparePool}
* if <code>true</code> is provided as that method's
@@ -173,19 +173,19 @@
* <p>
* The pools can be configured to behave as LIFO queues with respect to idle
* objects - always returning the most recently used object from the pool,
- * or as FIFO queues, where borrowObject always returns the oldest object
+ * or as FIFO queues, where borrowObject always returns the oldest objec
* in the idle object pool.
* <ul>
* <li>
* {@link #setLifo <i>Lifo</i>}
- * determines whether or not the pools return idle objects in
- * last-in-first-out order. The default setting for this parameter is
+ * determines whether or not the pools return idle objects in
+ * last-in-first-out order. The default setting for this parameter is
* <code>true.</code>
* </li>
* </ul>
* <p>
* GenericKeyedObjectPool is not usable without a {@link KeyedPoolableObjectFactory}. A
- * non-<code>null</code> factory must be provided either as a constructor argument
+ * non-<code>null</code> factory must be provided either as a constructor argumen
* or via a call to {@link #setFactory setFactory} before the pool is used.
* </p>
* <p>
@@ -223,8 +223,8 @@
* {@link #getMaxWait maximum wait time} has been reached.
* @see #WHEN_EXHAUSTED_FAIL
* @see #WHEN_EXHAUSTED_GROW
- * @see #setMaxWait
- * @see #getMaxWait
+ * @see #setMaxWai
+ * @see #getMaxWai
* @see #setWhenExhaustedAction
*/
public static final byte WHEN_EXHAUSTED_BLOCK = 1;
@@ -278,8 +278,8 @@
* an exception when the pool is exhausted and the
* {@link #getWhenExhaustedAction "when exhausted" action} is
* {@link #WHEN_EXHAUSTED_BLOCK}.
- * @see #getMaxWait
- * @see #setMaxWait
+ * @see #getMaxWai
+ * @see #setMaxWai
*/
public static final long DEFAULT_MAX_WAIT = -1L;
@@ -337,17 +337,17 @@
* @see #getMinIdle
*/
public static final int DEFAULT_MIN_IDLE = 0;
-
+
/**
* The default LIFO status. True means that borrowObject returns the
* most recently used ("last in") idle object in a pool (if there are
* idle instances available). False means that pools behave as FIFO
- * queues - objects are taken from idle object pools in the order that
+ * queues - objects are taken from idle object pools in the order tha
* they are returned.
* @see #setLifo
*/
public static final boolean DEFAULT_LIFO = true;
-
+
//--- constructors -----------------------------------------------
/**
@@ -472,7 +472,7 @@
public GenericKeyedObjectPool(KeyedPoolableObjectFactory factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, int maxTotal, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle) {
this(factory, maxActive, whenExhaustedAction, maxWait, maxIdle, maxTotal, GenericKeyedObjectPool.DEFAULT_MIN_IDLE, testOnBorrow, testOnReturn, timeBetweenEvictionRunsMillis, numTestsPerEvictionRun, minEvictableIdleTimeMillis, testWhileIdle);
}
-
+
/**
* Create a new <code>GenericKeyedObjectPool</code> using the specified values.
* @param factory the <code>KeyedPoolableObjectFactory</code> to use to create, validate, and destroy objects if not <code>null</code>
@@ -493,7 +493,7 @@
public GenericKeyedObjectPool(KeyedPoolableObjectFactory factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, int maxTotal, int minIdle, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle) {
this(factory, maxActive, whenExhaustedAction, maxWait, maxIdle, maxTotal, minIdle, testOnBorrow, testOnReturn, timeBetweenEvictionRunsMillis, numTestsPerEvictionRun, minEvictableIdleTimeMillis, testWhileIdle, DEFAULT_LIFO);
}
-
+
/**
* Create a new <code>GenericKeyedObjectPool</code> using the specified values.
* @param factory the <code>KeyedPoolableObjectFactory</code> to use to create, validate, and destroy objects if not <code>null</code>
@@ -509,7 +509,7 @@
* @param numTestsPerEvictionRun the number of idle objects to examine per run within the idle object eviction thread (if any) (see {@link #setNumTestsPerEvictionRun})
* @param minEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction (see {@link #setMinEvictableIdleTimeMillis})
* @param testWhileIdle whether or not to validate objects in the idle object eviction thread, if any (see {@link #setTestWhileIdle})
- * @param lifo whether or not the pools behave as LIFO (last in first out) queues (see {@link #setLifo})
+ * @param lifo whether or not the pools behave as LIFO (last in first out) queues (see {@link #setLifo})
* @since Pool 1.4
*/
public GenericKeyedObjectPool(KeyedPoolableObjectFactory factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, int maxTotal, int minIdle, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle, boolean lifo) {
@@ -550,7 +550,7 @@
* Returns the cap on the number of object instances allocated by the pool
* (checked out or idle), per key.
* A negative value indicates no limit.
- *
+ *
* @return the cap on the number of active instances per key.
* @see #setMaxActive
*/
@@ -562,7 +562,7 @@
* Sets the cap on the number of object instances managed by the pool per key.
* @param maxActive The cap on the number of object instances per key.
* Use a negative value for no limit.
- *
+ *
* @see #getMaxActive
*/
public synchronized void setMaxActive(int maxActive) {
@@ -587,7 +587,7 @@
* when at the limit with no idle instances available, an attempt is made to
* create room by clearing the oldest 15% of the elements from the keyed
* pools.
- *
+ *
* @param maxTotal The cap on the total number of instances across pools.
* Use a negative value for no limit.
* @see #getMaxTotal
@@ -602,7 +602,7 @@
* is invoked when the pool is exhausted (the maximum number
* of "active" objects has been reached).
*
- * @return one of {@link #WHEN_EXHAUSTED_BLOCK},
+ * @return one of {@link #WHEN_EXHAUSTED_BLOCK},
* {@link #WHEN_EXHAUSTED_FAIL} or {@link #WHEN_EXHAUSTED_GROW}
* @see #setWhenExhaustedAction
*/
@@ -645,7 +645,7 @@
* may block indefinitely.
*
* @return the maximum number of milliseconds borrowObject will block.
- * @see #setMaxWait
+ * @see #setMaxWai
* @see #setWhenExhaustedAction
* @see #WHEN_EXHAUSTED_BLOCK
*/
@@ -664,7 +664,7 @@
* may block indefinitely.
*
* @param maxWait the maximum number of milliseconds borrowObject will block or negative for indefinitely.
- * @see #getMaxWait
+ * @see #getMaxWai
* @see #setWhenExhaustedAction
* @see #WHEN_EXHAUSTED_BLOCK
*/
@@ -703,7 +703,7 @@
/**
* Sets the minimum number of idle objects to maintain in each of the keyed
- * pools. This setting has no effect unless
+ * pools. This setting has no effect unless
* <code>timeBetweenEvictionRunsMillis > 0</code> and attempts to ensure
* that each pool has the required minimum number of instances are only
* made during idle object eviction runs.
@@ -718,7 +718,7 @@
/**
* Returns the minimum number of idle objects to maintain in each of the keyed
- * pools. This setting has no effect unless
+ * pools. This setting has no effect unless
* <code>timeBetweenEvictionRunsMillis > 0</code> and attempts to ensure
* that each pool has the required minimum number of instances are only
* made during idle object eviction runs.
@@ -735,7 +735,7 @@
* {@link org.apache.commons.pool.PoolableObjectFactory#validateObject validated}
* before being returned by the {@link #borrowObject}
* method. If the object fails to validate,
- * it will be dropped from the pool, and we will attempt
+ * it will be dropped from the pool, and we will attemp
* to borrow another.
*
* @return <code>true</code> if objects are validated before being borrowed.
@@ -750,7 +750,7 @@
* {@link org.apache.commons.pool.PoolableObjectFactory#validateObject validated}
* before being returned by the {@link #borrowObject}
* method. If the object fails to validate,
- * it will be dropped from the pool, and we will attempt
+ * it will be dropped from the pool, and we will attemp
* to borrow another.
*
* @param testOnBorrow whether object should be validated before being returned by borrowObject.
@@ -872,7 +872,7 @@
/**
* When <code>true</code>, objects will be
* {@link org.apache.commons.pool.PoolableObjectFactory#validateObject validated}
- * by the idle object evictor (if any). If an object
+ * by the idle object evictor (if any). If an objec
* fails to validate, it will be dropped from the pool.
*
* @return <code>true</code> when objects are validated when borrowed.
@@ -886,7 +886,7 @@
/**
* When <code>true</code>, objects will be
* {@link org.apache.commons.pool.PoolableObjectFactory#validateObject validated}
- * by the idle object evictor (if any). If an object
+ * by the idle object evictor (if any). If an objec
* fails to validate, it will be dropped from the pool.
*
* @param testWhileIdle <code>true</code> so objects are validated when borrowed.
@@ -916,14 +916,14 @@
setMinEvictableIdleTimeMillis(conf.minEvictableIdleTimeMillis);
setTimeBetweenEvictionRunsMillis(conf.timeBetweenEvictionRunsMillis);
}
-
+
/**
* Whether or not the idle object pools act as LIFO queues. True means
- * that borrowObject returns the most recently used ("last in") idle object
- * in a pool (if there are idle instances available). False means that
- * the pools behave as FIFO queues - objects are taken from idle object
+ * that borrowObject returns the most recently used ("last in") idle objec
+ * in a pool (if there are idle instances available). False means tha
+ * the pools behave as FIFO queues - objects are taken from idle objec
* pools in the order that they are returned.
- *
+ *
* @return <code>true</code> if the pools are configured to act as LIFO queues
* @since 1.4
*/
@@ -935,9 +935,9 @@
* Sets the LIFO property of the pools. True means that borrowObject returns
* the most recently used ("last in") idle object in a pool (if there are
* idle instances available). False means that the pools behave as FIFO
- * queues - objects are taken from idle object pools in the order that
+ * queues - objects are taken from idle object pools in the order tha
* they are returned.
- *
+ *
* @param lifo the new value for the lifo property
* @since 1.4
*/
@@ -955,18 +955,18 @@
synchronized (this) {
// Get local copy of current config. Can't sync when used later as
// it can result in a deadlock. Has the added advantage that config
- // is consistent for entire method execution
+ // is consistent for entire method execution
whenExhaustedAction = _whenExhaustedAction;
maxWait = _maxWait;
-
- // Add this request to the queue
+
+ // Add this request to the queue
_allocationQueue.add(latch);
-
+
// Work the allocation queue, allocating idle instances and
// instance creation permits in request arrival order
allocate();
}
-
+
for(;;) {
synchronized (this) {
assertOpen();
@@ -994,7 +994,7 @@
latch.wait();
} else {
// this code may be executed again after a notify then continue cycle
- // so, need to calculate the amount of time to wait
+ // so, need to calculate the amount of time to wai
final long elapsed = (System.currentTimeMillis() - starttime);
final long waitTime = maxWait - elapsed;
if (waitTime > 0)
@@ -1036,7 +1036,7 @@
}
}
- // activate & validate the object
+ // activate & validate the objec
try {
_factory.activateObject(key, latch.getPair().value);
if (_testOnBorrow && !_factory.validateObject(key, latch.getPair().value)) {
@@ -1052,7 +1052,7 @@
try {
_factory.destroyObject(key, latch.getPair().value);
} catch (Throwable e2) {
- // cannot destroy broken object
+ // cannot destroy broken objec
}
synchronized (this) {
latch.getPool().decrementInternalProcessingCount();
@@ -1103,7 +1103,7 @@
// Next item in queue
continue;
}
-
+
// If there is a totalMaxActive and we are at the limit then
// we have to make room
if ((_maxTotal > 0)
@@ -1158,7 +1158,7 @@
public void clearOldest() {
// Map of objects to destroy my key
final Map toDestroy = new HashMap();
-
+
// build sorted map of idle objects
final Map map = new TreeMap();
synchronized (this) {
@@ -1166,7 +1166,7 @@
final Object key = keyiter.next();
final CursorableLinkedList list = ((ObjectQueue)_poolMap.get(key)).queue;
for (Iterator it = list.iterator(); it.hasNext();) {
- // each item into the map uses the objectimestamppair object
+ // each item into the map uses the objectimestamppair objec
// as the key. It then gets sorted based on the timstamp field
// each value in the map is the parent list it belongs in.
map.put(it.next(), key);
@@ -1176,7 +1176,7 @@
// Now iterate created map and kill the first 15% plus one to account for zero
Set setPairKeys = map.entrySet();
int itemsToRemove = ((int) (map.size() * 0.15)) + 1;
-
+
Iterator iter = setPairKeys.iterator();
while (iter.hasNext() && itemsToRemove > 0) {
Map.Entry entry = (Map.Entry) iter.next();
@@ -1185,7 +1185,7 @@
// key references is the key of the list it belongs to.
Object key = entry.getValue();
ObjectTimestampPair pairTimeStamp = (ObjectTimestampPair) entry.getKey();
- final CursorableLinkedList list =
+ final CursorableLinkedList list =
((ObjectQueue)(_poolMap.get(key))).queue;
list.remove(pairTimeStamp);
@@ -1217,7 +1217,7 @@
*/
public void clear(Object key) {
Map toDestroy = new HashMap();
-
+
final ObjectQueue pool;
synchronized (this) {
pool = (ObjectQueue)(_poolMap.remove(key));
@@ -1247,7 +1247,7 @@
_factory.destroyObject(
key,((ObjectTimestampPair)(it.next())).value);
} catch(Exception e) {
- // ignore error, keep destroying the rest
+ // ignore error, keep destroying the res
} finally {
synchronized(this) {
_totalInternalProcessing--;
@@ -1255,7 +1255,7 @@
}
}
}
-
+
}
}
@@ -1311,14 +1311,14 @@
// swallowed
}
// TODO: Correctness here depends on control in addObjectToPool.
- // These two methods should be refactored, removing the
+ // These two methods should be refactored, removing the
// "behavior flag",decrementNumActive, from addObjectToPool.
ObjectQueue pool = (ObjectQueue) (_poolMap.get(key));
if (pool != null) {
synchronized(this) {
pool.decrementActiveCount();
allocate();
- }
+ }
}
}
}
@@ -1337,13 +1337,13 @@
boolean shouldDestroy = !success;
ObjectQueue pool;
-
+
// Add instance to pool if there is room and it has passed validation
// (if testOnreturn is set)
synchronized (this) {
// grab the pool (list) of objects associated with the given key
pool = (ObjectQueue) (_poolMap.get(key));
- // if it doesn't exist, create it
+ // if it doesn't exist, create i
if(null == pool) {
pool = new ObjectQueue();
_poolMap.put(key, pool);
@@ -1360,7 +1360,7 @@
// borrowObject always takes the first element from the queue,
// so for LIFO, push on top, FIFO add to end
if (_lifo) {
- pool.queue.addFirst(new ObjectTimestampPair(obj));
+ pool.queue.addFirst(new ObjectTimestampPair(obj));
} else {
pool.queue.addLast(new ObjectTimestampPair(obj));
}
@@ -1373,7 +1373,7 @@
}
}
- // Destroy the instance if necessary
+ // Destroy the instance if necessary
if(shouldDestroy) {
try {
_factory.destroyObject(key, obj);
@@ -1510,12 +1510,12 @@
/**
* <p>Perform <code>numTests</code> idle object eviction tests, evicting
- * examined objects that meet the criteria for eviction. If
+ * examined objects that meet the criteria for eviction. If
* <code>testWhileIdle</code> is true, examined objects are validated
- * when visited (and removed if invalid); otherwise only objects that
+ * when visited (and removed if invalid); otherwise only objects tha
* have been idle for more than <code>minEvicableIdletimeMillis</code>
* are removed.</p>
- *
+ *
* <p>Successive activations of this method examine objects in keyed pools
* in sequence, cycling through the keys and examining objects in
* oldest-to-youngest order within the keyed pools.</p>
@@ -1526,21 +1526,21 @@
Object key = null;
boolean testWhileIdle;
long minEvictableIdleTimeMillis;
-
+
synchronized (this) {
// Get local copy of current config. Can't sync when used later as
// it can result in a deadlock. Has the added advantage that config
- // is consistent for entire method execution
+ // is consistent for entire method execution
testWhileIdle = _testWhileIdle;
minEvictableIdleTimeMillis = _minEvictableIdleTimeMillis;
-
+
// Initialize key to last key value
- if (_evictionKeyCursor != null &&
+ if (_evictionKeyCursor != null &&
_evictionKeyCursor._lastReturned != null) {
key = _evictionKeyCursor._lastReturned.value();
}
}
-
+
for (int i=0,m=getNumTests(); i<m; i++) {
final ObjectTimestampPair pair;
synchronized (this) {
@@ -1571,14 +1571,14 @@
}
}
}
- }
+ }
if (_evictionCursor == null) {
continue; // should never happen; do nothing
}
-
+
// If eviction cursor is exhausted, try to move
- // to the next key and reset
+ // to the next key and rese
if((_lifo && !_evictionCursor.hasPrevious()) ||
(!_lifo && !_evictionCursor.hasNext())) {
if (_evictionKeyCursor != null) {
@@ -1602,10 +1602,10 @@
continue; // reset failed, do nothing
}
- // if LIFO and the _evictionCursor has a previous object,
- // or FIFO and _evictionCursor has a next object, test it
- pair = _lifo ?
- (ObjectTimestampPair) _evictionCursor.previous() :
+ // if LIFO and the _evictionCursor has a previous object,
+ // or FIFO and _evictionCursor has a next object, test i
+ pair = _lifo ?
+ (ObjectTimestampPair) _evictionCursor.previous() :
(ObjectTimestampPair) _evictionCursor.next();
_evictionCursor.remove();
_totalIdle--;
@@ -1614,7 +1614,7 @@
boolean removeObject=false;
if((minEvictableIdleTimeMillis > 0) &&
- (System.currentTimeMillis() - pair.tstamp >
+ (System.currentTimeMillis() - pair.tstamp >
minEvictableIdleTimeMillis)) {
removeObject=true;
}
@@ -1638,7 +1638,7 @@
}
}
}
-
+
if(removeObject) {
try {
_factory.destroyObject(key, pair.value);
@@ -1653,12 +1653,12 @@
// drop that pool
if (_minIdle == 0) {
synchronized (this) {
- ObjectQueue objectQueue =
+ ObjectQueue objectQueue =
(ObjectQueue)_poolMap.get(key);
- if (objectQueue != null &&
+ if (objectQueue != null &&
objectQueue.queue.isEmpty()) {
_poolMap.remove(key);
- _poolList.remove(key);
+ _poolList.remove(key);
}
}
}
@@ -1669,7 +1669,7 @@
_evictionCursor.add(pair);
_totalIdle++;
if (_lifo) {
- // Skip over the element we just added back
+ // Skip over the element we just added back
_evictionCursor.previous();
}
}
@@ -1677,7 +1677,7 @@
}
}
}
-
+
/**
* Resets the eviction key cursor and closes any
* associated eviction object cursor
@@ -1690,25 +1690,25 @@
if (null != _evictionCursor) {
_evictionCursor.close();
_evictionCursor = null;
- }
+ }
}
-
+
/**
* Resets the eviction object cursor for the given key
- *
+ *
* @param key eviction key
*/
private void resetEvictionObjectCursor(Object key) {
if (_evictionCursor != null) {
_evictionCursor.close();
}
- if (_poolMap == null) {
+ if (_poolMap == null) {
return;
}
ObjectQueue pool = (ObjectQueue) (_poolMap.get(key));
if (pool != null) {
CursorableLinkedList queue = pool.queue;
- _evictionCursor = queue.cursor(_lifo ? queue.size() : 0);
+ _evictionCursor = queue.cursor(_lifo ? queue.size() : 0);
}
}
@@ -1728,7 +1728,7 @@
keysCopy = _poolMap.keySet().toArray();
}
- // Loop through all elements in _poolList
+ // Loop through all elements in _poolLis
// Find out the total number of max active and max idle for that class
// If the number is less than the minIdle, do creation loop to boost numbers
for (int i=0; i < keysCopy.length; i++) {
@@ -1765,7 +1765,7 @@
// to stop when another thread already returned the
// needed objects
int objectDeficit = calculateDefecit(pool, false);
-
+
for (int i = 0; i < objectDeficit && calculateDefecit(pool, true) > 0; i++) {
try {
addObject(key);
@@ -1782,7 +1782,7 @@
/**
* Start the eviction thread or service, or when
- * <code>delay</code> is non-positive, stop it
+ * <code>delay</code> is non-positive, stop i
* if it is already running.
*
* @param delay milliseconds between evictor runs.
@@ -1845,7 +1845,7 @@
objectDefecit = Math.min(objectDefecit, growLimit);
}
- // Take the maxTotal limit into account
+ // Take the maxTotal limit into accoun
if (getMaxTotal() > 0) {
int growLimit = Math.max(0, getMaxTotal() - getNumActive() - getNumIdle() - _totalInternalProcessing);
objectDefecit = Math.min(objectDefecit, growLimit);
@@ -1897,7 +1897,7 @@
internalProcessingCount--;
}
}
-
+
/**
* A simple "struct" encapsulating an object instance and a timestamp.
*
@@ -1988,7 +1988,7 @@
*/
public int minIdle = GenericKeyedObjectPool.DEFAULT_MIN_IDLE;
/**
- * @see GenericKeyedObjectPool#setMaxWait
+ * @see GenericKeyedObjectPool#setMaxWai
*/
public long maxWait = GenericKeyedObjectPool.DEFAULT_MAX_WAIT;
/**
@@ -2043,21 +2043,21 @@
private synchronized Object getkey() {
return _key;
}
-
+
private synchronized ObjectQueue getPool() {
return _pool;
}
private synchronized void setPool(ObjectQueue pool) {
_pool = pool;
}
-
+
private synchronized ObjectTimestampPair getPair() {
return _pair;
}
private synchronized void setPair(ObjectTimestampPair pair) {
_pair = pair;
}
-
+
private synchronized boolean mayCreate() {
return _mayCreate;
}
@@ -2067,7 +2067,7 @@
/**
* Reset the latch data. Used when an allocation fails and the latch
- * needs to be re-added to the queue.
+ * needs to be re-added to the queue.
*/
private synchronized void reset() {
_pair = null;
@@ -2104,7 +2104,7 @@
* @see #getMaxTotal
*/
private int _maxTotal = DEFAULT_MAX_TOTAL;
-
+
/**
* The maximum amount of time (in millis) the
* {@link #borrowObject} method should block before throwing
@@ -2115,8 +2115,8 @@
* When less than or equal to 0, the {@link #borrowObject} method
* may block indefinitely.
*
- * @see #setMaxWait
- * @see #getMaxWait
+ * @see #setMaxWai
+ * @see #getMaxWai
* @see #WHEN_EXHAUSTED_BLOCK
* @see #setWhenExhaustedAction
* @see #getWhenExhaustedAction
@@ -2142,7 +2142,7 @@
* {@link org.apache.commons.pool.PoolableObjectFactory#validateObject validated}
* before being returned by the {@link #borrowObject}
* method. If the object fails to validate,
- * it will be dropped from the pool, and we will attempt
+ * it will be dropped from the pool, and we will attemp
* to borrow another.
*
* @see #setTestOnBorrow
@@ -2164,7 +2164,7 @@
/**
* When <code>true</code>, objects will be
* {@link org.apache.commons.pool.PoolableObjectFactory#validateObject validated}
- * by the idle object evictor (if any). If an object
+ * by the idle object evictor (if any). If an objec
* fails to validate, it will be dropped from the pool.
*
* @see #setTestWhileIdle
@@ -2243,13 +2243,13 @@
* @see GenericKeyedObjectPool.Evictor#run
*/
private CursorableLinkedList _poolList = null;
-
+
private CursorableLinkedList.Cursor _evictionCursor = null;
private CursorableLinkedList.Cursor _evictionKeyCursor = null;
-
+
/** Whether or not the pools behave as LIFO queues (last in first out) */
private boolean _lifo = DEFAULT_LIFO;
-
+
/**
* Used to track the order in which threads call {@link #borrowObject()} so
* that objects can be allocated in the order in which the threads requested
Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPoolFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPoolFactory.java?rev=777065&r1=777064&r2=777065&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPoolFactory.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPoolFactory.java Thu May 21 11:12:58 2009
@@ -4,10 +4,10 @@
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
+ * the License. You may obtain a copy of the License a
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -201,7 +201,7 @@
public GenericKeyedObjectPoolFactory(KeyedPoolableObjectFactory factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, int maxTotal, int minIdle, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle) {
this(factory, maxActive, whenExhaustedAction, maxWait, maxIdle, maxTotal, minIdle, testOnBorrow, testOnReturn, timeBetweenEvictionRunsMillis, numTestsPerEvictionRun, minEvictableIdleTimeMillis, testWhileIdle, GenericKeyedObjectPool.DEFAULT_LIFO);
}
-
+
/**
* Create a new GenericKeyedObjectPoolFactory.
*