Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5AEC626B8 for ; Sat, 23 Apr 2011 18:35:18 +0000 (UTC) Received: (qmail 44053 invoked by uid 500); 23 Apr 2011 18:35:18 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 43991 invoked by uid 500); 23 Apr 2011 18:35:18 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 43984 invoked by uid 99); 23 Apr 2011 18:35:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Apr 2011 18:35:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Apr 2011 18:35:14 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0A71D2388980; Sat, 23 Apr 2011 18:34:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1096204 - in /commons/proper/pool/trunk/src/java/org/apache/commons/pool2: KeyedObjectPool.java KeyedObjectPoolFactory.java KeyedPoolableObjectFactory.java Date: Sat, 23 Apr 2011 18:34:52 -0000 To: commits@commons.apache.org From: simonetripodi@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110423183453.0A71D2388980@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: simonetripodi Date: Sat Apr 23 18:34:52 2011 New Revision: 1096204 URL: http://svn.apache.org/viewvc?rev=1096204&view=rev Log: restored generics to KeyedObjectPool interface and related Factories Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/KeyedObjectPool.java commons/proper/pool/trunk/src/java/org/apache/commons/pool2/KeyedObjectPoolFactory.java commons/proper/pool/trunk/src/java/org/apache/commons/pool2/KeyedPoolableObjectFactory.java Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/KeyedObjectPool.java URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/KeyedObjectPool.java?rev=1096204&r1=1096203&r2=1096204&view=diff ============================================================================== --- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/KeyedObjectPool.java (original) +++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/KeyedObjectPool.java Sat Apr 23 18:34:52 2011 @@ -64,7 +64,7 @@ import java.util.NoSuchElementException; * @see BaseKeyedObjectPool * @since Pool 1.0 */ -public interface KeyedObjectPool { +public interface KeyedObjectPool { /** * Obtains an instance from this pool for the specified key. *

@@ -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; /** *

Invalidates an object from the pool.

@@ -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 key currently idle in this pool or a negative value if unsupported * @throws UnsupportedOperationException deprecated: 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 key currently borrowed in this pool or a negative value if unsupported * @throws UnsupportedOperationException deprecated: 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 factory) throws IllegalStateException, UnsupportedOperationException; } Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/KeyedObjectPoolFactory.java URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/KeyedObjectPoolFactory.java?rev=1096204&r1=1096203&r2=1096204&view=diff ============================================================================== --- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/KeyedObjectPoolFactory.java (original) +++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/KeyedObjectPoolFactory.java Sat Apr 23 18:34:52 2011 @@ -26,11 +26,11 @@ package org.apache.commons.pool2; * @version $Revision$ $Date$ * @since Pool 1.0 */ -public interface KeyedObjectPoolFactory { +public interface KeyedObjectPoolFactory { /** * 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 createPool() throws IllegalStateException; } Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/KeyedPoolableObjectFactory.java URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/KeyedPoolableObjectFactory.java?rev=1096204&r1=1096203&r2=1096204&view=diff ============================================================================== --- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/KeyedPoolableObjectFactory.java (original) +++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/KeyedPoolableObjectFactory.java Sat Apr 23 18:34:52 2011 @@ -71,7 +71,7 @@ package org.apache.commons.pool2; * @version $Revision$ $Date$ * @since Pool 1.0 */ -public interface KeyedPoolableObjectFactory { +public interface KeyedPoolableObjectFactory { /** * 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 false if obj is not valid and should * be dropped from the pool, true 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; }