commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1152987 - in /commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed: BasicManagedDataSource.java ManagedConnection.java ManagedDataSource.java PoolableManagedConnection.java
Date Tue, 02 Aug 2011 00:45:18 GMT
Author: markt
Date: Tue Aug  2 00:45:17 2011
New Revision: 1152987

URL: http://svn.apache.org/viewvc?rev=1152987&view=rev
Log:
Generics

Modified:
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/ManagedConnection.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/ManagedDataSource.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/PoolableManagedConnection.java

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java?rev=1152987&r1=1152986&r2=1152987&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java
Tue Aug  2 00:45:17 2011
@@ -140,7 +140,7 @@ public class BasicManagedDataSource exte
 
         // Create the XADataSource instance using the configured class name if it has not
been set
         if (xaDataSourceInstance == null) {
-            Class xaDataSourceClass = null;
+            Class<?> xaDataSourceClass = null;
             try {
                 xaDataSourceClass = Class.forName(xaDataSource);
             } catch (Throwable t) {

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/ManagedConnection.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/ManagedConnection.java?rev=1152987&r1=1152986&r2=1152987&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/ManagedConnection.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/ManagedConnection.java
Tue Aug  2 00:45:17 2011
@@ -41,13 +41,15 @@ import java.sql.SQLException;
  * @version $Revision$
  */
 public class ManagedConnection extends DelegatingConnection {
-    private final ObjectPool pool;
+    private final ObjectPool<Connection> pool;
     private final TransactionRegistry transactionRegistry;
     private final boolean accessToUnderlyingConnectionAllowed;
     private TransactionContext transactionContext;
     private boolean isSharedConnection;
 
-    public ManagedConnection(ObjectPool pool, TransactionRegistry transactionRegistry, boolean
accessToUnderlyingConnectionAllowed) throws SQLException {
+    public ManagedConnection(ObjectPool<Connection> pool, 
+            TransactionRegistry transactionRegistry,
+            boolean accessToUnderlyingConnectionAllowed) throws SQLException {
         super(null);
         this.pool = pool;
         this.transactionRegistry = transactionRegistry;
@@ -115,7 +117,7 @@ public class ManagedConnection extends D
             if (getDelegateInternal() == null) {
                 try {
                     // borrow a new connection from the pool
-                    Connection connection = (Connection) pool.borrowObject();
+                    Connection connection = pool.borrowObject();
                     setDelegate(connection);
                 } catch (Exception e) {
                     throw (SQLException) new SQLException("Unable to acquire a new connection
from the pool").initCause(e);

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/ManagedDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/ManagedDataSource.java?rev=1152987&r1=1152986&r2=1152987&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/ManagedDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/ManagedDataSource.java
Tue Aug  2 00:45:17 2011
@@ -51,7 +51,8 @@ public class ManagedDataSource extends P
      * @param transactionRegistry the transaction registry obtained from the
      * XAConnectionFactory used to create the connection pool object factory
      */
-    public ManagedDataSource(ObjectPool pool, TransactionRegistry transactionRegistry) {
+    public ManagedDataSource(ObjectPool<Connection> pool,
+            TransactionRegistry transactionRegistry) {
         super(pool);
         this.transactionRegistry = transactionRegistry;
     }

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/PoolableManagedConnection.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/PoolableManagedConnection.java?rev=1152987&r1=1152986&r2=1152987&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/PoolableManagedConnection.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/managed/PoolableManagedConnection.java
Tue Aug  2 00:45:17 2011
@@ -41,7 +41,9 @@ public class PoolableManagedConnection e
      * @param pool connection pool
      * @param config abandoned configuration settings
      */
-    public PoolableManagedConnection(TransactionRegistry transactionRegistry, Connection
conn, ObjectPool pool, AbandonedConfig config) {
+    public PoolableManagedConnection(TransactionRegistry transactionRegistry,
+            Connection conn, ObjectPool<PoolableConnection> pool,
+            AbandonedConfig config) {
         super(conn, pool, config);
         this.transactionRegistry = transactionRegistry;
     }
@@ -53,7 +55,8 @@ public class PoolableManagedConnection e
      * @param conn underlying connection
      * @param pool connection pool
      */
-    public PoolableManagedConnection(TransactionRegistry transactionRegistry, Connection
conn, ObjectPool pool) {
+    public PoolableManagedConnection(TransactionRegistry transactionRegistry,
+            Connection conn, ObjectPool<PoolableConnection> pool) {
         super(conn, pool);
         this.transactionRegistry = transactionRegistry;
     }



Mime
View raw message