Author: markt
Date: Tue Jun 19 10:12:19 2018
New Revision: 1833800
URL: http://svn.apache.org/viewvc?rev=1833800&view=rev
Log:
Fill in the gaps in the Javadoc
Modified:
tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/BasicDataSource.java
tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolingConnection.java
tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolingDriver.java
tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/datasources/InstanceKeyDataSourceFactory.java
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=1833800&r1=1833799&r2=1833800&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/BasicDataSource.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/BasicDataSource.java Tue Jun
19 10:12:19 2018
@@ -2040,6 +2040,7 @@ public class BasicDataSource implements
* Creates (if necessary) and return the internal data source we are using
to manage our connections.
* </p>
*
+ * @return The current internal DataSource or a newly created instance if
it has not yet been created.
* @throws SQLException
* if the object pool cannot be created.
*/
@@ -2134,6 +2135,11 @@ public class BasicDataSource implements
* <li>If a driver still isn't loaded one is loaded via the {@link
DriverManager} using the specified {@link #url}.
* </ol>
* This method exists so subclasses can replace the implementation class.
+ *
+ * @return A new connection factory.
+ *
+ * @throws SQLException
+ * If the connection factort cannot be created
*/
protected ConnectionFactory createConnectionFactory() throws SQLException {
// Load the JDBC driver class
@@ -2209,6 +2215,9 @@ public class BasicDataSource implements
* property is deferred to {@link #startPoolMaintenance()}, since setting
timeBetweenEvictionRunsMillis to a
* positive value causes {@link GenericObjectPool}'s eviction timer to be
started.
* </p>
+ *
+ * @param factory
+ * The factory to use to create new connections for this pool.
*/
protected void createConnectionPool(final PoolableConnectionFactory
factory) {
// Create an object pool to contain our active connections
@@ -2288,6 +2297,8 @@ public class BasicDataSource implements
*
* @throws SQLException
* if unable to create a datasource instance
+ *
+ * @return A new DataSource instance
*/
protected DataSource createDataSourceInstance() throws SQLException {
final PoolingDataSource<PoolableConnection> pds = new
PoolingDataSource<>(connectionPool);
@@ -2303,6 +2314,8 @@ public class BasicDataSource implements
* JDBC connection factory
* @throws SQLException
* if an error occurs creating the PoolableConnectionFactory
+ *
+ * @return A new PoolableConnectionFactory configured with the current
configuration of this BasicDataSource
*/
protected PoolableConnectionFactory createPoolableConnectionFactory(final
ConnectionFactory driverConnectionFactory)
throws SQLException {
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=1833800&r1=1833799&r2=1833800&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolingConnection.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolingConnection.java Tue
Jun 19 10:12:19 2018
@@ -121,6 +121,8 @@ public class PoolingConnection extends D
*
* @param sql
* the SQL string used to define the statement
+ *
+ * @return the PStmtKey created for the given arguments.
*/
protected PStmtKey createKey(final String sql) {
String catalog = null;
@@ -149,6 +151,8 @@ public class PoolingConnection extends D
* the SQL string used to define the statement
* @param columnIndexes
* column indexes
+ *
+ * @return the PStmtKey created for the given arguments.
*/
protected PStmtKey createKey(final String sql, final int columnIndexes[]) {
String catalog = null;
@@ -169,6 +173,8 @@ public class PoolingConnection extends D
* result set type
* @param resultSetConcurrency
* result set concurrency
+ *
+ * @return the PStmtKey created for the given arguments.
*/
protected PStmtKey createKey(final String sql, final int resultSetType,
final int resultSetConcurrency) {
String catalog = null;
@@ -191,6 +197,8 @@ public class PoolingConnection extends D
* result set concurrency
* @param resultSetHoldability
* result set holdability
+ *
+ * @return the PStmtKey created for the given arguments.
*/
protected PStmtKey createKey(final String sql, final int resultSetType,
final int resultSetConcurrency,
final int resultSetHoldability) {
@@ -216,6 +224,8 @@ public class PoolingConnection extends D
* result set holdability
* @param stmtType
* statement type
+ *
+ * @return the PStmtKey created for the given arguments.
*/
protected PStmtKey createKey(final String sql, final int resultSetType,
final int resultSetConcurrency,
final int resultSetHoldability, final StatementType stmtType) {
@@ -240,6 +250,8 @@ public class PoolingConnection extends D
* result set concurrency
* @param stmtType
* statement type
+ *
+ * @return the PStmtKey created for the given arguments.
*/
protected PStmtKey createKey(final String sql, final int resultSetType,
final int resultSetConcurrency,
final StatementType stmtType) {
@@ -259,6 +271,8 @@ public class PoolingConnection extends D
* the SQL string used to define the statement
* @param stmtType
* statement type
+ *
+ * @return the PStmtKey created for the given arguments.
*/
protected PStmtKey createKey(final String sql, final StatementType
stmtType) {
String catalog = null;
@@ -277,6 +291,8 @@ public class PoolingConnection extends D
* the SQL string used to define the statement
* @param columnNames
* column names
+ *
+ * @return the PStmtKey created for the given arguments.
*/
protected PStmtKey createKey(final String sql, final String columnNames[])
{
String catalog = null;
@@ -331,6 +347,10 @@ public class PoolingConnection extends D
/**
* Normalizes the given SQL statement, producing a canonical form that is
semantically equivalent to the original.
+ *
+ * @param sql The statement to be normalized.
+ *
+ * @return The canonical form of the supplied SQL statement.
*/
protected String normalizeSQL(final String sql) {
return sql.trim();
Modified: tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolingDriver.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolingDriver.java?rev=1833800&r1=1833799&r2=1833800&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolingDriver.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolingDriver.java Tue Jun
19 10:12:19 2018
@@ -61,6 +61,9 @@ public class PoolingDriver implements Dr
/**
* For unit testing purposes.
+ *
+ * @param accessToUnderlyingConnectionAllowed
+ * Do {@link DelegatingConnection}s created by this driver
permit access to the delegate?
*/
protected PoolingDriver(final boolean accessToUnderlyingConnectionAllowed)
{
this.accessToUnderlyingConnectionAllowed =
accessToUnderlyingConnectionAllowed;
Modified:
tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/datasources/InstanceKeyDataSourceFactory.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/datasources/InstanceKeyDataSourceFactory.java?rev=1833800&r1=1833799&r2=1833800&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/datasources/InstanceKeyDataSourceFactory.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/datasources/InstanceKeyDataSourceFactory.java
Tue Jun 19 10:12:19 2018
@@ -287,17 +287,40 @@ abstract class InstanceKeyDataSourceFact
}
/**
+ * @param className
+ * The class name to test.
+ *
* @return true if and only if className is the value returned from
getClass().getName().toString()
*/
protected abstract boolean isCorrectClass(String className);
/**
* Creates an instance of the subclass and sets any properties contained
in the Reference.
+ *
+ * @param ref
+ * The properties to be set on the created DataSource
+ *
+ * @return A configured DataSource of the appropriate type.
+ *
+ * @throws ClassNotFoundException
+ * If a class cannot be found during the deserialization of a
configuration parameter.
+ * @throws IOException
+ * If an I/O error occurs during the deserialization of a
configuration parameter.
*/
protected abstract InstanceKeyDataSource getNewInstance(Reference ref)
throws IOException, ClassNotFoundException;
/**
- * Sets some properties saved within a Reference
+ * Deserializes the provided byte array to create an object.
+ *
+ * @param data
+ * Data to deserialize to create the configuration parameter.
+ *
+ * @return The Object created by deserializing the data.
+ *
+ * @throws ClassNotFoundException
+ * If a class cannot be found during the deserialization of a
configuration parameter.
+ * @throws IOException
+ * If an I/O error occurs during the deserialization of a
configuration parameter.
*/
protected static final Object deserialize(final byte[] data) throws
IOException, ClassNotFoundException {
ObjectInputStream in = null;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]