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 2011/09/21 00:03:13 UTC
svn commit: r1173400 - in /commons/proper/pool/trunk/src:
java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java
test/org/apache/commons/pool2/TestPoolUtils.java
Author: psteitz
Date: Tue Sep 20 22:03:12 2011
New Revision: 1173400
URL: http://svn.apache.org/viewvc?rev=1173400&view=rev
Log:
Javadoc.
Modified:
commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java
commons/proper/pool/trunk/src/test/org/apache/commons/pool2/TestPoolUtils.java
Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java?rev=1173400&r1=1173399&r2=1173400&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java Tue Sep 20 22:03:12 2011
@@ -1329,6 +1329,16 @@ public class GenericKeyedObjectPool<K,T>
return p;
}
+ /**
+ * Invalidate toDestroy and if it is idle under key or always is true, destroy it.
+ * Return true if toDestroy is destroyed.
+ *
+ * @param key pool key
+ * @param toDestroy instance to invalidate and destroy if conditions are met
+ * @param always true means instance will be destroyed regardless of idle pool membership
+ * @return true iff toDestroy is destroyed
+ * @throws Exception
+ */
private boolean destroy(K key, PooledObject<T> toDestroy, boolean always)
throws Exception {
Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java?rev=1173400&r1=1173399&r2=1173400&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java Tue Sep 20 22:03:12 2011
@@ -145,6 +145,10 @@ public class LinkedBlockingDeque<E>
/** Condition for waiting puts */
private final Condition notFull = lock.newCondition();
+
+ public boolean hasTakeWaiters() {
+ return lock.hasWaiters(notEmpty);
+ }
/**
* Creates a {@code LinkedBlockingDeque} with a capacity of
Modified: commons/proper/pool/trunk/src/test/org/apache/commons/pool2/TestPoolUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/org/apache/commons/pool2/TestPoolUtils.java?rev=1173400&r1=1173399&r2=1173400&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/test/org/apache/commons/pool2/TestPoolUtils.java (original)
+++ commons/proper/pool/trunk/src/test/org/apache/commons/pool2/TestPoolUtils.java Tue Sep 20 22:03:12 2011
@@ -56,7 +56,7 @@ public class TestPoolUtils {
/** Sleep time to let the minIdle tests run CHECK_COUNT times. */
private static final int CHECK_SLEEP_PERIOD = CHECK_PERIOD * (CHECK_COUNT - 1) + CHECK_PERIOD / 2;
- @SuppressWarnings("unused")
+ @Test
public void testJavaBeanInstantiation() {
new PoolUtils();
}