You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ma...@apache.org on 2013/07/24 11:58:25 UTC

svn commit: r1506478 - in /commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl: PooledObject.java PooledObjectState.java

Author: markt
Date: Wed Jul 24 09:58:25 2013
New Revision: 1506478

URL: http://svn.apache.org/r1506478
Log:
Fix a TODO

Modified:
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/PooledObject.java
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/PooledObjectState.java

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/PooledObject.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/PooledObject.java?rev=1506478&r1=1506477&r2=1506478&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/PooledObject.java (original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/PooledObject.java Wed Jul 24 09:58:25 2013
@@ -176,7 +176,7 @@ public class PooledObject<T> implements 
 
     public synchronized boolean startEvictionTest() {
         if (state == PooledObjectState.IDLE) {
-            state = PooledObjectState.MAINTAIN_EVICTION;
+            state = PooledObjectState.EVICTION;
             return true;
         }
 
@@ -185,10 +185,10 @@ public class PooledObject<T> implements 
 
     public synchronized boolean endEvictionTest(
             LinkedBlockingDeque<PooledObject<T>> idleQueue) {
-        if (state == PooledObjectState.MAINTAIN_EVICTION) {
+        if (state == PooledObjectState.EVICTION) {
             state = PooledObjectState.IDLE;
             return true;
-        } else if (state == PooledObjectState.MAINTAIN_EVICTION_RETURN_TO_HEAD) {
+        } else if (state == PooledObjectState.EVICTION_RETURN_TO_HEAD) {
             state = PooledObjectState.IDLE;
             if (!idleQueue.offerFirst(this)) {
                 // TODO - Should never happen
@@ -208,9 +208,9 @@ public class PooledObject<T> implements 
             state = PooledObjectState.ALLOCATED;
             lastBorrowTime = System.currentTimeMillis();
             return true;
-        } else if (state == PooledObjectState.MAINTAIN_EVICTION) {
+        } else if (state == PooledObjectState.EVICTION) {
             // TODO Allocate anyway and ignore eviction test
-            state = PooledObjectState.MAINTAIN_EVICTION_RETURN_TO_HEAD;
+            state = PooledObjectState.EVICTION_RETURN_TO_HEAD;
             return false;
         }
         // TODO if validating and testOnBorrow == true then pre-allocate for

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/PooledObjectState.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/PooledObjectState.java?rev=1506478&r1=1506477&r2=1506478&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/PooledObjectState.java (original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/PooledObjectState.java Wed Jul 24 09:58:25 2013
@@ -19,8 +19,6 @@ package org.apache.commons.pool2.impl;
 /**
  * Provides the possible states that a {@link PooledObject} may be in.
  *
- * TODO: Find shorter names for these states without loss of meaning.
- *
  * @version $Revision: $
  *
  * @since 2.0
@@ -39,7 +37,7 @@ public enum PooledObjectState {
     /**
      * In the queue, currently being tested for possible eviction.
      */
-    MAINTAIN_EVICTION,
+    EVICTION,
 
     /**
      * Not in the queue, currently being tested for possible eviction. An
@@ -49,12 +47,12 @@ public enum PooledObjectState {
      * TODO: Consider allocating object and ignoring the result of the eviction
      *       test.
      */
-    MAINTAIN_EVICTION_RETURN_TO_HEAD,
+    EVICTION_RETURN_TO_HEAD,
 
     /**
      * In the queue, currently being validated.
      */
-    MAINTAIN_VALIDATION,
+    VALIDATION,
 
     /**
      * Not in queue, currently being validated. The object was borrowed while
@@ -62,7 +60,7 @@ public enum PooledObjectState {
      * from the queue and pre-allocated. It should be allocated once validation
      * completes.
      */
-    MAINTAIN_VALIDATION_PREALLOCATED,
+    VALIDATION_PREALLOCATED,
 
     /**
      * Not in queue, currently being validated. An attempt to borrow the object
@@ -70,19 +68,19 @@ public enum PooledObjectState {
      * the queue. It should be returned to the head of the queue once validation
      * completes.
      */
-    MAINTAIN_VALIDATION_RETURN_TO_HEAD,
+    VALIDATION_RETURN_TO_HEAD,
 
     /**
      * Failed maintenance (e.g. eviction test or validation) and will be / has
      * been destroyed
      */
     INVALID,
-    
+
     /**
      * Deemed abandoned, to be invalidated.
      */
     ABANDONED,
-    
+
     /**
      * Returning to the pool.
      */