commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject commons-dbcp git commit: Javadoc.
Date Mon, 11 Jun 2018 17:49:21 GMT
Repository: commons-dbcp
Updated Branches:
  refs/heads/master 773a012cf -> 55965e964


Javadoc.

Project: http://git-wip-us.apache.org/repos/asf/commons-dbcp/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-dbcp/commit/55965e96
Tree: http://git-wip-us.apache.org/repos/asf/commons-dbcp/tree/55965e96
Diff: http://git-wip-us.apache.org/repos/asf/commons-dbcp/diff/55965e96

Branch: refs/heads/master
Commit: 55965e964deb71b11758bf7e8abdf698ed7dd26d
Parents: 773a012
Author: Gary Gregory <garydgregory@gmail.com>
Authored: Mon Jun 11 11:49:18 2018 -0600
Committer: Gary Gregory <garydgregory@gmail.com>
Committed: Mon Jun 11 11:49:18 2018 -0600

----------------------------------------------------------------------
 .../commons/dbcp2/PoolableConnectionFactory.java  | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/55965e96/src/main/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java b/src/main/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java
index 7e323ba..0b455a6 100644
--- a/src/main/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java
+++ b/src/main/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java
@@ -50,15 +50,17 @@ public class PoolableConnectionFactory implements PooledObjectFactory<PoolableCo
     private static final Log log = LogFactory.getLog(PoolableConnectionFactory.class);
 
     /**
-     * Create a new {@code PoolableConnectionFactory}.
+     * Creates a new {@code PoolableConnectionFactory}.
      * 
      * @param connFactory
      *            the {@link ConnectionFactory} from which to obtain base {@link Connection}s
+     * @param dataSourceJmxObjectName
+     *            The JMX object name
      */
     public PoolableConnectionFactory(final ConnectionFactory connFactory,
             final ObjectName dataSourceJmxObjectName) {
         this.connectionFactory = connFactory;
-        this.dataSourceJmxName = dataSourceJmxObjectName;
+        this.dataSourceJmxObjectName = dataSourceJmxObjectName;
     }
 
     /**
@@ -291,8 +293,8 @@ public class PoolableConnectionFactory implements PooledObjectFactory<PoolableCo
             config.setMaxWaitMillis(0);
             config.setMaxIdlePerKey(1);
             config.setMaxTotal(maxOpenPreparedStatements);
-            if (dataSourceJmxName != null) {
-                final StringBuilder base = new StringBuilder(dataSourceJmxName.toString());
+            if (dataSourceJmxObjectName != null) {
+                final StringBuilder base = new StringBuilder(dataSourceJmxObjectName.toString());
                 base.append(Constants.JMX_CONNECTION_BASE_EXT);
                 base.append(Long.toString(connIndex));
                 config.setJmxNameBase(base.toString());
@@ -308,10 +310,10 @@ public class PoolableConnectionFactory implements PooledObjectFactory<PoolableCo
 
         // Register this connection with JMX
         ObjectName connJmxName;
-        if (dataSourceJmxName == null) {
+        if (dataSourceJmxObjectName == null) {
             connJmxName = null;
         } else {
-            connJmxName = new ObjectName(dataSourceJmxName.toString() + Constants.JMX_CONNECTION_BASE_EXT
+ connIndex);
+            connJmxName = new ObjectName(dataSourceJmxObjectName.toString() + Constants.JMX_CONNECTION_BASE_EXT
+ connIndex);
         }
 
         final PoolableConnection pc = new PoolableConnection(conn, pool, connJmxName, disconnectionSqlCodes,
@@ -448,7 +450,7 @@ public class PoolableConnectionFactory implements PooledObjectFactory<PoolableCo
     }
 
     protected ObjectName getDataSourceJmxName() {
-        return dataSourceJmxName;
+        return dataSourceJmxObjectName;
     }
 
     protected AtomicLong getConnectionIndex() {
@@ -456,7 +458,7 @@ public class PoolableConnectionFactory implements PooledObjectFactory<PoolableCo
     }
 
     private final ConnectionFactory connectionFactory;
-    private final ObjectName dataSourceJmxName;
+    private final ObjectName dataSourceJmxObjectName;
     private volatile String validationQuery;
     private volatile int validationQueryTimeoutSeconds = -1;
     private Collection<String> connectionInitSqls;


Mime
View raw message