Author: markt Date: Tue Sep 23 12:51:46 2014 New Revision: 1626989 URL: http://svn.apache.org/r1626989 Log: Update to latest DBCP 2 code (r1626987) - Javadoc fixes - Custom eviction policy fix
Modified: tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/ (props changed) tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/BasicDataSource.java tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingConnection.java tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingDatabaseMetaData.java tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingResultSet.java tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingStatement.java tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolableConnectionFactory.java tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolingConnection.java tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/cpdsadapter/PooledConnectionImpl.java tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/datasources/CPDSConnectionFactory.java tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/datasources/KeyedCPDSConnectionFactory.java tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/package-info.java Propchange: tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/ ------------------------------------------------------------------------------ Merged /commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2:r1609330-1626988 Modified: tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/BasicDataSource.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/BasicDataSource.java?rev=1626989&r1=1626988&r2=1626989&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/BasicDataSource.java (original) +++ tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/BasicDataSource.java Tue Sep 23 12:51:46 2014 @@ -1308,7 +1308,7 @@ public class BasicDataSource implements * Returns the value of the flag that controls whether or not connections * being returned to the pool will checked and configured with * {@link Connection#setAutoCommit(boolean) Connection.setAutoCommit(true)} - * if the auto commit setting is <code>false</false> when the connection + * if the auto commit setting is {@code false} when the connection * is returned. It is <code>true</code> by default. */ public boolean getEnableAutoCommitOnReturn() { @@ -1319,7 +1319,7 @@ public class BasicDataSource implements * Sets the value of the flag that controls whether or not connections * being returned to the pool will checked and configured with * {@link Connection#setAutoCommit(boolean) Connection.setAutoCommit(true)} - * if the auto commit setting is <code>false</false> when the connection + * if the auto commit setting is {@code false} when the connection * is returned. It is <code>true</code> by default. */ public void setEnableAutoCommitOnReturn(boolean enableAutoCommitOnReturn) { @@ -2078,6 +2078,7 @@ public class BasicDataSource implements gop.setTestWhileIdle(testWhileIdle); gop.setLifo(lifo); gop.setSwallowedExceptionListener(new SwallowedExceptionLogger(log)); + gop.setEvictionPolicyClassName(evictionPolicyClassName); factory.setPool(gop); connectionPool = gop; } Modified: tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingConnection.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingConnection.java?rev=1626989&r1=1626988&r2=1626989&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingConnection.java (original) +++ tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingConnection.java Tue Sep 23 12:51:46 2014 @@ -162,17 +162,17 @@ public class DelegatingConnection<C exte /** * If my underlying {@link Connection} is not a - * <tt>DelegatingConnection</tt>, returns it, + * {@code DelegatingConnection}, returns it, * otherwise recursively invokes this method on * my delegate. * <p> * Hence this method will return the first - * delegate that is not a <tt>DelegatingConnection</tt>, - * or <tt>null</tt> when no non-<tt>DelegatingConnection</tt> + * delegate that is not a {@code DelegatingConnection}, + * or {@code null} when no non-{@code DelegatingConnection} * delegate can be found by traversing this chain. * <p> * This method is useful when you may have nested - * <tt>DelegatingConnection</tt>s, and you want to make + * {@code DelegatingConnection}s, and you want to make * sure to obtain a "genuine" {@link Connection}. */ public Connection getInnermostDelegate() { Modified: tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingDatabaseMetaData.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingDatabaseMetaData.java?rev=1626989&r1=1626988&r2=1626989&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingDatabaseMetaData.java (original) +++ tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingDatabaseMetaData.java Tue Sep 23 12:51:46 2014 @@ -52,17 +52,17 @@ public class DelegatingDatabaseMetaData /** * If my underlying {@link ResultSet} is not a - * <tt>DelegatingResultSet</tt>, returns it, + * {@code DelegatingResultSet}, returns it, * otherwise recursively invokes this method on * my delegate. * <p> * Hence this method will return the first - * delegate that is not a <tt>DelegatingResultSet</tt>, - * or <tt>null</tt> when no non-<tt>DelegatingResultSet</tt> + * delegate that is not a {@code DelegatingResultSet}, + * or {@code null} when no non-{@code DelegatingResultSet} * delegate can be found by transversing this chain. * <p> * This method is useful when you may have nested - * <tt>DelegatingResultSet</tt>s, and you want to make + * {@code DelegatingResultSet}s, and you want to make * sure to obtain a "genuine" {@link ResultSet}. */ public DatabaseMetaData getInnermostDelegate() { Modified: tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingResultSet.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingResultSet.java?rev=1626989&r1=1626988&r2=1626989&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingResultSet.java (original) +++ tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingResultSet.java Tue Sep 23 12:51:46 2014 @@ -121,17 +121,17 @@ public final class DelegatingResultSet e /** * If my underlying {@link ResultSet} is not a - * <tt>DelegatingResultSet</tt>, returns it, + * {@code DelegatingResultSet}, returns it, * otherwise recursively invokes this method on * my delegate. * <p> * Hence this method will return the first - * delegate that is not a <tt>DelegatingResultSet</tt>, - * or <tt>null</tt> when no non-<tt>DelegatingResultSet</tt> + * delegate that is not a {@code DelegatingResultSet}, + * or {@code null} when no non-{@code DelegatingResultSet} * delegate can be found by transversing this chain. * <p> * This method is useful when you may have nested - * <tt>DelegatingResultSet</tt>s, and you want to make + * {@code DelegatingResultSet}s, and you want to make * sure to obtain a "genuine" {@link ResultSet}. */ public ResultSet getInnermostDelegate() { Modified: tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingStatement.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingStatement.java?rev=1626989&r1=1626988&r2=1626989&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingStatement.java (original) +++ tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/DelegatingStatement.java Tue Sep 23 12:51:46 2014 @@ -74,17 +74,17 @@ public class DelegatingStatement extends /** * If my underlying {@link Statement} is not a - * <tt>DelegatingStatement</tt>, returns it, + * {@code DelegatingStatement}, returns it, * otherwise recursively invokes this method on * my delegate. * <p> * Hence this method will return the first - * delegate that is not a <tt>DelegatingStatement</tt> - * or <tt>null</tt> when no non-<tt>DelegatingStatement</tt> + * delegate that is not a {@code DelegatingStatement} + * or {@code null} when no non-{@code DelegatingStatement} * delegate can be found by transversing this chain. * <p> * This method is useful when you may have nested - * <tt>DelegatingStatement</tt>s, and you want to make + * {@code DelegatingStatement}s, and you want to make * sure to obtain a "genuine" {@link Statement}. * @see #getDelegate */ Modified: tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolableConnectionFactory.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolableConnectionFactory.java?rev=1626989&r1=1626988&r2=1626989&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolableConnectionFactory.java (original) +++ tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolableConnectionFactory.java Tue Sep 23 12:51:46 2014 @@ -52,7 +52,7 @@ public class PoolableConnectionFactory LogFactory.getLog(PoolableConnectionFactory.class); /** - * Create a new <tt>PoolableConnectionFactory</tt>. + * Create a new {@code PoolableConnectionFactory}. * @param connFactory the {@link ConnectionFactory} from which to obtain * base {@link Connection}s */ @@ -87,7 +87,7 @@ public class PoolableConnectionFactory /** * Sets the SQL statements I use to initialize newly created {@link Connection}s. - * Using <tt>null</tt> turns off connection initialization. + * Using {@code null} turns off connection initialization. * @param connectionInitSqls SQL statement to initialize {@link Connection}s. */ public void setConnectionInitSql(Collection<String> connectionInitSqls) { Modified: tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolingConnection.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolingConnection.java?rev=1626989&r1=1626988&r2=1626989&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolingConnection.java (original) +++ tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolingConnection.java Tue Sep 23 12:51:46 2014 @@ -364,7 +364,7 @@ public class PoolingConnection extends D * * @param key ignored * @param p ignored - * @return <tt>true</tt> + * @return {@code true} */ @Override public boolean validateObject(PStmtKey key, Modified: tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/cpdsadapter/PooledConnectionImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/cpdsadapter/PooledConnectionImpl.java?rev=1626989&r1=1626988&r2=1626989&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/cpdsadapter/PooledConnectionImpl.java (original) +++ tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/cpdsadapter/PooledConnectionImpl.java Tue Sep 23 12:51:46 2014 @@ -78,7 +78,7 @@ class PooledConnectionImpl implements Po */ private boolean isClosed; - /** My pool of {*link PreparedStatement}s. */ + /** My pool of {@link PreparedStatement}s. */ private KeyedObjectPool<PStmtKeyCPDS, PoolablePreparedStatement<PStmtKeyCPDS>> pstmtPool = null; /** @@ -360,14 +360,14 @@ class PooledConnectionImpl implements Po } /** - * Create a {*link PooledConnectionImpl.PStmtKey} for the given arguments. + * Create a {@link PooledConnectionImpl.PStmtKey} for the given arguments. */ protected PStmtKeyCPDS createKey(String sql, int autoGeneratedKeys) { return new PStmtKeyCPDS(normalizeSQL(sql), autoGeneratedKeys); } /** - * Create a {*link PooledConnectionImpl.PStmtKey} for the given arguments. + * Create a {@link PooledConnectionImpl.PStmtKey} for the given arguments. */ protected PStmtKeyCPDS createKey(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) { @@ -376,21 +376,21 @@ class PooledConnectionImpl implements Po } /** - * Create a {*link PooledConnectionImpl.PStmtKey} for the given arguments. + * Create a {@link PooledConnectionImpl.PStmtKey} for the given arguments. */ protected PStmtKeyCPDS createKey(String sql, int columnIndexes[]) { return new PStmtKeyCPDS(normalizeSQL(sql), columnIndexes); } /** - * Create a {*link PooledConnectionImpl.PStmtKey} for the given arguments. + * Create a {@link PooledConnectionImpl.PStmtKey} for the given arguments. */ protected PStmtKeyCPDS createKey(String sql, String columnNames[]) { return new PStmtKeyCPDS(normalizeSQL(sql), columnNames); } /** - * Create a {*link PooledConnectionImpl.PStmtKey} for the given arguments. + * Create a {@link PooledConnectionImpl.PStmtKey} for the given arguments. */ protected PStmtKeyCPDS createKey(String sql, int resultSetType, int resultSetConcurrency) { @@ -399,7 +399,7 @@ class PooledConnectionImpl implements Po } /** - * Create a {*link PooledConnectionImpl.PStmtKey} for the given arguments. + * Create a {@link PooledConnectionImpl.PStmtKey} for the given arguments. */ protected PStmtKeyCPDS createKey(String sql) { return new PStmtKeyCPDS(normalizeSQL(sql)); @@ -414,9 +414,9 @@ class PooledConnectionImpl implements Po } /** - * My {*link KeyedPoolableObjectFactory} method for creating - * {*link PreparedStatement}s. - * @param key the key for the {*link PreparedStatement} to be created + * My {@link KeyedPooledObjectFactory} method for creating + * {@link PreparedStatement}s. + * @param key the key for the {@link PreparedStatement} to be created */ @Override public PooledObject<PoolablePreparedStatement<PStmtKeyCPDS>> makeObject(PStmtKeyCPDS key) throws Exception { @@ -444,10 +444,10 @@ class PooledConnectionImpl implements Po } /** - * My {*link KeyedPoolableObjectFactory} method for destroying - * {*link PreparedStatement}s. + * My {@link KeyedPooledObjectFactory} method for destroying + * {@link PreparedStatement}s. * @param key ignored - * @param p the wrapped {*link PreparedStatement} to be destroyed. + * @param p the wrapped {@link PreparedStatement} to be destroyed. */ @Override public void destroyObject(PStmtKeyCPDS key, @@ -457,11 +457,11 @@ class PooledConnectionImpl implements Po } /** - * My {*link KeyedPoolableObjectFactory} method for validating - * {*link PreparedStatement}s. + * My {@link KeyedPooledObjectFactory} method for validating + * {@link PreparedStatement}s. * @param key ignored * @param p ignored - * @return <tt>true</tt> + * @return {@code true} */ @Override public boolean validateObject(PStmtKeyCPDS key, @@ -470,8 +470,8 @@ class PooledConnectionImpl implements Po } /** - * My {*link KeyedPoolableObjectFactory} method for activating - * {*link PreparedStatement}s. + * My {@link KeyedPooledObjectFactory} method for activating + * {@link PreparedStatement}s. * @param key ignored * @param p ignored */ @@ -483,10 +483,10 @@ class PooledConnectionImpl implements Po } /** - * My {*link KeyedPoolableObjectFactory} method for passivating - * {*link PreparedStatement}s. Currently invokes {*link PreparedStatement#clearParameters}. + * My {@link KeyedPooledObjectFactory} method for passivating + * {@link PreparedStatement}s. Currently invokes {@link PreparedStatement#clearParameters}. * @param key ignored - * @param p a wrapped {*link PreparedStatement} + * @param p a wrapped {@link PreparedStatement} */ @Override public void passivateObject(PStmtKeyCPDS key, Modified: tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/datasources/CPDSConnectionFactory.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/datasources/CPDSConnectionFactory.java?rev=1626989&r1=1626988&r2=1626989&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/datasources/CPDSConnectionFactory.java (original) +++ tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/datasources/CPDSConnectionFactory.java Tue Sep 23 12:51:46 2014 @@ -75,13 +75,13 @@ class CPDSConnectionFactory new ConcurrentHashMap<>(); /** - * Create a new <tt>PoolableConnectionFactory</tt>. + * Create a new {@code PoolableConnectionFactory}. * * @param cpds the ConnectionPoolDataSource from which to obtain * PooledConnection's * @param validationQuery a query to use to {@link #validateObject * validate} {@link Connection}s. Should return at least one row. - * May be <tt>null</tt> in which case {@link Connection#isValid(int)} will + * May be {@code null} in which case {@link Connection#isValid(int)} will * be used to validate connections. * @param validationQueryTimeout Timeout in seconds before validation fails * @param rollbackAfterValidation whether a rollback should be issued Modified: tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/datasources/KeyedCPDSConnectionFactory.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/datasources/KeyedCPDSConnectionFactory.java?rev=1626989&r1=1626988&r2=1626989&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/datasources/KeyedCPDSConnectionFactory.java (original) +++ tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/datasources/KeyedCPDSConnectionFactory.java Tue Sep 23 12:51:46 2014 @@ -38,8 +38,8 @@ import org.apache.tomcat.dbcp.pool2.Pool import org.apache.tomcat.dbcp.pool2.impl.DefaultPooledObject; /** - * A {*link PoolableObjectFactory} that creates - * {*link PoolableConnection}s. + * A {@link KeyedPooledObjectFactory} that creates + * {@link PoolableConnection}s. * * @author John D. McNally * @since 2.0 @@ -74,12 +74,12 @@ class KeyedCPDSConnectionFactory /** - * Create a new <tt>KeyedPoolableConnectionFactory</tt>. + * Create a new {@code KeyedPoolableConnectionFactory}. * @param cpds the ConnectionPoolDataSource from which to obtain * PooledConnections * @param validationQuery a query to use to {@link #validateObject validate} * {@link Connection}s. Should return at least one row. May be - * <tt>null</tt> in which case3 {@link Connection#isValid(int)} will be used + * {@code null} in which case3 {@link Connection#isValid(int)} will be used * to validate connections. * @param rollbackAfterValidation whether a rollback should be issued after * {@link #validateObject validating} {@link Connection}s. Modified: tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/package-info.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/package-info.java?rev=1626989&r1=1626988&r2=1626989&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/package-info.java (original) +++ tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/package-info.java Tue Sep 23 12:51:46 2014 @@ -113,7 +113,7 @@ * To create a {@link org.apache.tomcat.dbcp.dbcp2.PoolingDriver}, we do the same thing, * except that instead of creating a {@link javax.sql.DataSource} on the last line, * we create a {@link org.apache.tomcat.dbcp.dbcp2.PoolingDriver}, and register the - * <tt>connectionPool</tt> with it. E.g.,: + * {@code connectionPool} with it. E.g.,: * <pre>GenericObjectPool connectionPool = new GenericObjectPool(null); * ConnectionFactory connectionFactory = new DriverManagerConnectionFactory("jdbc:some:connect:string", "username", "password"); * PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org