tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1187811 [3/4] - in /tomcat/trunk/modules/jdbc-pool: ./ doc/ src/main/java/org/apache/tomcat/jdbc/naming/ src/main/java/org/apache/tomcat/jdbc/pool/ src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ src/main/java/org/apache/tomcat/jdbc...
Date Sat, 22 Oct 2011 21:29:57 GMT
Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java?rev=1187811&r1=1187810&r2=1187811&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java (original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java Sat Oct 22 21:29:55 2011
@@ -35,9 +35,9 @@ import org.apache.juli.logging.LogFactor
  */
 public class PoolProperties implements PoolConfiguration {
     private static final Log log = LogFactory.getLog(PoolProperties.class);
-    
+
     public static final int DEFAULT_MAX_ACTIVE = 100;
-    
+
     protected static AtomicInteger poolCounter = new AtomicInteger(0);
     protected Properties dbProperties = new Properties();
     protected String url = null;
@@ -83,293 +83,293 @@ public class PoolProperties implements P
     protected Object dataSource = null;
     protected String dataSourceJNDI = null;
     protected boolean alternateUsernameAllowed = false;
-    
-    
-    /** 
+
+
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setAbandonWhenPercentageFull(int percentage) {
         if (percentage<0) abandonWhenPercentageFull = 0;
         else if (percentage>100) abandonWhenPercentageFull = 100;
         else abandonWhenPercentageFull = percentage;
     }
-    
-    /** 
+
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public int getAbandonWhenPercentageFull() {
         return abandonWhenPercentageFull;
     }
-    
-    /** 
+
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public boolean isFairQueue() {
         return fairQueue;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setFairQueue(boolean fairQueue) {
         this.fairQueue = fairQueue;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public boolean isAccessToUnderlyingConnectionAllowed() {
         return accessToUnderlyingConnectionAllowed;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public String getConnectionProperties() {
         return connectionProperties;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public Properties getDbProperties() {
         return dbProperties;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public Boolean isDefaultAutoCommit() {
         return defaultAutoCommit;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public String getDefaultCatalog() {
         return defaultCatalog;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public Boolean isDefaultReadOnly() {
         return defaultReadOnly;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public int getDefaultTransactionIsolation() {
         return defaultTransactionIsolation;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public String getDriverClassName() {
         return driverClassName;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public int getInitialSize() {
         return initialSize;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public boolean isLogAbandoned() {
         return logAbandoned;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public int getMaxActive() {
         return maxActive;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public int getMaxIdle() {
         return maxIdle;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public int getMaxWait() {
         return maxWait;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public int getMinEvictableIdleTimeMillis() {
         return minEvictableIdleTimeMillis;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public int getMinIdle() {
         return minIdle;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public String getName() {
         return name;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public int getNumTestsPerEvictionRun() {
         return numTestsPerEvictionRun;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public String getPassword() {
         return password;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public String getPoolName() {
         return getName();
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public boolean isRemoveAbandoned() {
         return removeAbandoned;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public int getRemoveAbandonedTimeout() {
         return removeAbandonedTimeout;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public boolean isTestOnBorrow() {
         return testOnBorrow;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public boolean isTestOnReturn() {
         return testOnReturn;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public boolean isTestWhileIdle() {
         return testWhileIdle;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public int getTimeBetweenEvictionRunsMillis() {
         return timeBetweenEvictionRunsMillis;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public String getUrl() {
         return url;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public String getUsername() {
         return username;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public String getValidationQuery() {
         return validationQuery;
@@ -378,7 +378,7 @@ public class PoolProperties implements P
     /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public String getValidatorClassName() {
         return validatorClassName;
@@ -387,13 +387,13 @@ public class PoolProperties implements P
     /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public Validator getValidator() {
         return validator;
     }
-    
-    /** 
+
+    /**
      * {@inheritDoc}
      */
     @Override
@@ -407,46 +407,46 @@ public class PoolProperties implements P
     }
 
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public long getValidationInterval() {
         return validationInterval;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public String getInitSQL() {
         return initSQL;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public boolean isTestOnConnect() {
         return testOnConnect;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public String getJdbcInterceptors() {
         return jdbcInterceptors;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public InterceptorDefinition[] getJdbcInterceptorsAsArray() {
         if (interceptors == null) {
@@ -481,255 +481,255 @@ public class PoolProperties implements P
         return interceptors;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setAccessToUnderlyingConnectionAllowed(boolean accessToUnderlyingConnectionAllowed) {
         // NOOP
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setConnectionProperties(String connectionProperties) {
         this.connectionProperties = connectionProperties;
         getProperties(connectionProperties, getDbProperties());
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setDbProperties(Properties dbProperties) {
         this.dbProperties = dbProperties;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setDefaultAutoCommit(Boolean defaultAutoCommit) {
         this.defaultAutoCommit = defaultAutoCommit;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setDefaultCatalog(String defaultCatalog) {
         this.defaultCatalog = defaultCatalog;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setDefaultReadOnly(Boolean defaultReadOnly) {
         this.defaultReadOnly = defaultReadOnly;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setDefaultTransactionIsolation(int defaultTransactionIsolation) {
         this.defaultTransactionIsolation = defaultTransactionIsolation;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setDriverClassName(String driverClassName) {
         this.driverClassName = driverClassName;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setInitialSize(int initialSize) {
         this.initialSize = initialSize;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setLogAbandoned(boolean logAbandoned) {
         this.logAbandoned = logAbandoned;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setMaxActive(int maxActive) {
         this.maxActive = maxActive;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setMaxIdle(int maxIdle) {
         this.maxIdle = maxIdle;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setMaxWait(int maxWait) {
         this.maxWait = maxWait;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setMinEvictableIdleTimeMillis(int minEvictableIdleTimeMillis) {
         this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setMinIdle(int minIdle) {
         this.minIdle = minIdle;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setName(String name) {
         this.name = name;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun) {
         this.numTestsPerEvictionRun = numTestsPerEvictionRun;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setPassword(String password) {
         this.password = password;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setRemoveAbandoned(boolean removeAbandoned) {
         this.removeAbandoned = removeAbandoned;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setRemoveAbandonedTimeout(int removeAbandonedTimeout) {
         this.removeAbandonedTimeout = removeAbandonedTimeout;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setTestOnBorrow(boolean testOnBorrow) {
         this.testOnBorrow = testOnBorrow;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setTestWhileIdle(boolean testWhileIdle) {
         this.testWhileIdle = testWhileIdle;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setTestOnReturn(boolean testOnReturn) {
         this.testOnReturn = testOnReturn;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setTimeBetweenEvictionRunsMillis(int
                                                  timeBetweenEvictionRunsMillis) {
         this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setUrl(String url) {
         this.url = url;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setUsername(String username) {
         this.username = username;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setValidationInterval(long validationInterval) {
         this.validationInterval = validationInterval;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setValidationQuery(String validationQuery) {
         this.validationQuery = validationQuery;
@@ -738,17 +738,17 @@ public class PoolProperties implements P
     /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setValidatorClassName(String className) {
         this.validatorClassName = className;
-        
+
         validator = null;
-        
+
         if (className == null) {
             return;
         }
-        
+
         try {
             Class<Validator> validatorClass = (Class<Validator>)Class.forName(className);
             validator = validatorClass.newInstance();
@@ -764,35 +764,35 @@ public class PoolProperties implements P
         }
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setInitSQL(String initSQL) {
         this.initSQL = initSQL;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setTestOnConnect(boolean testOnConnect) {
         this.testOnConnect = testOnConnect;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setJdbcInterceptors(String jdbcInterceptors) {
         this.jdbcInterceptors = jdbcInterceptors;
         this.interceptors = null;
     }
 
-    
+
     @Override
     public String toString() {
         StringBuilder buf = new StringBuilder("ConnectionPool[");
@@ -828,47 +828,47 @@ public class PoolProperties implements P
         return poolCounter.get();
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public boolean isJmxEnabled() {
         return jmxEnabled;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setJmxEnabled(boolean jmxEnabled) {
         this.jmxEnabled = jmxEnabled;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public Boolean getDefaultAutoCommit() {
         return defaultAutoCommit;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public Boolean getDefaultReadOnly() {
         return defaultReadOnly;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public int getSuspectTimeout() {
         return this.suspectTimeout;
@@ -877,23 +877,23 @@ public class PoolProperties implements P
     /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setSuspectTimeout(int seconds) {
         this.suspectTimeout = seconds;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public boolean isPoolSweeperEnabled() {
         boolean timer = getTimeBetweenEvictionRunsMillis()>0;
         boolean result = timer && (isRemoveAbandoned() && getRemoveAbandonedTimeout()>0);
-        result = result || (timer && getSuspectTimeout()>0); 
+        result = result || (timer && getSuspectTimeout()>0);
         result = result || (timer && isTestWhileIdle() && getValidationQuery()!=null);
-        result = result || (timer && getMinEvictableIdleTimeMillis()>0); 
+        result = result || (timer && getMinEvictableIdleTimeMillis()>0);
         return result;
     }
 
@@ -905,7 +905,7 @@ public class PoolProperties implements P
         public InterceptorDefinition(String className) {
             this.className = className;
         }
-        
+
         public InterceptorDefinition(Class<?> cl) {
             this(cl.getName());
             clazz = cl;
@@ -918,15 +918,15 @@ public class PoolProperties implements P
             InterceptorProperty p = new InterceptorProperty(name,value);
             addProperty(p);
         }
-        
+
         public void addProperty(InterceptorProperty p) {
             properties.put(p.getName(), p);
         }
-        
+
         public Map<String,InterceptorProperty> getProperties() {
             return properties;
         }
-        
+
         public Class<? extends JdbcInterceptor> getInterceptorClass() throws ClassNotFoundException {
             if (clazz==null) {
                 if (getClassName().indexOf(".")<0) {
@@ -943,8 +943,8 @@ public class PoolProperties implements P
             }
             return (Class<? extends JdbcInterceptor>)clazz;
         }
-    } 
-    
+    }
+
     public static class InterceptorProperty {
         String name;
         String value;
@@ -959,14 +959,14 @@ public class PoolProperties implements P
         public String getValue() {
             return value;
         }
-        
+
         public boolean getValueAsBoolean(boolean def) {
             if (value==null) return def;
             if ("true".equals(value)) return true;
             if ("false".equals(value)) return false;
             return def;
         }
-        
+
         public int getValueAsInt(int def) {
             if (value==null) return def;
             try {
@@ -976,7 +976,7 @@ public class PoolProperties implements P
                 return def;
             }
         }
-        
+
         public long getValueAsLong(long def) {
             if (value==null) return def;
             try {
@@ -994,7 +994,7 @@ public class PoolProperties implements P
                 return def;
             }
         }
-        
+
         public short getValueAsShort(short def) {
             if (value==null) return def;
             try {
@@ -1021,7 +1021,7 @@ public class PoolProperties implements P
                 return def;
             }
         }
- 
+
         public char getValueAschar(char def) {
             if (value==null) return def;
             try {
@@ -1030,12 +1030,12 @@ public class PoolProperties implements P
                 return def;
             }
         }
-        
+
         @Override
         public int hashCode() {
             return name.hashCode();
         }
-        
+
         @Override
         public boolean equals(Object o) {
             if (o==this) return true;
@@ -1047,95 +1047,95 @@ public class PoolProperties implements P
         }
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public boolean isUseEquals() {
         return useEquals;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setUseEquals(boolean useEquals) {
         this.useEquals = useEquals;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public long getMaxAge() {
         return maxAge;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setMaxAge(long maxAge) {
         this.maxAge = maxAge;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public boolean getUseLock() {
         return useLock;
     }
 
-    /** 
+    /**
      * {@inheritDoc}
      */
-    
+
     @Override
     public void setUseLock(boolean useLock) {
         this.useLock = useLock;
     }
-    
-    
-    /** 
+
+
+    /**
      * {@inheritDoc}
      */
     @Override
     public void setDataSource(Object ds) {
         this.dataSource = ds;
     }
-    
-    /** 
+
+    /**
      * {@inheritDoc}
      */
     @Override
     public Object getDataSource() {
         return dataSource;
     }
-    
-    
-    /** 
+
+
+    /**
      * {@inheritDoc}
      */
     @Override
     public void setDataSourceJNDI(String jndiDS) {
         this.dataSourceJNDI = jndiDS;
     }
-    
-    /** 
+
+    /**
      * {@inheritDoc}
      */
     @Override
     public String getDataSourceJNDI() {
         return this.dataSourceJNDI;
     }
-    
-        
+
+
     public static Properties getProperties(String propText, Properties props) {
         if (props==null) props = new Properties();
         if (propText != null) {
@@ -1147,21 +1147,21 @@ public class PoolProperties implements P
         }
         return props;
     }
-    
-    /** 
+
+    /**
      * {@inheritDoc}
      */
     @Override
     public boolean isAlternateUsernameAllowed() {
         return alternateUsernameAllowed;
     }
-    
-    /** 
+
+    /**
      * {@inheritDoc}
      */
     @Override
     public void setAlternateUsernameAllowed(boolean alternateUsernameAllowed) {
         this.alternateUsernameAllowed = alternateUsernameAllowed;
     }
-    
+
 }

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolUtilities.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolUtilities.java?rev=1187811&r1=1187810&r2=1187811&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolUtilities.java (original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolUtilities.java Sat Oct 22 21:29:55 2011
@@ -19,22 +19,22 @@ package org.apache.tomcat.jdbc.pool;
 import java.util.Properties;
 
 /**
- * 
+ *
  * @author fhanik
  *
  */
 public class PoolUtilities {
-    
+
     public static final String PROP_USER = "user";
-    
+
     public static final String PROP_PASSWORD = "password";
-    
+
     public static Properties clone(Properties p) {
         Properties c = new Properties();
         c.putAll(p);
         return c;
     }
-    
+
     public static Properties cloneWithoutPassword(Properties p) {
         Properties result = clone(p);
         result.remove(PROP_PASSWORD);

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java?rev=1187811&r1=1187810&r2=1187811&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java (original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java Sat Oct 22 21:29:55 2011
@@ -42,9 +42,9 @@ public class PooledConnection {
     private static final Log log = LogFactory.getLog(PooledConnection.class);
 
     public static final String PROP_USER = PoolUtilities.PROP_USER;
-    
+
     public static final String PROP_PASSWORD = PoolUtilities.PROP_PASSWORD;
-    
+
     /**
      * Validate when connection is borrowed flag
      */
@@ -69,7 +69,7 @@ public class PooledConnection {
      * The underlying database connection
      */
     private volatile java.sql.Connection connection;
-    
+
     /**
      * If using a XAConnection underneath.
      */
@@ -102,7 +102,7 @@ public class PooledConnection {
      * The parent
      */
     protected ConnectionPool parent;
-    
+
     private HashMap<Object, Object> attributes = new HashMap<Object, Object>();
 
     /**
@@ -111,13 +111,13 @@ public class PooledConnection {
      * the connection
      */
     private volatile JdbcInterceptor handler = null;
-    
+
     private AtomicBoolean released = new AtomicBoolean(false);
-    
+
     private volatile boolean suspect = false;
-    
+
     private java.sql.Driver driver = null;
-    
+
     /**
      * Constructor
      * @param prop - pool properties
@@ -130,32 +130,32 @@ public class PooledConnection {
 
     public boolean checkUser(String username, String password) {
         if (!getPoolProperties().isAlternateUsernameAllowed()) return true;
-        
+
         if (username==null) username = poolProperties.getUsername();
         if (password==null) password = poolProperties.getPassword();
-        
+
         String storedUsr = (String)getAttributes().get(PROP_USER);
         String storedPwd = (String)getAttributes().get(PROP_PASSWORD);
-        
+
         boolean result = (username==null && storedUsr==null);
         result = (result || (username!=null && username.equals(storedUsr)));
-                
+
         result = result && ((password==null && storedPwd==null) || (password!=null && password.equals(storedPwd)));
-        
+
         if (username==null)  getAttributes().remove(PROP_USER); else getAttributes().put(PROP_USER, username);
         if (password==null)  getAttributes().remove(PROP_PASSWORD); else getAttributes().put(PROP_PASSWORD, password);
-        
+
         return result;
     }
-    
+
     /**
      * Connects the underlying connection to the database.
      * @throws SQLException if the method {@link #release()} has been called.
      * @throws SQLException if driver instantiation fails
      * @throws SQLException if a call to {@link java.sql.Driver#connect(String, java.util.Properties)} fails.
-     * @throws SQLException if default properties are configured and a call to 
-     * {@link java.sql.Connection#setAutoCommit(boolean)}, {@link java.sql.Connection#setCatalog(String)}, 
-     * {@link java.sql.Connection#setTransactionIsolation(int)} or {@link java.sql.Connection#setReadOnly(boolean)} fails.  
+     * @throws SQLException if default properties are configured and a call to
+     * {@link java.sql.Connection#setAutoCommit(boolean)}, {@link java.sql.Connection#setCatalog(String)},
+     * {@link java.sql.Connection#setTransactionIsolation(int)} or {@link java.sql.Connection#setReadOnly(boolean)} fails.
      */
     public void connect() throws SQLException {
         if (released.get()) throw new SQLException("A connection once released, can't be reestablished.");
@@ -169,24 +169,24 @@ public class PooledConnection {
         if (poolProperties.getDataSource()==null && poolProperties.getDataSourceJNDI()!=null) {
             //TODO lookup JNDI name
         }
-        
+
         if (poolProperties.getDataSource()!=null) {
             connectUsingDataSource();
         } else {
             connectUsingDriver();
         }
-        
+
         //set up the default state, unless we expect the interceptor to do it
         if (poolProperties.getJdbcInterceptors()==null || poolProperties.getJdbcInterceptors().indexOf(ConnectionState.class.getName())<0) {
             if (poolProperties.getDefaultTransactionIsolation()!=DataSourceFactory.UNKNOWN_TRANSACTIONISOLATION) connection.setTransactionIsolation(poolProperties.getDefaultTransactionIsolation());
             if (poolProperties.getDefaultReadOnly()!=null) connection.setReadOnly(poolProperties.getDefaultReadOnly().booleanValue());
             if (poolProperties.getDefaultAutoCommit()!=null) connection.setAutoCommit(poolProperties.getDefaultAutoCommit().booleanValue());
             if (poolProperties.getDefaultCatalog()!=null) connection.setCatalog(poolProperties.getDefaultCatalog());
-        }        
+        }
         this.discarded = false;
         this.lastConnected = System.currentTimeMillis();
     }
-    
+
     protected void connectUsingDataSource() throws SQLException {
         String usr = null;
         String pwd = null;
@@ -230,7 +230,7 @@ public class PooledConnection {
         }
     }
     protected void connectUsingDriver() throws SQLException {
-        
+
         try {
             if (driver==null)
                 driver = (java.sql.Driver) Class.forName(poolProperties.getDriverClassName(),
@@ -285,9 +285,9 @@ public class PooledConnection {
             throw new SQLException("Driver:"+driver+" returned null for URL:"+driverURL);
         }
     }
-    
+
     /**
-     * 
+     *
      * @return true if connect() was called successfully and disconnect has not yet been called
      */
     public boolean isInitialized() {
@@ -295,7 +295,7 @@ public class PooledConnection {
     }
 
     /**
-     * Issues a call to {@link #disconnect(boolean)} with the argument false followed by a call to 
+     * Issues a call to {@link #disconnect(boolean)} with the argument false followed by a call to
      * {@link #connect()}
      * @throws SQLException if the call to {@link #connect()} fails.
      */
@@ -335,7 +335,7 @@ public class PooledConnection {
 
 
 //============================================================================
-//             
+//
 //============================================================================
 
     /**
@@ -351,7 +351,7 @@ public class PooledConnection {
     }
 
     /**
-     * Returns true if the connection pool is configured 
+     * Returns true if the connection pool is configured
      * to do validation for a certain action.
      * @param action
      * @return
@@ -385,23 +385,23 @@ public class PooledConnection {
     }
 
     /**
-     * Validates a connection. 
-     * @param validateAction the action used. One of {@link #VALIDATE_BORROW}, {@link #VALIDATE_IDLE}, 
+     * Validates a connection.
+     * @param validateAction the action used. One of {@link #VALIDATE_BORROW}, {@link #VALIDATE_IDLE},
      * {@link #VALIDATE_INIT} or {@link #VALIDATE_RETURN}
-     * @param sql the SQL to be used during validation. If the {@link PoolConfiguration#setInitSQL(String)} has been called with a non null 
+     * @param sql the SQL to be used during validation. If the {@link PoolConfiguration#setInitSQL(String)} has been called with a non null
      * value and the action is {@link #VALIDATE_INIT} the init SQL will be used for validation.
-     *  
-     * @return true if the connection was validated successfully. It returns true even if validation was not performed, such as when 
-     * {@link PoolConfiguration#setValidationInterval(long)} has been called with a positive value. 
+     *
+     * @return true if the connection was validated successfully. It returns true even if validation was not performed, such as when
+     * {@link PoolConfiguration#setValidationInterval(long)} has been called with a positive value.
      * <p>
-     * false if the validation failed. The caller should close the connection if false is returned since a session could have been left in 
+     * false if the validation failed. The caller should close the connection if false is returned since a session could have been left in
      * an unknown state during initialization.
      */
     public boolean validate(int validateAction,String sql) {
         if (this.isDiscarded()) {
             return false;
         }
-        
+
         if (!doValidate(validateAction)) {
             //no validation required, no init sql and props not set
             return true;
@@ -424,9 +424,9 @@ public class PooledConnection {
                 return false;
             }
         }
-        
+
         String query = sql;
-        
+
         if (validateAction == VALIDATE_INIT && poolProperties.getInitSQL() != null) {
             query = poolProperties.getInitSQL();
         }
@@ -434,7 +434,7 @@ public class PooledConnection {
         if (query == null) {
             query = poolProperties.getValidationQuery();
         }
-        
+
         Statement stmt = null;
         try {
             stmt = connection.createStatement();
@@ -530,7 +530,7 @@ public class PooledConnection {
     /**
      * Set the timestamp the connection was last validated.
      * This flag is used to keep track when we are using a {@link PoolConfiguration#setValidationInterval(long) validation-interval}.
-     * @param lastValidated a timestamp as defined by {@link System#currentTimeMillis()} 
+     * @param lastValidated a timestamp as defined by {@link System#currentTimeMillis()}
      */
     public void setLastValidated(long lastValidated) {
         this.lastValidated = lastValidated;
@@ -546,9 +546,9 @@ public class PooledConnection {
     }
 
     /**
-     * Return the timestamps of last pool action. Timestamps are typically set when connections 
+     * Return the timestamps of last pool action. Timestamps are typically set when connections
      * are borrowed from the pool. It is used to keep track of {@link PoolConfiguration#setRemoveAbandonedTimeout(int) abandon-timeouts}.
-     * This timestamp can also be reset by the {@link org.apache.tomcat.jdbc.pool.interceptor.ResetAbandonedTimer#invoke(Object, java.lang.reflect.Method, Object[])}   
+     * This timestamp can also be reset by the {@link org.apache.tomcat.jdbc.pool.interceptor.ResetAbandonedTimer#invoke(Object, java.lang.reflect.Method, Object[])}
      * @return the timestamp of the last pool action as defined by {@link System#currentTimeMillis()}
      */
     public long getTimestamp() {
@@ -557,7 +557,7 @@ public class PooledConnection {
 
     /**
      * Returns the discarded flag.
-     * @return the discarded flag. If the value is true, 
+     * @return the discarded flag. If the value is true,
      * either {@link #disconnect(boolean)} has been called or it will be called when the connection is returned to the pool.
      */
     public boolean isDiscarded() {
@@ -565,7 +565,7 @@ public class PooledConnection {
     }
 
     /**
-     * Returns the timestamp of the last successful validation query execution. 
+     * Returns the timestamp of the last successful validation query execution.
      * @return the timestamp of the last successful validation query execution as defined by {@link System#currentTimeMillis()}
      */
     public long getLastValidated() {
@@ -581,9 +581,9 @@ public class PooledConnection {
     }
 
     /**
-     * Locks the connection only if either {@link PoolConfiguration#isPoolSweeperEnabled()} or 
+     * Locks the connection only if either {@link PoolConfiguration#isPoolSweeperEnabled()} or
      * {@link PoolConfiguration#getUseLock()} return true. The per connection lock ensures thread safety is
-     * multiple threads are performing operations on the connection. 
+     * multiple threads are performing operations on the connection.
      * Otherwise this is a noop for performance
      */
     public void lock() {
@@ -612,7 +612,7 @@ public class PooledConnection {
     public java.sql.Connection getConnection() {
         return this.connection;
     }
-    
+
     /**
      * Returns the underlying XA connection
      * @return the underlying XA connection as it was returned from the Datasource
@@ -620,8 +620,8 @@ public class PooledConnection {
     public javax.sql.XAConnection getXAConnection() {
         return this.xaConnection;
     }
-    
-    
+
+
     /**
      * Returns the timestamp of when the connection was last connected to the database.
      * ie, a successful call to {@link java.sql.Driver#connect(String, java.util.Properties)}.
@@ -645,16 +645,16 @@ public class PooledConnection {
             while (interceptor!=null) {
                 interceptor.reset(null, null);
                 interceptor = interceptor.getNext();
-            }//while 
+            }//while
         }//end if
         this.handler = handler;
     }
-    
+
     @Override
     public String toString() {
         return "PooledConnection["+(connection!=null?connection.toString():"null")+"]";
     }
-    
+
     /**
      * Returns true if this connection has been released and wont be reused.
      * @return true if the method {@link #release()} has been called
@@ -662,7 +662,7 @@ public class PooledConnection {
     public boolean isReleased() {
         return released.get();
     }
-    
+
     public HashMap<Object,Object> getAttributes() {
         return attributes;
     }

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ProxyConnection.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ProxyConnection.java?rev=1187811&r1=1187810&r2=1187811&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ProxyConnection.java (original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ProxyConnection.java Sat Oct 22 21:29:55 2011
@@ -22,7 +22,7 @@ import java.sql.SQLException;
 
 import javax.sql.XAConnection;
 /**
- * A ProxyConnection object is the bottom most interceptor that wraps an object of type 
+ * A ProxyConnection object is the bottom most interceptor that wraps an object of type
  * {@link PooledConnection}. The ProxyConnection intercepts three methods:
  * <ul>
  *   <li>{@link java.sql.Connection#close()} - returns the connection to the pool. May be called multiple times.</li>
@@ -124,7 +124,7 @@ public class ProxyConnection extends Jdb
         try {
             PooledConnection poolc = connection;
             if (poolc!=null) {
-                return method.invoke(poolc.getConnection(),args);    
+                return method.invoke(poolc.getConnection(),args);
             } else {
                 throw new SQLException("Connection has already been closed.");
             }
@@ -137,7 +137,7 @@ public class ProxyConnection extends Jdb
             }
         }
     }
-    
+
     public boolean isClosed() {
         return connection==null || connection.isDiscarded();
     }
@@ -149,7 +149,7 @@ public class ProxyConnection extends Jdb
     public ConnectionPool getParentPool() {
         return pool;
     }
-    
+
     @Override
     public String toString() {
         return "ProxyConnection["+(connection!=null?connection.toString():"null")+"]";

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/TrapException.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/TrapException.java?rev=1187811&r1=1187810&r2=1187811&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/TrapException.java (original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/TrapException.java Sat Oct 22 21:29:55 2011
@@ -31,7 +31,7 @@ import java.sql.SQLException;
  */
 public class TrapException extends JdbcInterceptor {
 
-    
+
     public TrapException() {
     }
 
@@ -43,7 +43,7 @@ public class TrapException extends JdbcI
             Throwable exception = t;
             if (t instanceof InvocationTargetException) {
                 exception = t.getCause()!=null?t.getCause():t;
-            } 
+            }
             Class<?> exceptionClass = exception.getClass();
             if (!isDeclaredException(method, exceptionClass)) {
                 if (isDeclaredException(method,SQLException.class)) {
@@ -58,16 +58,16 @@ public class TrapException extends JdbcI
             }
             throw exception;
         }
-        
+
     }
-    
+
     public boolean isDeclaredException(Method m, Class<?> clazz) {
         for (Class<?> cl : m.getExceptionTypes()) {
             if (cl.equals(clazz) || cl.isAssignableFrom(clazz)) return true;
         }
         return false;
     }
-    
+
     /**
      * no-op for this interceptor. no state is stored.
      */
@@ -75,5 +75,5 @@ public class TrapException extends JdbcI
     public void reset(ConnectionPool parent, PooledConnection con) {
         // NOOP
     }
-    
+
 }

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/Validator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/Validator.java?rev=1187811&r1=1187810&r2=1187811&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/Validator.java (original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/Validator.java Sat Oct 22 21:29:55 2011
@@ -20,13 +20,13 @@ import java.sql.Connection;
 
 /**
  * Interface to be implemented by custom validator classes.
- * 
+ *
  * @author mpassell
  */
 public interface Validator {
     /**
      * Validate a connection and return a boolean to indicate if it's valid.
-     * 
+     *
      * @param connection the Connection object to test
      * @param validateAction the action used. One of {@link PooledConnection#VALIDATE_BORROW},
      *   {@link PooledConnection#VALIDATE_IDLE}, {@link PooledConnection#VALIDATE_INIT} or

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractCreateStatementInterceptor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractCreateStatementInterceptor.java?rev=1187811&r1=1187810&r2=1187811&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractCreateStatementInterceptor.java (original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractCreateStatementInterceptor.java Sat Oct 22 21:29:55 2011
@@ -39,7 +39,7 @@ public abstract class  AbstractCreateSta
 
     protected static final String[] STATEMENT_TYPES = {CREATE_STATEMENT, PREPARE_STATEMENT, PREPARE_CALL};
     protected static final int    STATEMENT_TYPE_COUNT = STATEMENT_TYPES.length;
-    
+
     protected static final String EXECUTE        = "execute";
     protected static final String EXECUTE_QUERY  = "executeQuery";
     protected static final String EXECUTE_UPDATE = "executeUpdate";
@@ -50,7 +50,7 @@ public abstract class  AbstractCreateSta
     public  AbstractCreateStatementInterceptor() {
         super();
     }
-    
+
     /**
      * {@inheritDoc}
      */
@@ -72,7 +72,7 @@ public abstract class  AbstractCreateSta
             }
         }
     }
-    
+
     /**
      * This method will be invoked after a successful statement creation. This method can choose to return a wrapper
      * around the statement or return the statement itself.
@@ -85,15 +85,15 @@ public abstract class  AbstractCreateSta
      * @return a {@link java.sql.Statement} object
      */
     public abstract Object createStatement(Object proxy, Method method, Object[] args, Object statement, long time);
-    
+
     /**
-     * Method invoked when the operation {@link java.sql.Connection#close()} is invoked. 
+     * Method invoked when the operation {@link java.sql.Connection#close()} is invoked.
      */
     public abstract void closeInvoked();
 
     /**
      * Returns true if the method that is being invoked matches one of the statement types.
-     * 
+     *
      * @param method the method being invoked on the proxy
      * @param process boolean result used for recursion
      * @return returns true if the method name matched
@@ -104,7 +104,7 @@ public abstract class  AbstractCreateSta
 
     /**
      * Returns true if the method that is being invoked matches one of the execute types.
-     * 
+     *
      * @param method the method being invoked on the proxy
      * @param process boolean result used for recursion
      * @return returns true if the method name matched
@@ -127,7 +127,7 @@ public abstract class  AbstractCreateSta
         }
         return process;
     }
-    
+
     /**
      * no-op for this interceptor. no state is stored.
      */

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractQueryReport.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractQueryReport.java?rev=1187811&r1=1187810&r2=1187811&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractQueryReport.java (original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractQueryReport.java Sat Oct 22 21:29:55 2011
@@ -43,25 +43,25 @@ public abstract class AbstractQueryRepor
      * The threshold in milliseconds. If the query is faster than this, we don't measure it
      */
     protected long threshold = 1000; //don't report queries less than this
-    
+
     /**
-     * the constructors that are used to create statement proxies 
+     * the constructors that are used to create statement proxies
      */
     protected static final Constructor<?>[] constructors =
         new Constructor[AbstractCreateStatementInterceptor.STATEMENT_TYPE_COUNT];
 
-    
+
     public AbstractQueryReport() {
         super();
     }
-    
+
     /**
      * Invoked when prepareStatement has been called and completed.
      * @param sql - the string used to prepare the statement with
      * @param time - the time it took to invoke prepare
      */
     protected abstract void prepareStatement(String sql, long time);
-    
+
     /**
      * Invoked when prepareCall has been called and completed.
      * @param query - the string used to prepare the statement with
@@ -76,7 +76,7 @@ public abstract class AbstractQueryRepor
      * @param name the name of the method used to execute {@link AbstractCreateStatementInterceptor#isExecute(Method, boolean)}
      * @param start the time the query execution started
      * @param t the exception that happened
-     * @return - the SQL that was executed or the string &quot;batch&quot; if it was a batch execution 
+     * @return - the SQL that was executed or the string &quot;batch&quot; if it was a batch execution
      */
     protected String reportFailedQuery(String query, Object[] args, final String name, long start, Throwable t) {
         //extract the query string
@@ -95,7 +95,7 @@ public abstract class AbstractQueryRepor
      * @param name the name of the method used to execute {@link AbstractCreateStatementInterceptor#isExecute(Method, boolean)}
      * @param start the time the query execution started
      * @param delta the time the execution took
-     * @return - the SQL that was executed or the string &quot;batch&quot; if it was a batch execution 
+     * @return - the SQL that was executed or the string &quot;batch&quot; if it was a batch execution
      */
     protected String reportQuery(String query, Object[] args, final String name, long start, long delta) {
         //extract the query string
@@ -114,7 +114,7 @@ public abstract class AbstractQueryRepor
      * @param name the name of the method used to execute {@link AbstractCreateStatementInterceptor#isExecute(Method, boolean)}
      * @param start the time the query execution started
      * @param delta the time the execution took
-     * @return - the SQL that was executed or the string &quot;batch&quot; if it was a batch execution 
+     * @return - the SQL that was executed or the string &quot;batch&quot; if it was a batch execution
      */
     protected String reportSlowQuery(String query, Object[] args, final String name, long start, long delta) {
         //extract the query string
@@ -125,7 +125,7 @@ public abstract class AbstractQueryRepor
         }
         return sql;
     }
-    
+
     /**
      * returns the query measure threshold.
      * This value is in milliseconds. If the query is faster than this threshold than it wont be accounted for
@@ -211,7 +211,7 @@ public abstract class AbstractQueryRepor
             this.delegate = parent;
             this.query = query;
         }
-        
+
         @Override
         public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
             //get the name of the method for comparison
@@ -219,7 +219,7 @@ public abstract class AbstractQueryRepor
             //was close invoked?
             boolean close = compare(JdbcInterceptor.CLOSE_VAL,name);
             //allow close to be called multiple times
-            if (close && closed) return null; 
+            if (close && closed) return null;
             //are we calling isClosed?
             if (compare(JdbcInterceptor.ISCLOSED_VAL,name)) return Boolean.valueOf(closed);
             //if we are calling anything else, bail out
@@ -262,6 +262,6 @@ public abstract class AbstractQueryRepor
             }
             return result;
         }
-    }    
+    }
 
 }
\ No newline at end of file

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java?rev=1187811&r1=1187810&r2=1187811&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java (original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java Sat Oct 22 21:29:55 2011
@@ -30,11 +30,11 @@ import org.apache.tomcat.jdbc.pool.Poole
 /**
  * Interceptor that keep track of connection state to avoid roundtrips to the database.
  * The {@link org.apache.tomcat.jdbc.pool.ConnectionPool} is optimized to do as little work as possible.
- * The pool itself doesn't remember settings like {@link java.sql.Connection#setAutoCommit(boolean)}, 
+ * The pool itself doesn't remember settings like {@link java.sql.Connection#setAutoCommit(boolean)},
  * {@link java.sql.Connection#setReadOnly(boolean)}, {@link java.sql.Connection#setCatalog(String)} or
- * {@link java.sql.Connection#setTransactionIsolation(int)}. It relies on the application to remember how and when 
+ * {@link java.sql.Connection#setTransactionIsolation(int)}. It relies on the application to remember how and when
  * these settings have been applied.
- * In the cases where the application code doesn't know or want to keep track of the state, this interceptor helps cache the 
+ * In the cases where the application code doesn't know or want to keep track of the state, this interceptor helps cache the
  * state, and it also avoids roundtrips to the database asking for it.
  * @author fhanik
  *
@@ -42,7 +42,7 @@ import org.apache.tomcat.jdbc.pool.Poole
 
 public class ConnectionState extends JdbcInterceptor  {
     private static final Log log = LogFactory.getLog(ConnectionState.class);
-    
+
     protected final String[] readState = {"getAutoCommit","getTransactionIsolation","isReadOnly","getCatalog"};
     protected final String[] writeState = {"setAutoCommit","setTransactionIsolation","setReadOnly","setCatalog"};
 
@@ -50,8 +50,8 @@ public class ConnectionState extends Jdb
     protected Integer transactionIsolation = null;
     protected Boolean readOnly = null;
     protected String catalog = null;
-    
-    
+
+
     @Override
     public void reset(ConnectionPool parent, PooledConnection con) {
         if (parent==null || con==null) {
@@ -107,7 +107,7 @@ public class ConnectionState extends Jdb
                 log.error("Unable to reset default catalog state to connection.",x);
             }
         }
-        
+
     }
 
     @Override

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ResetAbandonedTimer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ResetAbandonedTimer.java?rev=1187811&r1=1187810&r2=1187811&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ResetAbandonedTimer.java (original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ResetAbandonedTimer.java Sat Oct 22 21:29:55 2011
@@ -24,7 +24,7 @@ import org.apache.tomcat.jdbc.pool.Poole
 import org.apache.tomcat.jdbc.pool.ProxyConnection;
 
 /**
- * Class that resets the abandoned timer on any activity on the 
+ * Class that resets the abandoned timer on any activity on the
  * Connection or any successful query executions.
  * This interceptor is useful for when you have a {@link org.apache.tomcat.jdbc.pool.PoolConfiguration#setRemoveAbandonedTimeout(int)}
  * that is fairly low, and you want to reset the abandoned time each time any operation on the connection is performed
@@ -37,7 +37,7 @@ public class ResetAbandonedTimer extends
     public ResetAbandonedTimer() {
         // TODO Auto-generated constructor stub
     }
-    
+
     public boolean resetTimer() {
         boolean result = false;
         JdbcInterceptor interceptor = this.getNext();

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java?rev=1187811&r1=1187810&r2=1187811&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java (original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java Sat Oct 22 21:29:55 2011
@@ -44,7 +44,7 @@ public class SlowQueryReport extends Abs
     /**
      * we will be keeping track of query stats on a per pool basis
      */
-    protected static ConcurrentHashMap<String,ConcurrentHashMap<String,QueryStats>> perPoolStats = 
+    protected static ConcurrentHashMap<String,ConcurrentHashMap<String,QueryStats>> perPoolStats =
         new ConcurrentHashMap<String,ConcurrentHashMap<String,QueryStats>>();
     /**
      * the queries that are used for this interceptor.
@@ -54,16 +54,16 @@ public class SlowQueryReport extends Abs
      * Maximum number of queries we will be storing
      */
     protected int  maxQueries= 1000; //don't store more than this amount of queries
-    
+
     /**
      * Returns the query stats for a given pool
      * @param poolname - the name of the pool we want to retrieve stats for
-     * @return a hash map containing statistics for 0 to maxQueries 
+     * @return a hash map containing statistics for 0 to maxQueries
      */
     public static ConcurrentHashMap<String,QueryStats> getPoolStats(String poolname) {
         return perPoolStats.get(poolname);
     }
-    
+
     /**
      * Creates a slow query report interceptor
      */
@@ -106,19 +106,19 @@ public class SlowQueryReport extends Abs
     public void closeInvoked() {
         queries = null;
     }
-    
+
     @Override
     public void prepareStatement(String sql, long time) {
         QueryStats qs = getQueryStats(sql);
         qs.prepare(time, System.currentTimeMillis());
     }
-    
+
     @Override
     public void prepareCall(String sql, long time) {
         QueryStats qs = getQueryStats(sql);
         qs.prepare(time, System.currentTimeMillis());
     }
-    
+
     /**
      * {@inheritDoc}
      */
@@ -138,7 +138,7 @@ public class SlowQueryReport extends Abs
             }
         }
     }
-    
+
     /**
      * {@inheritDoc}
      */
@@ -147,7 +147,7 @@ public class SlowQueryReport extends Abs
         perPoolStats.remove(pool.getName());
         super.poolClosed(pool);
     }
-    
+
     protected QueryStats getQueryStats(String sql) {
         ConcurrentHashMap<String,QueryStats> queries = SlowQueryReport.this.queries;
         if (queries==null) return null;
@@ -165,7 +165,7 @@ public class SlowQueryReport extends Abs
         }
         return qs;
     }
-    
+
     /**
      * TODO - implement a better algorithm
      * @param queries
@@ -176,14 +176,14 @@ public class SlowQueryReport extends Abs
             String sql = it.next();
             it.remove();
             if (log.isDebugEnabled()) log.debug("Removing slow query, capacity reached:"+sql);
-        } 
+        }
     }
 
 
     @Override
     public void reset(ConnectionPool parent, PooledConnection con) {
         super.reset(parent, con);
-        if (parent!=null) 
+        if (parent!=null)
             queries = SlowQueryReport.perPoolStats.get(parent.getName());
     }
 
@@ -205,7 +205,7 @@ public class SlowQueryReport extends Abs
 
 
     /**
-     * 
+     *
      * @author fhanik
      *
      */
@@ -223,7 +223,7 @@ public class SlowQueryReport extends Abs
             "prepareTime",
             "lastInvocation"
         };
-        
+
         static final  String[] FIELD_DESCRIPTIONS = new String[] {
             "The SQL query",
             "The number of query invocations, a call to executeXXX",
@@ -237,8 +237,8 @@ public class SlowQueryReport extends Abs
             "The total number of milliseconds spent preparing this query",
             "The date and time of the last invocation"
         };
-        
-        static final OpenType[] FIELD_TYPES = new OpenType[] { 
+
+        static final OpenType[] FIELD_TYPES = new OpenType[] {
             SimpleType.STRING,
             SimpleType.INTEGER,
             SimpleType.LONG,
@@ -249,7 +249,7 @@ public class SlowQueryReport extends Abs
             SimpleType.LONG,
             SimpleType.INTEGER,
             SimpleType.LONG,
-            SimpleType.LONG 
+            SimpleType.LONG
         };
 
         private final String query;
@@ -263,19 +263,19 @@ public class SlowQueryReport extends Abs
         private volatile int prepareCount;
         private volatile long prepareTime;
         private volatile long lastInvocation = 0;
-        
+
         public static String[] getFieldNames() {
             return FIELD_NAMES;
         }
-        
+
         public static String[] getFieldDescriptions() {
             return FIELD_DESCRIPTIONS;
         }
-        
+
         public static OpenType[] getFieldTypes() {
             return FIELD_TYPES;
         }
-        
+
         @Override
         public String toString() {
             StringBuilder buf = new StringBuilder("QueryStats[query:");
@@ -303,7 +303,7 @@ public class SlowQueryReport extends Abs
             buf.append("]");
             return buf.toString();
         }
-        
+
         public CompositeDataSupport getCompositeData(final CompositeType type) throws OpenDataException{
             Object[] values = new Object[] {
                     query,
@@ -320,17 +320,17 @@ public class SlowQueryReport extends Abs
             };
             return new CompositeDataSupport(type,FIELD_NAMES,values);
         }
-        
+
         public QueryStats(String query) {
             this.query = query;
         }
-        
+
         public void prepare(long invocationTime, long now) {
             prepareCount++;
             prepareTime+=invocationTime;
-            
+
         }
-        
+
         public void add(long invocationTime, long now) {
             //not thread safe, but don't sacrifice performance for this kind of stuff
             maxInvocationTime = Math.max(invocationTime, maxInvocationTime);
@@ -345,13 +345,13 @@ public class SlowQueryReport extends Abs
             totalInvocationTime+=invocationTime;
             lastInvocation = now;
         }
-        
+
         public void failure(long invocationTime, long now) {
             add(invocationTime,now);
             failures++;
-            
+
         }
-        
+
         public String getQuery() {
             return query;
         }
@@ -384,20 +384,20 @@ public class SlowQueryReport extends Abs
         public int hashCode() {
             return query.hashCode();
         }
-        
+
         @Override
         public boolean equals(Object other) {
             if (other instanceof QueryStats) {
                 QueryStats qs = (QueryStats)other;
                 return qs.query.equals(this.query);
-            } 
+            }
             return false;
         }
-        
+
         public boolean isOlderThan(QueryStats other) {
             return this.lastInvocation < other.lastInvocation;
         }
     }
-    
-    
+
+
 }

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java?rev=1187811&r1=1187810&r2=1187811&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java (original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java Sat Oct 22 21:29:55 2011
@@ -49,7 +49,7 @@ import org.apache.tomcat.jdbc.pool.Conne
 import org.apache.tomcat.jdbc.pool.PooledConnection;
 import org.apache.tomcat.jdbc.pool.PoolProperties.InterceptorProperty;
 /**
- * Publishes data to JMX and provides notifications 
+ * Publishes data to JMX and provides notifications
  * when failures happen.
  * @author fhanik
  *
@@ -58,15 +58,15 @@ public class SlowQueryReportJmx extends 
     public static final String SLOW_QUERY_NOTIFICATION = "SLOW QUERY";
     public static final String FAILED_QUERY_NOTIFICATION = "FAILED QUERY";
 
-    protected static CompositeType SLOW_QUERY_TYPE; 
-        
+    protected static CompositeType SLOW_QUERY_TYPE;
+
     private static final Log log = LogFactory.getLog(SlowQueryReportJmx.class);
-    
-    
-    protected static ConcurrentHashMap<String,SlowQueryReportJmxMBean> mbeans = 
-        new ConcurrentHashMap<String,SlowQueryReportJmxMBean>(); 
-    
-    
+
+
+    protected static ConcurrentHashMap<String,SlowQueryReportJmxMBean> mbeans =
+        new ConcurrentHashMap<String,SlowQueryReportJmxMBean>();
+
+
     //==============================JMX STUFF========================
     protected volatile NotificationBroadcasterSupport notifier = new NotificationBroadcasterSupport();
 
@@ -75,7 +75,7 @@ public class SlowQueryReportJmx extends 
         notifier.addNotificationListener(listener, filter, handback);
     }
 
-    
+
     @Override
     public MBeanNotificationInfo[] getNotificationInfo() {
         return notifier.getNotificationInfo();
@@ -84,26 +84,26 @@ public class SlowQueryReportJmx extends 
     @Override
     public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException {
         notifier.removeNotificationListener(listener);
-        
+
     }
 
     @Override
     public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException {
         notifier.removeNotificationListener(listener, filter, handback);
-        
+
     }
 
 
-    //==============================JMX STUFF========================    
-    
+    //==============================JMX STUFF========================
+
     protected String poolName = null;
-    
+
     protected static AtomicLong notifySequence = new AtomicLong(0);
-    
+
     protected boolean notifyPool = true;
-    
+
     protected ConnectionPool pool = null;
-    
+
     protected static CompositeType getCompositeType() {
         if (SLOW_QUERY_TYPE==null) {
             try {
@@ -119,7 +119,7 @@ public class SlowQueryReportJmx extends 
         }
         return SLOW_QUERY_TYPE;
     }
-    
+
     @Override
     public void reset(ConnectionPool parent, PooledConnection con) {
         // TODO Auto-generated method stub
@@ -156,20 +156,20 @@ public class SlowQueryReportJmx extends 
     protected void notifyJmx(String query, String type) {
         try {
             long sequence = notifySequence.incrementAndGet();
-            
+
             if (isNotifyPool()) {
                 if (this.pool!=null && this.pool.getJmxPool()!=null) {
                     this.pool.getJmxPool().notify(type, query);
                 }
             } else {
                 if (notifier!=null) {
-                    Notification notification = 
-                        new Notification(type, 
-                                         this, 
-                                         sequence, 
+                    Notification notification =
+                        new Notification(type,
+                                         this,
+                                         sequence,
                                          System.currentTimeMillis(),
                                          query);
-                    
+
                     notifier.sendNotification(notification);
                 }
             }
@@ -223,7 +223,7 @@ public class SlowQueryReportJmx extends 
             while (it.hasNext()) it.remove();
         }
     }
-    
+
     /**
      * JMX operation - returns all the queries we have collected.
      * @return - the slow query report as composite data.
@@ -247,7 +247,7 @@ public class SlowQueryReportJmx extends 
         }
         return result;
     }
-    
+
     protected void deregisterJmx() {
         try {
             if (mbeans.remove(poolName)!=null) {
@@ -263,7 +263,7 @@ public class SlowQueryReportJmx extends 
         } catch (RuntimeOperationsException e) {
             log.warn("Jmx deregistration failed.",e);
         }
-        
+
     }
 
 
@@ -271,12 +271,12 @@ public class SlowQueryReportJmx extends 
         ObjectName oname = new ObjectName(ConnectionPool.POOL_JMX_TYPE_PREFIX+clazz.getName()+",name=" + poolName);
         return oname;
     }
-    
+
     protected void registerJmx() {
         try {
             //only if we notify the pool itself
             if (isNotifyPool()) {
-                
+
             } else if (getCompositeType()!=null) {
                 ObjectName oname = getObjectName(getClass(),poolName);
                 if (mbeans.putIfAbsent(poolName, this)==null) {
@@ -297,7 +297,7 @@ public class SlowQueryReportJmx extends 
             log.error("Jmx registration failed, no JMX data will be exposed for the query stats.",e);
         }
     }
-    
+
     @Override
     public void setProperties(Map<String, InterceptorProperty> properties) {
         super.setProperties(properties);

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java?rev=1187811&r1=1187810&r2=1187811&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java (original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java Sat Oct 22 21:29:55 2011
@@ -28,11 +28,11 @@ import org.apache.tomcat.jdbc.pool.Poole
 import org.apache.tomcat.jdbc.pool.PoolProperties.InterceptorProperty;
 
 public class StatementCache extends StatementDecoratorInterceptor {
-    protected static final String[] ALL_TYPES = new String[] {PREPARE_STATEMENT,PREPARE_CALL}; 
-    protected static final String[] CALLABLE_TYPE = new String[] {PREPARE_CALL}; 
-    protected static final String[] PREPARED_TYPE = new String[] {PREPARE_STATEMENT}; 
+    protected static final String[] ALL_TYPES = new String[] {PREPARE_STATEMENT,PREPARE_CALL};
+    protected static final String[] CALLABLE_TYPE = new String[] {PREPARE_CALL};
+    protected static final String[] PREPARED_TYPE = new String[] {PREPARE_STATEMENT};
     protected static final String[] NO_TYPE = new String[] {};
-    
+
     protected static final String STATEMENT_CACHE_ATTR = StatementCache.class.getName() + ".cache";
 
     /*begin properties for the statement cache*/
@@ -41,8 +41,8 @@ public class StatementCache extends Stat
     private int maxCacheSize = 50;
     private PooledConnection pcon;
     private String[] types;
-    
-    
+
+
     public boolean isCachePrepared() {
         return cachePrepared;
     }
@@ -81,14 +81,14 @@ public class StatementCache extends Stat
         } else {
             this.types = NO_TYPE;
         }
-    
+
     }
     /*end properties for the statement cache*/
-    
+
     /*begin the cache size*/
-    private static ConcurrentHashMap<ConnectionPool,AtomicInteger> cacheSizeMap = 
+    private static ConcurrentHashMap<ConnectionPool,AtomicInteger> cacheSizeMap =
         new ConcurrentHashMap<ConnectionPool,AtomicInteger>();
-    
+
     private AtomicInteger cacheSize;
 
     @Override
@@ -96,14 +96,14 @@ public class StatementCache extends Stat
         cacheSizeMap.putIfAbsent(pool, new AtomicInteger(0));
         super.poolStarted(pool);
     }
-    
+
     @Override
     public void poolClosed(ConnectionPool pool) {
         cacheSizeMap.remove(pool);
         super.poolClosed(pool);
     }
     /*end the cache size*/
-    
+
     /*begin the actual statement cache*/
     @Override
     public void reset(ConnectionPool parent, PooledConnection con) {
@@ -120,30 +120,30 @@ public class StatementCache extends Stat
             }
         }
     }
-    
+
     @Override
     public void disconnected(ConnectionPool parent, PooledConnection con, boolean finalizing) {
-        ConcurrentHashMap<String,CachedStatement> statements = 
+        ConcurrentHashMap<String,CachedStatement> statements =
             (ConcurrentHashMap<String,CachedStatement>)con.getAttributes().get(STATEMENT_CACHE_ATTR);
-        
+
         if (statements!=null) {
             for (Map.Entry<String, CachedStatement> p : statements.entrySet()) {
                 closeStatement(p.getValue());
             }
             statements.clear();
         }
-        
+
         super.disconnected(parent, con, finalizing);
     }
-    
+
     public void closeStatement(CachedStatement st) {
         if (st==null) return;
         st.forceClose();
     }
-    
+
     @Override
-    protected Object createDecorator(Object proxy, Method method, Object[] args, 
-                                     Object statement, Constructor<?> constructor, String sql) 
+    protected Object createDecorator(Object proxy, Method method, Object[] args,
+                                     Object statement, Constructor<?> constructor, String sql)
     throws InstantiationException, IllegalAccessException, InvocationTargetException {
         boolean process = process(this.types, method, false);
         if (process) {
@@ -175,15 +175,15 @@ public class StatementCache extends Stat
             return super.invoke(proxy,method,args);
         }
     }
-    
+
     public CachedStatement isCached(String sql) {
-        ConcurrentHashMap<String,CachedStatement> cache = 
+        ConcurrentHashMap<String,CachedStatement> cache =
             (ConcurrentHashMap<String,CachedStatement>)pcon.getAttributes().get(STATEMENT_CACHE_ATTR);
         return cache.get(sql);
     }
-    
+
     public boolean cacheStatement(CachedStatement proxy) {
-        ConcurrentHashMap<String,CachedStatement> cache = 
+        ConcurrentHashMap<String,CachedStatement> cache =
             (ConcurrentHashMap<String,CachedStatement>)pcon.getAttributes().get(STATEMENT_CACHE_ATTR);
         if (proxy.getSql()==null) {
             return false;
@@ -202,7 +202,7 @@ public class StatementCache extends Stat
     }
 
     public boolean removeStatement(CachedStatement proxy) {
-        ConcurrentHashMap<String,CachedStatement> cache = 
+        ConcurrentHashMap<String,CachedStatement> cache =
             (ConcurrentHashMap<String,CachedStatement>)pcon.getAttributes().get(STATEMENT_CACHE_ATTR);
         if (cache.remove(proxy.getSql()) != null) {
             cacheSize.decrementAndGet();
@@ -213,13 +213,13 @@ public class StatementCache extends Stat
     }
     /*end the actual statement cache*/
 
-    
+
     protected class CachedStatement extends StatementDecoratorInterceptor.StatementProxy<Statement> {
         boolean cached = false;
         public CachedStatement(Statement parent, String sql) {
             super(parent, sql);
         }
-        
+
         @Override
         public void closeInvoked() {
             //should we cache it
@@ -240,22 +240,22 @@ public class StatementCache extends Stat
                 } catch (Exception x) {
                     removeStatement(proxy);
                 }
-            } 
+            }
             closed = true;
             delegate = null;
             if (shouldClose) {
                 super.closeInvoked();
             }
-           
+
         }
-        
+
         public void forceClose() {
             removeStatement(this);
             super.closeInvoked();
         }
-        
+
     }
-    
+
 }
 
 

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java?rev=1187811&r1=1187810&r2=1187811&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java (original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementDecoratorInterceptor.java Sat Oct 22 21:29:55 2011
@@ -5,17 +5,17 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
- 
+
+
 package org.apache.tomcat.jdbc.pool.interceptor;
 
 import java.lang.reflect.Constructor;
@@ -61,7 +61,7 @@ public class StatementDecoratorIntercept
 
     /**
      * Creates a constructor for a proxy class, if one doesn't already exist
-     * 
+     *
      * @param idx
      *            - the index of the constructor
      * @param clazz
@@ -119,8 +119,8 @@ public class StatementDecoratorIntercept
         return statement;
     }
 
-    protected Object createDecorator(Object proxy, Method method, Object[] args, 
-                                     Object statement, Constructor<?> constructor, String sql) 
+    protected Object createDecorator(Object proxy, Method method, Object[] args,
+                                     Object statement, Constructor<?> constructor, String sql)
     throws InstantiationException, IllegalAccessException, InvocationTargetException {
         Object result = null;
         StatementProxy<Statement> statementProxy =
@@ -142,12 +142,12 @@ public class StatementDecoratorIntercept
 
     /**
      * Class to measure query execute time
-     * 
+     *
      * @author fhanik
-     * 
+     *
      */
     protected class StatementProxy<T extends java.sql.Statement> implements InvocationHandler {
-        
+
         protected boolean closed = false;
         protected T delegate;
         private Object actualProxy;
@@ -162,13 +162,13 @@ public class StatementDecoratorIntercept
         public T getDelegate() {
             return this.delegate;
         }
-        
+
         public String getSql() {
             return sql;
         }
 
         public void setConnection(Object proxy) {
-            this.connection = proxy;            
+            this.connection = proxy;
         }
         public Object getConnection() {
             return this.connection;
@@ -180,8 +180,8 @@ public class StatementDecoratorIntercept
         public Object getActualProxy() {
             return this.actualProxy;
         }
-        
-        
+
+
         public Constructor getConstructor() {
             return constructor;
         }
@@ -198,7 +198,7 @@ public class StatementDecoratorIntercept
             closed = true;
             delegate = null;
         }
-        
+
         @Override
         public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
             if (compare(TOSTRING_VAL,method)) {
@@ -244,7 +244,7 @@ public class StatementDecoratorIntercept
             }
             return result;
         }
-        
+
         @Override
         public String toString() {
             StringBuffer buf = new StringBuffer(StatementProxy.class.getName());

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java?rev=1187811&r1=1187810&r2=1187811&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java (original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java Sat Oct 22 21:29:55 2011
@@ -33,9 +33,9 @@ import org.apache.tomcat.jdbc.pool.Poole
  */
 public class StatementFinalizer extends AbstractCreateStatementInterceptor {
     private static final Log log = LogFactory.getLog(StatementFinalizer.class);
-    
+
     protected ArrayList<WeakReference<Statement>> statements = new ArrayList<WeakReference<Statement>>();
-    
+
     @Override
     public Object createStatement(Object proxy, Method method, Object[] args, Object statement, long time) {
         // TODO Auto-generated method stub
@@ -47,7 +47,7 @@ public class StatementFinalizer extends 
         }
         return statement;
     }
-    
+
     @Override
     public void closeInvoked() {
         while (statements.size()>0) {
@@ -70,6 +70,6 @@ public class StatementFinalizer extends 
         statements.clear();
         super.reset(parent, con);
     }
-    
-    
+
+
 }

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/mbeans-descriptors.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/mbeans-descriptors.xml?rev=1187811&r1=1187810&r2=1187811&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/mbeans-descriptors.xml (original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/mbeans-descriptors.xml Sat Oct 22 21:29:55 2011
@@ -17,7 +17,7 @@
 -->
 <mbeans-descriptors>
 
-  <mbean description="Reports " domain="tomcat.jdbc" group="jdbc-pool" name="SlowQueryReportJmx" 
+  <mbean description="Reports " domain="tomcat.jdbc" group="jdbc-pool" name="SlowQueryReportJmx"
          type="org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReportJmx">
 
     <attribute description="The name of the connection pool this Jmx bean is representing" name="poolName" type="java.lang.String" writeable="false"/>
@@ -28,7 +28,7 @@
     <notification description="Notification sent out by the slow query report when a query exceeds the threshhold" name="slow-query">
       <notification-type>Slow query</notification-type>
     </notification>
-    
+
     <notification description="Notification sent out by the slow query report when a query fails execution" name="failed-query">
       <notification-type>Failed query execution</notification-type>
     </notification>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message