commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1213845 - in /commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl: GenericKeyedObjectPoolFactory.java GenericObjectPoolFactory.java
Date Tue, 13 Dec 2011 18:40:49 GMT
Author: sebb
Date: Tue Dec 13 18:40:48 2011
New Revision: 1213845

URL: http://svn.apache.org/viewvc?rev=1213845&view=rev
Log:
Make factories thread-safe.
[No existing tests actually used the setter methods which have now been removed]

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

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolFactory.java?rev=1213845&r1=1213844&r2=1213845&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolFactory.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolFactory.java
Tue Dec 13 18:40:48 2011
@@ -24,7 +24,9 @@ import org.apache.commons.pool2.KeyedPoo
 /**
  * A factory for creating {@link GenericKeyedObjectPool} instances from a
  * provided {@link GenericKeyedObjectPoolConfig configuration}.
- *
+ * <p>
+ * This class is intended to be thread-safe.
+ * 
  * @param <K> The type of keys maintained by the built pool.
  * @param <T> Type of element pooled in the built pool.
  *
@@ -33,8 +35,8 @@ import org.apache.commons.pool2.KeyedPoo
 public class GenericKeyedObjectPoolFactory<K,T>
         implements KeyedObjectPoolFactory<K,T> {
 
-    private KeyedPoolableObjectFactory<K,T> factory;
-    private GenericKeyedObjectPoolConfig<K, T> config;
+    private final KeyedPoolableObjectFactory<K,T> factory;
+    private final GenericKeyedObjectPoolConfig<K, T> config;
 
     /**
      * Create a new GenericKeyedObjectPoolFactory.
@@ -56,10 +58,6 @@ public class GenericKeyedObjectPoolFacto
         return factory;
     }
     
-    public void setFactory(KeyedPoolableObjectFactory<K,T> factory) {
-        this.factory = factory;
-    }
-
     /**
      * Obtain the configuration currently used by the factory allowing the
      * current settings to be viewed and changed.
@@ -70,17 +68,6 @@ public class GenericKeyedObjectPoolFacto
         return config;
     }
 
-
-    /**
-     * Replace the configuration settings used by this factory.
-     *  
-     * @param config    The new settings which will be passed by value
-     */
-    public void setConfig(GenericKeyedObjectPoolConfig<K, T> config) {
-        this.config = config.clone();
-    }
-
-
     /**
      * Create a new GenericKeyedObjectPool with the currently configured
      * properties.

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPoolFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPoolFactory.java?rev=1213845&r1=1213844&r2=1213845&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPoolFactory.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPoolFactory.java
Tue Dec 13 18:40:48 2011
@@ -24,7 +24,9 @@ import org.apache.commons.pool2.Poolable
 /**
  * A factory for creating {@link GenericObjectPool} instances from a provided
  * {@link GenericObjectPoolConfig configuration}.
- *
+ * <p>
+ * This class is intended to be thread-safe.
+ * 
  * @param <T> Type of element pooled in the built pool.
  *
  * @since Pool 1.0
@@ -32,8 +34,8 @@ import org.apache.commons.pool2.Poolable
 
 public class GenericObjectPoolFactory<T> implements ObjectPoolFactory<T> {
 
-    private PoolableObjectFactory<T> factory;
-    private GenericObjectPoolConfig<T> config;
+    private final PoolableObjectFactory<T> factory;
+    private final GenericObjectPoolConfig<T> config;
 
 
     /**
@@ -55,10 +57,6 @@ public class GenericObjectPoolFactory<T>
         return factory;
     }
     
-    public void setFactory(PoolableObjectFactory<T> factory) {
-        this.factory = factory;
-    }
-
     /**
      * Obtain the configuration currently used by the factory allowing the
      * current settings to be viewed and changed.
@@ -71,16 +69,6 @@ public class GenericObjectPoolFactory<T>
 
 
     /**
-     * Replace the configuration settings used by this factory.
-     *  
-     * @param config    The new settings which will be passed by value
-     */
-    public void setConfig(GenericObjectPoolConfig<T> config) {
-        this.config = config.clone();
-    }
-
-    
-    /**
      * Create a new GenericKeyedObjectPool with the currently configured
      * properties.
      * 



Mime
View raw message