go Gary go! :) -Simo http://people.apache.org/~simonetripodi/ http://simonetripodi.livejournal.com/ http://twitter.com/simonetripodi http://www.99soft.org/
On Wed, Dec 21, 2011 at 2:03 PM, <ggreg...@apache.org> wrote: > Author: ggregory > Date: Wed Dec 21 13:03:54 2011 > New Revision: 1221705 > > URL: http://svn.apache.org/viewvc?rev=1221705&view=rev > Log: > [POOL-208] Support Java 1.5 Generics in version 1.x. > > Modified: > commons/proper/pool/branches/POOL_1_X/build.xml > commons/proper/pool/branches/POOL_1_X/pom.xml > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BaseKeyedObjectPool.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BaseKeyedPoolableObjectFactory.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BaseObjectPool.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BasePoolableObjectFactory.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/KeyedObjectPool.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/KeyedObjectPoolFactory.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/KeyedPoolableObjectFactory.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/ObjectPool.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/ObjectPoolFactory.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/PoolUtils.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/PoolableObjectFactory.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/CursorableLinkedList.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/EvictionTimer.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPoolFactory.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericObjectPool.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/GenericObjectPoolFactory.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/SoftReferenceObjectPool.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/StackKeyedObjectPoolFactory.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/StackObjectPool.java > > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/StackObjectPoolFactory.java > commons/proper/pool/branches/POOL_1_X/src/site/site.xml > commons/proper/pool/branches/POOL_1_X/src/site/xdoc/examples.xml > commons/proper/pool/branches/POOL_1_X/src/site/xdoc/index.xml > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/MethodCall.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/MethodCallPoolableObjectFactory.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBaseKeyedObjectPool.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBaseKeyedPoolableObjectFactory.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBaseObjectPool.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestBasePoolableObjectFactory.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestKeyedObjectPool.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestKeyedObjectPoolFactory.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestObjectPool.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestObjectPoolFactory.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/TestPoolUtils.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/VisitTracker.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/VisitTrackerFactory.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/Waiter.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/WaiterFactory.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPoolFactory.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericObjectPool.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericObjectPoolFactory.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestSoftReferenceObjectPool.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestStackKeyedObjectPool.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestStackKeyedObjectPoolFactory.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestStackObjectPool.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestStackObjectPoolFactory.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/performance/PerformanceTest.java > > commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/performance/SleepingObjectFactory.java > > Modified: commons/proper/pool/branches/POOL_1_X/build.xml > URL: > http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/build.xml?rev=1221705&r1=1221704&r2=1221705&view=diff > ============================================================================== > --- commons/proper/pool/branches/POOL_1_X/build.xml (original) > +++ commons/proper/pool/branches/POOL_1_X/build.xml Wed Dec 21 13:03:54 2011 > @@ -40,7 +40,7 @@ > > <property name="name" value="commons-pool"/> > <property name="title" value="Apache Commons Object Pooling Package"/> > - <property name="version" value="1.5.8-SNAPSHOT"/> > + <property name="version" value="1.6-SNAPSHOT"/> > <property name="package" value="org.apache.commons.pool.*"/> > > <property name="src.dir" value="${basedir}/src"/> > @@ -61,8 +61,8 @@ > <property name="javac.optimize" value="false"/> > <property name="javac.debug" value="true"/> > <property name="javac.deprecation" value="true"/> > - <property name="javac.target.version" value="1.3"/> > - <property name="javac.src.version" value="1.3"/> > + <property name="javac.target.version" value="1.5"/> > + <property name="javac.src.version" value="1.5"/> > </target> > > <!-- ######################################################### --> > > Modified: commons/proper/pool/branches/POOL_1_X/pom.xml > URL: > http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/pom.xml?rev=1221705&r1=1221704&r2=1221705&view=diff > ============================================================================== > --- commons/proper/pool/branches/POOL_1_X/pom.xml (original) > +++ commons/proper/pool/branches/POOL_1_X/pom.xml Wed Dec 21 13:03:54 2011 > @@ -27,7 +27,7 @@ > <modelVersion>4.0.0</modelVersion> > <groupId>commons-pool</groupId> > <artifactId>commons-pool</artifactId> > - <version>1.5.8-SNAPSHOT</version> > + <version>1.6-SNAPSHOT</version> > <name>Commons Pool</name> > > <inceptionYear>2001</inceptionYear> > @@ -101,6 +101,12 @@ > <email></email> > <organization>Apache Software Foundation</organization> > </developer> > + <developer> > + <name>Gary Gregory</name> > + <id>ggregory</id> > + <email></email> > + <organization>Apache Software Foundation</organization> > + </developer> > </developers> > <contributors> > <contributor> > @@ -113,8 +119,7 @@ > <dependency> > <groupId>junit</groupId> > <artifactId>junit</artifactId> > - <!-- JUnit 3.8.2 is not compatible with Java 1.3, so use previous > version --> > - <version>3.8.1</version> > + <version>4.10</version> > <scope>test</scope> > </dependency> > </dependencies> > @@ -131,10 +136,10 @@ > <properties> > <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> > <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> > - <maven.compile.source>1.3</maven.compile.source> > - <maven.compile.target>1.3</maven.compile.target> > + <maven.compile.source>1.5</maven.compile.source> > + <maven.compile.target>1.5</maven.compile.target> > <commons.componentid>pool</commons.componentid> > - <commons.release.version>1.5.7</commons.release.version> > + <commons.release.version>1.6</commons.release.version> > <commons.jira.id>POOL</commons.jira.id> > <commons.jira.pid>12310488</commons.jira.pid> > </properties> > @@ -146,11 +151,11 @@ > <!-- Override plugin versions in parent Pom, which are too old to > support manifests --> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-source-plugin</artifactId> > - <version>2.1</version> > + <version>2.1.2</version> > </plugin> > <plugin> > <artifactId>maven-assembly-plugin</artifactId> > - <version>2.2-beta-5</version> > + <version>2.2.2</version> > </plugin> > </plugins> > </pluginManagement> > @@ -218,7 +223,7 @@ > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-changes-plugin</artifactId> > - <version>2.0</version> > + <version>2.6</version> > <configuration> > <xmlPath>${basedir}/src/changes/changes.xml</xmlPath> > <issueLinkTemplate>%URL%/%ISSUE%</issueLinkTemplate> > @@ -236,7 +241,7 @@ > <plugin> > <groupId>org.codehaus.mojo</groupId> > <artifactId>clirr-maven-plugin</artifactId> > - <version>2.2.2</version> > + <version>2.3</version> > <configuration> > <comparisonVersion>1.5</comparisonVersion> > <minSeverity>info</minSeverity> > @@ -255,18 +260,38 @@ > <plugin> > <groupId>org.codehaus.mojo</groupId> > <artifactId>findbugs-maven-plugin</artifactId> > - <version>1.2</version> > + <version>2.3.3</version> > <configuration> > <threshold>Normal</threshold> > <effort>Default</effort> > > <excludeFilterFile>${basedir}/findbugs-exclude-filter.xml</excludeFilterFile> > </configuration> > </plugin> > - <plugin> > - <groupId>org.codehaus.mojo</groupId> > - <artifactId>cobertura-maven-plugin</artifactId> > - <version>2.3</version> > - </plugin> > + <plugin> > + <groupId>org.codehaus.mojo</groupId> > + <artifactId>cobertura-maven-plugin</artifactId> > + <version>2.5.1</version> > + </plugin> > + <plugin> > + <groupId>org.apache.maven.plugins</groupId> > + <artifactId>maven-pmd-plugin</artifactId> > + <version>2.5</version> > + <configuration> > + <targetJdk>1.5</targetJdk> > + </configuration> > + </plugin> > + <plugin> > + <groupId>org.codehaus.mojo</groupId> > + <artifactId>taglist-maven-plugin</artifactId> > + <version>2.4</version> > + <configuration> > + <tags> > + <tag>TODO</tag> > + <tag>NOPMD</tag> > + <tag>NOTE</tag> > + </tags> > + </configuration> > + </plugin> > </plugins> > </reporting> > </project> > > Modified: > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BaseKeyedObjectPool.java > URL: > http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BaseKeyedObjectPool.java?rev=1221705&r1=1221704&r2=1221705&view=diff > ============================================================================== > --- > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BaseKeyedObjectPool.java > (original) > +++ > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BaseKeyedObjectPool.java > Wed Dec 21 13:03:54 2011 > @@ -27,17 +27,17 @@ package org.apache.commons.pool; > * @version $Revision$ $Date$ > * @since Pool 1.0 > */ > -public abstract class BaseKeyedObjectPool implements KeyedObjectPool { > +public abstract class BaseKeyedObjectPool<K, V> implements > KeyedObjectPool<K, V> { > > /** > * {@inheritDoc} > */ > - public abstract Object borrowObject(Object key) throws Exception; > + public abstract V borrowObject(K key) throws Exception; > > /** > * {@inheritDoc} > */ > - public abstract void returnObject(Object key, Object obj) throws > Exception; > + public abstract void returnObject(K key, V obj) throws Exception; > > /** > * <p>Invalidates an object from the pool.</p> > @@ -53,7 +53,7 @@ public abstract class BaseKeyedObjectPoo > * @param obj a {@link #borrowObject borrowed} instance to be returned. > * @throws Exception > */ > - public abstract void invalidateObject(Object key, Object obj) throws > Exception; > + public abstract void invalidateObject(K key, V obj) throws Exception; > > /** > * Not supported in this base implementation. > @@ -62,7 +62,7 @@ public abstract class BaseKeyedObjectPoo > * @param key ignored > * @throws UnsupportedOperationException > */ > - public void addObject(Object key) throws Exception, > UnsupportedOperationException { > + public void addObject(K key) throws Exception, > UnsupportedOperationException { > throw new UnsupportedOperationException(); > } > > @@ -71,7 +71,7 @@ public abstract class BaseKeyedObjectPoo > * @return a negative value. > * @param key ignored > */ > - public int getNumIdle(Object key) throws UnsupportedOperationException { > + public int getNumIdle(K key) throws UnsupportedOperationException { > return -1; > } > > @@ -80,7 +80,7 @@ public abstract class BaseKeyedObjectPoo > * @return a negative value. > * @param key ignored > */ > - public int getNumActive(Object key) throws UnsupportedOperationException > { > + public int getNumActive(K key) throws UnsupportedOperationException { > return -1; > } > > @@ -113,7 +113,7 @@ public abstract class BaseKeyedObjectPoo > * @param key ignored > * @throws UnsupportedOperationException > */ > - public void clear(Object key) throws Exception, > UnsupportedOperationException { > + public void clear(K key) throws Exception, UnsupportedOperationException > { > throw new UnsupportedOperationException(); > } > > @@ -132,7 +132,7 @@ public abstract class BaseKeyedObjectPoo > * @param factory the new KeyedPoolableObjectFactory > * @deprecated to be removed in pool 2.0 > */ > - public void setFactory(KeyedPoolableObjectFactory factory) throws > IllegalStateException, UnsupportedOperationException { > + public void setFactory(KeyedPoolableObjectFactory<K, V> factory) throws > IllegalStateException, UnsupportedOperationException { > throw new UnsupportedOperationException(); > } > > > Modified: > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BaseKeyedPoolableObjectFactory.java > URL: > http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BaseKeyedPoolableObjectFactory.java?rev=1221705&r1=1221704&r2=1221705&view=diff > ============================================================================== > --- > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BaseKeyedPoolableObjectFactory.java > (original) > +++ > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BaseKeyedPoolableObjectFactory.java > Wed Dec 21 13:03:54 2011 > @@ -29,14 +29,14 @@ package org.apache.commons.pool; > * @version $Revision$ $Date$ > * @since Pool 1.0 > */ > -public abstract class BaseKeyedPoolableObjectFactory implements > KeyedPoolableObjectFactory { > +public abstract class BaseKeyedPoolableObjectFactory<K, V> implements > KeyedPoolableObjectFactory<K, V> { > /** > * Create an instance that can be served by the pool. > * > * @param key the key used when constructing the object > * @return an instance that can be served by the pool > */ > - public abstract Object makeObject(Object key) > + public abstract V makeObject(K key) > throws Exception; > > /** > @@ -48,7 +48,7 @@ public abstract class BaseKeyedPoolableO > * @param key the key used when selecting the instance > * @param obj the instance to be destroyed > */ > - public void destroyObject(Object key, Object obj) > + public void destroyObject(K key, V obj) > throws Exception { > } > > @@ -62,7 +62,7 @@ public abstract class BaseKeyedPoolableO > * @param obj the instance to be validated > * @return always <code>true</code> in the default implementation > */ > - public boolean validateObject(Object key, Object obj) { > + public boolean validateObject(K key, V obj) { > return true; > } > > @@ -75,7 +75,7 @@ public abstract class BaseKeyedPoolableO > * @param key the key used when selecting the object > * @param obj the instance to be activated > */ > - public void activateObject(Object key, Object obj) > + public void activateObject(K key, V obj) > throws Exception { > } > > @@ -88,7 +88,7 @@ public abstract class BaseKeyedPoolableO > * @param key the key used when selecting the object > * @param obj the instance to be passivated > */ > - public void passivateObject(Object key, Object obj) > + public void passivateObject(K key, V obj) > throws Exception { > } > } > > Modified: > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BaseObjectPool.java > URL: > http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BaseObjectPool.java?rev=1221705&r1=1221704&r2=1221705&view=diff > ============================================================================== > --- > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BaseObjectPool.java > (original) > +++ > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BaseObjectPool.java > Wed Dec 21 13:03:54 2011 > @@ -27,21 +27,21 @@ package org.apache.commons.pool; > * @version $Revision$ $Date$ > * @since Pool 1.0 > */ > -public abstract class BaseObjectPool implements ObjectPool { > +public abstract class BaseObjectPool<T> implements ObjectPool<T> { > /** > * Obtains an instance from the pool. > * > * @return an instance from the pool > * @throws Exception if an instance cannot be obtained from the pool > */ > - public abstract Object borrowObject() throws Exception; > + public abstract T borrowObject() throws Exception; > > /** > * Returns an instance to the pool. > * > * @param obj instance to return to the pool > */ > - public abstract void returnObject(Object obj) throws Exception; > + public abstract void returnObject(T obj) throws Exception; > > /** > * <p>Invalidates an object from the pool.</p> > @@ -55,7 +55,7 @@ public abstract class BaseObjectPool imp > * @param obj a {@link #borrowObject borrowed} instance to be disposed. > * @throws Exception > */ > - public abstract void invalidateObject(Object obj) throws Exception; > + public abstract void invalidateObject(T obj) throws Exception; > > /** > * Not supported in this base implementation. > @@ -115,7 +115,7 @@ public abstract class BaseObjectPool imp > * @throws IllegalStateException > * @deprecated to be removed in pool 2.0 > */ > - public void setFactory(PoolableObjectFactory factory) throws > IllegalStateException, UnsupportedOperationException { > + public void setFactory(PoolableObjectFactory<T> factory) throws > IllegalStateException, UnsupportedOperationException { > throw new UnsupportedOperationException(); > } > > > Modified: > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BasePoolableObjectFactory.java > URL: > http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BasePoolableObjectFactory.java?rev=1221705&r1=1221704&r2=1221705&view=diff > ============================================================================== > --- > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BasePoolableObjectFactory.java > (original) > +++ > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/BasePoolableObjectFactory.java > Wed Dec 21 13:03:54 2011 > @@ -29,19 +29,19 @@ package org.apache.commons.pool; > * @version $Revision$ $Date$ > * @since Pool 1.0 > */ > -public abstract class BasePoolableObjectFactory implements > PoolableObjectFactory { > +public abstract class BasePoolableObjectFactory<T> implements > PoolableObjectFactory<T> { > > /** > * {@inheritDoc} > */ > - public abstract Object makeObject() throws Exception; > + public abstract T makeObject() throws Exception; > > /** > * No-op. > * > * @param obj ignored > */ > - public void destroyObject(Object obj) > + public void destroyObject(T obj) > throws Exception { > } > > @@ -51,7 +51,7 @@ public abstract class BasePoolableObject > * @param obj ignored > * @return <tt>true</tt> > */ > - public boolean validateObject(Object obj) { > + public boolean validateObject(T obj) { > return true; > } > > @@ -60,7 +60,7 @@ public abstract class BasePoolableObject > * > * @param obj ignored > */ > - public void activateObject(Object obj) throws Exception { > + public void activateObject(T obj) throws Exception { > } > > /** > @@ -68,7 +68,7 @@ public abstract class BasePoolableObject > * > * @param obj ignored > */ > - public void passivateObject(Object obj) > + public void passivateObject(T obj) > throws Exception { > } > } > > Modified: > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/KeyedObjectPool.java > URL: > http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/KeyedObjectPool.java?rev=1221705&r1=1221704&r2=1221705&view=diff > ============================================================================== > --- > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/KeyedObjectPool.java > (original) > +++ > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/KeyedObjectPool.java > Wed Dec 21 13:03:54 2011 > @@ -64,7 +64,7 @@ import java.util.NoSuchElementException; > * @see BaseKeyedObjectPool > * @since Pool 1.0 > */ > -public interface KeyedObjectPool { > +public interface KeyedObjectPool<K, V> { > /** > * Obtains an instance from this pool for the specified <code>key</code>. > * <p> > @@ -90,7 +90,7 @@ public interface KeyedObjectPool { > * @throws Exception when {@link KeyedPoolableObjectFactory#makeObject > makeObject} throws an exception > * @throws NoSuchElementException when the pool is exhausted and cannot > or will not return another instance > */ > - Object borrowObject(Object key) throws Exception, > NoSuchElementException, IllegalStateException; > + V borrowObject(K key) throws Exception, NoSuchElementException, > IllegalStateException; > > /** > * Return an instance to the pool. > @@ -105,7 +105,7 @@ public interface KeyedObjectPool { > * @param obj a {@link #borrowObject borrowed} instance to be returned. > * @throws Exception > */ > - void returnObject(Object key, Object obj) throws Exception; > + void returnObject(K key, V obj) throws Exception; > > /** > * <p>Invalidates an object from the pool.</p> > @@ -122,7 +122,7 @@ public interface KeyedObjectPool { > * @param obj a {@link #borrowObject borrowed} instance to be returned. > * @throws Exception > */ > - void invalidateObject(Object key, Object obj) throws Exception; > + void invalidateObject(K key, V obj) throws Exception; > > /** > * Create an object using the {@link KeyedPoolableObjectFactory factory} > or other > @@ -135,7 +135,7 @@ public interface KeyedObjectPool { > * @throws IllegalStateException after {@link #close} has been called on > this pool. > * @throws UnsupportedOperationException when this pool cannot add new > idle objects. > */ > - void addObject(Object key) throws Exception, IllegalStateException, > UnsupportedOperationException; > + void addObject(K key) throws Exception, IllegalStateException, > UnsupportedOperationException; > > /** > * Returns the number of instances > @@ -147,7 +147,7 @@ public interface KeyedObjectPool { > * @return the number of instances corresponding to the given > <code>key</code> currently idle in this pool or a negative value if > unsupported > * @throws UnsupportedOperationException <strong>deprecated</strong>: > when this implementation doesn't support the operation > */ > - int getNumIdle(Object key) throws UnsupportedOperationException; > + int getNumIdle(K key) throws UnsupportedOperationException; > > /** > * Returns the number of instances > @@ -160,7 +160,7 @@ public interface KeyedObjectPool { > * @return the number of instances corresponding to the given > <code>key</code> currently borrowed in this pool or a negative value if > unsupported > * @throws UnsupportedOperationException <strong>deprecated</strong>: > when this implementation doesn't support the operation > */ > - int getNumActive(Object key) throws UnsupportedOperationException; > + int getNumActive(K key) throws UnsupportedOperationException; > > /** > * Returns the total number of instances > @@ -200,7 +200,7 @@ public interface KeyedObjectPool { > * @param key the key to clear > * @throws UnsupportedOperationException when this implementation doesn't > support the operation > */ > - void clear(Object key) throws Exception, UnsupportedOperationException; > + void clear(K key) throws Exception, UnsupportedOperationException; > > /** > * Close this pool, and free any resources associated with it. > @@ -225,5 +225,5 @@ public interface KeyedObjectPool { > * @throws UnsupportedOperationException when this implementation doesn't > support the operation > * @deprecated to be removed in pool 2.0 > */ > - void setFactory(KeyedPoolableObjectFactory factory) throws > IllegalStateException, UnsupportedOperationException; > + void setFactory(KeyedPoolableObjectFactory<K, V> factory) throws > IllegalStateException, UnsupportedOperationException; > } > > Modified: > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/KeyedObjectPoolFactory.java > URL: > http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/KeyedObjectPoolFactory.java?rev=1221705&r1=1221704&r2=1221705&view=diff > ============================================================================== > --- > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/KeyedObjectPoolFactory.java > (original) > +++ > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/KeyedObjectPoolFactory.java > Wed Dec 21 13:03:54 2011 > @@ -26,11 +26,11 @@ package org.apache.commons.pool; > * @version $Revision$ $Date$ > * @since Pool 1.0 > */ > -public interface KeyedObjectPoolFactory { > +public interface KeyedObjectPoolFactory<K, V> { > /** > * Create a new {@link KeyedObjectPool}. > * @return a new {@link KeyedObjectPool} > * @throws IllegalStateException when this pool factory is not configured > properly > */ > - KeyedObjectPool createPool() throws IllegalStateException; > + KeyedObjectPool<K, V> createPool() throws IllegalStateException; > } > > Modified: > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/KeyedPoolableObjectFactory.java > URL: > http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/KeyedPoolableObjectFactory.java?rev=1221705&r1=1221704&r2=1221705&view=diff > ============================================================================== > --- > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/KeyedPoolableObjectFactory.java > (original) > +++ > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/KeyedPoolableObjectFactory.java > Wed Dec 21 13:03:54 2011 > @@ -71,7 +71,7 @@ package org.apache.commons.pool; > * @version $Revision$ $Date$ > * @since Pool 1.0 > */ > -public interface KeyedPoolableObjectFactory { > +public interface KeyedPoolableObjectFactory<K, V> { > /** > * Create an instance that can be served by the pool. > * > @@ -80,7 +80,7 @@ public interface KeyedPoolableObjectFact > * @throws Exception if there is a problem creating a new instance, > * this will be propagated to the code requesting an object. > */ > - Object makeObject(Object key) throws Exception; > + V makeObject(K key) throws Exception; > > /** > * Destroy an instance no longer needed by the pool. > @@ -102,7 +102,7 @@ public interface KeyedPoolableObjectFact > * @see #validateObject > * @see KeyedObjectPool#invalidateObject > */ > - void destroyObject(Object key, Object obj) throws Exception; > + void destroyObject(K key, V obj) throws Exception; > > /** > * Ensures that the instance is safe to be returned by the pool. > @@ -113,7 +113,7 @@ public interface KeyedPoolableObjectFact > * @return <code>false</code> if <code>obj</code> is not valid and should > * be dropped from the pool, <code>true</code> otherwise. > */ > - boolean validateObject(Object key, Object obj); > + boolean validateObject(K key, V obj); > > /** > * Reinitialize an instance to be returned by the pool. > @@ -124,7 +124,7 @@ public interface KeyedPoolableObjectFact > * this exception may be swallowed by the pool. > * @see #destroyObject > */ > - void activateObject(Object key, Object obj) throws Exception; > + void activateObject(K key, V obj) throws Exception; > > /** > * Uninitialize an instance to be returned to the idle object pool. > @@ -135,5 +135,5 @@ public interface KeyedPoolableObjectFact > * this exception may be swallowed by the pool. > * @see #destroyObject > */ > - void passivateObject(Object key, Object obj) throws Exception; > + void passivateObject(K key, V obj) throws Exception; > } > > Modified: > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/ObjectPool.java > URL: > http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/ObjectPool.java?rev=1221705&r1=1221704&r2=1221705&view=diff > ============================================================================== > --- > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/ObjectPool.java > (original) > +++ > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/ObjectPool.java > Wed Dec 21 13:03:54 2011 > @@ -62,7 +62,7 @@ import java.util.NoSuchElementException; > * @see BaseObjectPool > * @since Pool 1.0 > */ > -public interface ObjectPool { > +public interface ObjectPool<T> { > /** > * Obtains an instance from this pool. > * <p> > @@ -88,7 +88,7 @@ public interface ObjectPool { > * @throws Exception when {@link PoolableObjectFactory#makeObject > makeObject} throws an exception. > * @throws NoSuchElementException when the pool is exhausted and cannot > or will not return another instance. > */ > - Object borrowObject() throws Exception, NoSuchElementException, > IllegalStateException; > + T borrowObject() throws Exception, NoSuchElementException, > IllegalStateException; > > /** > * Return an instance to the pool. > @@ -100,7 +100,7 @@ public interface ObjectPool { > * @param obj a {@link #borrowObject borrowed} instance to be returned. > * @throws Exception > */ > - void returnObject(Object obj) throws Exception; > + void returnObject(T obj) throws Exception; > > /** > * <p>Invalidates an object from the pool.</p> > @@ -115,7 +115,7 @@ public interface ObjectPool { > * @param obj a {@link #borrowObject borrowed} instance to be disposed. > * @throws Exception > */ > - void invalidateObject(Object obj) throws Exception; > + void invalidateObject(T obj) throws Exception; > > /** > * Create an object using the {@link PoolableObjectFactory factory} or > other > @@ -186,5 +186,5 @@ public interface ObjectPool { > * @throws UnsupportedOperationException if this implementation does not > support the operation > * @deprecated to be removed in pool 2.0 > */ > - void setFactory(PoolableObjectFactory factory) throws > IllegalStateException, UnsupportedOperationException; > + void setFactory(PoolableObjectFactory<T> factory) throws > IllegalStateException, UnsupportedOperationException; > } > > Modified: > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/ObjectPoolFactory.java > URL: > http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/ObjectPoolFactory.java?rev=1221705&r1=1221704&r2=1221705&view=diff > ============================================================================== > --- > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/ObjectPoolFactory.java > (original) > +++ > commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/ObjectPoolFactory.java > Wed Dec 21 13:03:54 2011 > @@ -26,11 +26,11 @@ package org.apache.commons.pool; > * @version $Revision$ $Date$ > * @since Pool 1.0 > */ > -public interface ObjectPoolFactory { > +public interface ObjectPoolFactory<T> { > /** > * Create and return a new {@link ObjectPool}. > * @return a new {@link ObjectPool} > * @throws IllegalStateException when this pool factory is not configured > properly > */ > - ObjectPool createPool() throws IllegalStateException; > + ObjectPool<T> createPool() throws IllegalStateException; > } > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org