Removed calling to a JDK 1.6 method if its run under 1.5 and still take advantage...
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 20 Dec 2008 00:45:46 +0000 (00:45 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 20 Dec 2008 00:45:46 +0000 (00:45 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@728197 13f79535-47bb-0310-9956-ffa450edef68

modules/jdbc-pool/build.xml
modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java
modules/jdbc-pool/sign.sh

index afb82e4..0cf0bba 100644 (file)
@@ -23,7 +23,7 @@
   <!-- See "build.properties.sample" in the top level directory for all     -->
   <property name="version.major"         value="1" />
   <property name="version.minor"         value="0" />
-  <property name="version.build"         value="9" />
+  <property name="version.build"         value="10" />
   <property name="version.patch"         value="-beta" />
   <property name="version"               value="${version.major}.${version.minor}.${version.build}${version.patch}" />
   <!-- property values you must customize for successful building!!!        -->
index 09fbd39..afaebf6 100644 (file)
@@ -353,6 +353,9 @@ public class ConnectionPool {
         PoolProperties.InterceptorDefinition[] proxies = getPoolProperties().getJdbcInterceptorsAsArray();
         for (int i=0; i<proxies.length; i++) {
             try {
+                if (log.isDebugEnabled()) {
+                    log.debug("Creating interceptor instance of class:"+proxies[i].getInterceptorClass());
+                }
                 proxies[i].getInterceptorClass().newInstance().poolStarted(this);
             }catch (Exception x) {
                 log.error("Unable to inform interceptor of pool start.",x);
@@ -771,7 +774,11 @@ public class ConnectionPool {
         try {
             MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
             ObjectName name = new ObjectName(POOL_JMX_TYPE_PREFIX+"ConnectionPool,name="+getName());
-            jmxPool = new org.apache.tomcat.jdbc.pool.jmx.ConnectionPool(this);
+            if ("1.5".equals(System.getProperty("java.specification.version"))) {
+                jmxPool = new org.apache.tomcat.jdbc.pool.jmx.ConnectionPool(this);
+            } else {
+                jmxPool = new org.apache.tomcat.jdbc.pool.jmx.ConnectionPool(this,true);
+            }
             mbs.registerMBean(jmxPool, name);
         } catch (Exception x) {
             log.warn("Unable to start JMX integration for connection pool. Instance["+getName()+"] can't be monitored.",x);
index 98f55f4..b01ef64 100644 (file)
@@ -25,12 +25,16 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+
 /**
  * @author Filip Hanik
  *
  */
 public class PoolProperties {
     public static final String PKG_PREFIX = "org.apache.tomcat.jdbc.pool.interceptor.";
+    protected static Log log = LogFactory.getLog(PoolProperties.class);
     
     protected static AtomicInteger poolCounter = new AtomicInteger(0);
     protected Properties dbProperties = new Properties();
@@ -460,8 +464,14 @@ public class PoolProperties {
         public Class<? extends JdbcInterceptor> getInterceptorClass() throws ClassNotFoundException {
             if (clazz==null) {
                 if (getClassName().indexOf(".")<0) {
+                    if (log.isDebugEnabled()) {
+                        log.debug("Loading interceptor class:"+PoolProperties.PKG_PREFIX+getClassName());
+                    }
                     clazz = Class.forName(PoolProperties.PKG_PREFIX+getClassName(), true, this.getClass().getClassLoader());
                 } else {
+                    if (log.isDebugEnabled()) {
+                        log.debug("Loading interceptor class:"+getClassName());
+                    }
                     clazz = Class.forName(getClassName(), true, this.getClass().getClassLoader());
                 }
             }
index 67cfeb3..c8b66ea 100644 (file)
@@ -37,6 +37,11 @@ public class ConnectionPool extends NotificationBroadcasterSupport implements Co
     protected AtomicInteger sequence = new AtomicInteger(0);
 
     public ConnectionPool(org.apache.tomcat.jdbc.pool.ConnectionPool pool) {
+        super();
+        this.pool = pool;
+    }
+
+    public ConnectionPool(org.apache.tomcat.jdbc.pool.ConnectionPool pool, boolean for16) {
         super(getDefaultNotificationInfo());
         this.pool = pool;
     }
index 81e1728..da57c61 100755 (executable)
@@ -1,4 +1,4 @@
-VERSION=v1.0.9-beta
+VERSION=v1.0.10-beta
 for i in $(find output/release/$VERSION -name "*.zip" -o -name "*.tar.gz"); do
   echo Signing $i
   echo $1|gpg --passphrase-fd 0 -a -b $i