Update of /cvsroot/cayenne/cayenne/src/cayenne/java/org/objectstyle/cayenne/conn
In directory usw-pr-cvs1:/tmp/cvs-serv25586/src/cayenne/java/org/objectstyle/cayenne/conn
Modified Files:
ConnectionWrapper.java DriverDataSource.java
PoolDataSource.java PoolManager.java PooledConnectionImpl.java
Log Message:
refactoring - cleaning import statements, fixing API docs
Index: ConnectionWrapper.java
===================================================================
RCS file: /cvsroot/cayenne/cayenne/src/cayenne/java/org/objectstyle/cayenne/conn/ConnectionWrapper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ConnectionWrapper.java 8 Sep 2002 22:46:47 -0000 1.1
+++ ConnectionWrapper.java 4 Oct 2002 04:23:51 -0000 1.2
@@ -55,20 +55,25 @@
*
*/
-import java.sql.*;
+import java.sql.CallableStatement;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.sql.Savepoint;
+import java.sql.Statement;
import java.util.Map;
/**
- * <p>Cayenne specific java.sql.Connection implementation that allowes to pool
- * JDBC connections when a driver used does not support pooled connections.
+ * <p>ConnectionWrapper is a <code>java.sql.Connection</code> implementation that
+ * allows to pool JDBC connections when a driver used does not support pooled connections.
* This implementation will wrap existing connection object obtained elsewhere,
* delegating all the calls to it, except for "close" method that is
* implemented to return connection to the pool and "isClosed" method that
* returns true if connection was returned to the pool or closed by the pool.</p>
- *
- * <p>Because of the overhead involved when calling connection methods, this class
- * should only be used when a corresponding driver does not support connection
- * pooling at all.</p>
+ *
+ * @author Andrei Adamchik
*/
public class ConnectionWrapper implements Connection {
private Connection connectionObj;
Index: DriverDataSource.java
===================================================================
RCS file: /cvsroot/cayenne/cayenne/src/cayenne/java/org/objectstyle/cayenne/conn/DriverDataSource.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- DriverDataSource.java 8 Sep 2002 22:46:47 -0000 1.1
+++ DriverDataSource.java 4 Oct 2002 04:23:51 -0000 1.2
@@ -56,15 +56,17 @@
*/
import java.io.PrintWriter;
-import java.sql.*;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
import javax.sql.DataSource;
/**
- * Class that wrapps "old-style" JDBC access via Drivers
- * to "new-style" access via DataSource. Also provides things like
- * connection pooling, etc...
- *
+ * DriverDataSource is a simple DataSource implementation
+ * on top of a JDBC driver.
+ *
+ * @author Andrei Adamchik
*/
public class DriverDataSource implements DataSource {
private int loginTimeout;
Index: PoolDataSource.java
===================================================================
RCS file: /cvsroot/cayenne/cayenne/src/cayenne/java/org/objectstyle/cayenne/conn/PoolDataSource.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- PoolDataSource.java 8 Sep 2002 22:46:47 -0000 1.1
+++ PoolDataSource.java 4 Oct 2002 04:23:51 -0000 1.2
@@ -57,17 +57,22 @@
import java.io.PrintWriter;
import java.sql.SQLException;
-import org.apache.log4j.Logger;
-import javax.sql.*;
+import javax.sql.ConnectionPoolDataSource;
+import javax.sql.DataSource;
+import javax.sql.PooledConnection;
+
+import org.apache.log4j.Logger;
/**
- * <p>This class allows to generate pooled connections.</p>
- *
- * <p>It is implemented as a wrapper around a non-pooled data source object. Delegates all method
- * calls except for "getPooledConnection" to the underlying datasource...
- * </p>
+ * <p>PoolDataSource allows to generate pooled connections.</p>
*
+ * <p>It is implemented as a wrapper around a non-pooled data source object.
+ * Delegates all method calls except for "getPooledConnection" to the underlying
+ * datasource.
+ * </p>
+ *
+ * @author Andrei Adamchik
*/
public class PoolDataSource implements ConnectionPoolDataSource {
static Logger logObj = Logger.getLogger(PoolDataSource.class.getName());
Index: PoolManager.java
===================================================================
RCS file: /cvsroot/cayenne/cayenne/src/cayenne/java/org/objectstyle/cayenne/conn/PoolManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- PoolManager.java 8 Sep 2002 22:46:47 -0000 1.1
+++ PoolManager.java 4 Oct 2002 04:23:51 -0000 1.2
@@ -61,15 +61,18 @@
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.ListIterator;
-import org.apache.log4j.Logger;
-import javax.sql.*;
+import javax.sql.ConnectionEvent;
+import javax.sql.ConnectionEventListener;
+import javax.sql.ConnectionPoolDataSource;
+import javax.sql.DataSource;
+import javax.sql.PooledConnection;
+
+import org.apache.log4j.Logger;
/**
- * PoolManager is a DataSource impementation that hides connection pooling logic
- * from the users, acting as a normal DataSource. Application servers may provide
- * their own DataSources that handle pooling. In such cases Cayenne should
- * use app server specific implementation instead of PoolManager.
+ * PoolManager is a pooling DataSource impementation.
+ * It wraps a non-pooling datasource.
*
* <p>TODO: create a low priority thread that will do pool maintenance.</p>
*
Index: PooledConnectionImpl.java
===================================================================
RCS file: /cvsroot/cayenne/cayenne/src/cayenne/java/org/objectstyle/cayenne/conn/PooledConnectionImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- PooledConnectionImpl.java 8 Sep 2002 22:46:47 -0000 1.1
+++ PooledConnectionImpl.java 4 Oct 2002 04:23:51 -0000 1.2
@@ -59,14 +59,20 @@
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Iterator;
-import org.apache.log4j.Logger;
-import javax.sql.*;
+import javax.sql.ConnectionEvent;
+import javax.sql.ConnectionEventListener;
+import javax.sql.PooledConnection;
+
+import org.apache.log4j.Logger;
/**
- * Cayenne implementation of the pooling wrapper for the database connection
- * as per J2EE spec. Most of the modern JDBC drivers should have its
- * own implementation that should be used instead of this class...
+ * PooledConnectionImpl is an implementation of a pooling wrapper
+ * for the database connection as per JDBC3 spec. Most of the modern
+ * JDBC drivers should have its own implementation that may be
+ * used instead of this class.
+ *
+ * @author Andrei Adamchik
*/
public class PooledConnectionImpl implements PooledConnection {
static Logger logObj = Logger.getLogger(PooledConnectionImpl.class.getName());
|