You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2011/04/23 23:15:39 UTC

svn commit: r1096232 - /commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java

Author: simonetripodi
Date: Sat Apr 23 21:15:38 2011
New Revision: 1096232

URL: http://svn.apache.org/viewvc?rev=1096232&view=rev
Log:
restored generics on StackObjectPoolFactory class

Modified:
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java?rev=1096232&r1=1096231&r2=1096232&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java Sat Apr 23 21:15:38 2011
@@ -31,7 +31,7 @@ import org.apache.commons.pool2.Poolable
  * @version $Revision$ $Date$
  * @since Pool 1.0
  */
-public class StackObjectPoolFactory implements ObjectPoolFactory {
+public class StackObjectPoolFactory<T> implements ObjectPoolFactory<T> {
     /**
      * Create a new StackObjectPoolFactory.
      *
@@ -39,7 +39,7 @@ public class StackObjectPoolFactory impl
      * @deprecated to be removed in pool 2.0 - use {@link #StackObjectPoolFactory(PoolableObjectFactory)}
      */
     public StackObjectPoolFactory() {
-        this((PoolableObjectFactory)null,StackObjectPool.DEFAULT_MAX_SLEEPING,StackObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY);
+        this((PoolableObjectFactory<T>)null,StackObjectPool.DEFAULT_MAX_SLEEPING,StackObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY);
     }
 
     /**
@@ -50,7 +50,7 @@ public class StackObjectPoolFactory impl
      * @deprecated to be removed in pool 2.0 - use {@link #StackObjectPoolFactory(PoolableObjectFactory, int)}
      */
     public StackObjectPoolFactory(int maxIdle) {
-        this((PoolableObjectFactory)null,maxIdle,StackObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY);
+        this((PoolableObjectFactory<T>)null,maxIdle,StackObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY);
     }
 
     /**
@@ -63,7 +63,7 @@ public class StackObjectPoolFactory impl
      * @deprecated to be removed in pool 2.0 - use {@link #StackObjectPoolFactory(PoolableObjectFactory, int, int)}
      */
     public StackObjectPoolFactory(int maxIdle, int initIdleCapacity) {
-        this((PoolableObjectFactory)null,maxIdle,initIdleCapacity);
+        this((PoolableObjectFactory<T>)null,maxIdle,initIdleCapacity);
     }
 
     /**
@@ -72,7 +72,7 @@ public class StackObjectPoolFactory impl
      * @param factory the PoolableObjectFactory used by created pools.
      * @see StackObjectPool#StackObjectPool(PoolableObjectFactory)
      */
-    public StackObjectPoolFactory(PoolableObjectFactory factory) {
+    public StackObjectPoolFactory(PoolableObjectFactory<T> factory) {
         this(factory,StackObjectPool.DEFAULT_MAX_SLEEPING,StackObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY);
     }
 
@@ -82,7 +82,7 @@ public class StackObjectPoolFactory impl
      * @param factory the PoolableObjectFactory used by created pools.
      * @param maxIdle cap on the number of "sleeping" instances in the pool.
      */
-    public StackObjectPoolFactory(PoolableObjectFactory factory, int maxIdle) {
+    public StackObjectPoolFactory(PoolableObjectFactory<T> factory, int maxIdle) {
         this(factory,maxIdle,StackObjectPool.DEFAULT_INIT_SLEEPING_CAPACITY);
     }
 
@@ -94,7 +94,7 @@ public class StackObjectPoolFactory impl
      * @param initIdleCapacity - initial size of the pool (this specifies the size of the container,
      * it does not cause the pool to be pre-populated.)
      */
-    public StackObjectPoolFactory(PoolableObjectFactory factory, int maxIdle, int initIdleCapacity) {
+    public StackObjectPoolFactory(PoolableObjectFactory<T> factory, int maxIdle, int initIdleCapacity) {
         _factory = factory;
         _maxSleeping = maxIdle;
         _initCapacity = initIdleCapacity;
@@ -105,15 +105,15 @@ public class StackObjectPoolFactory impl
      * 
      * @return a new StackObjectPool with the configured factory, maxIdle and initial capacity settings
      */
-    public ObjectPool createPool() {
-        return new StackObjectPool(_factory,_maxSleeping,_initCapacity);
+    public ObjectPool<T> createPool() {
+        return new StackObjectPool<T>(_factory,_maxSleeping,_initCapacity);
     }
 
     /**
      * The PoolableObjectFactory used by created pools.
      * @deprecated to be made private in pool 2.0
      */
-    protected PoolableObjectFactory _factory = null;
+    protected PoolableObjectFactory<T> _factory = null;
     
     /**
      * The maximum number of idle instances in created pools.
@@ -133,7 +133,7 @@ public class StackObjectPoolFactory impl
      * @return the PoolableObjectFactory used by created pools
      * @since 1.5.5
      */
-    public PoolableObjectFactory getFactory() {
+    public PoolableObjectFactory<T> getFactory() {
         return _factory;
     }