db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1505928 - in /db/derby/code/trunk/java/client/org/apache/derby: client/ client/am/ client/net/ jdbc/
Date Tue, 23 Jul 2013 08:07:21 GMT
Author: kahatlen
Date: Tue Jul 23 08:07:21 2013
New Revision: 1505928

URL: http://svn.apache.org/r1505928
Log:
DERBY-1028: Change constructors in NetConnection classes to use LogWriter instead of NetLogWriter

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java
    db/derby/code/trunk/java/client/org/apache/derby/client/ClientXAConnection.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/Agent.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientJDBCObjectFactory.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetAgent.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetXAConnection.java
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSourceRoot.java
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java?rev=1505928&r1=1505927&r2=1505928&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java Tue
Jul 23 08:07:21 2013
@@ -37,7 +37,6 @@ import org.apache.derby.client.am.LogWri
 import org.apache.derby.client.am.LogicalConnection;
 import org.apache.derby.client.am.SqlException;
 import org.apache.derby.client.am.stmtcache.JDBCStatementCache;
-import org.apache.derby.client.net.NetLogWriter;
 import org.apache.derby.client.net.NetXAConnection;
 import org.apache.derby.iapi.error.ExceptionSeverity;
 import org.apache.derby.jdbc.ClientBaseDataSourceRoot;
@@ -131,7 +130,7 @@ public class ClientPooledConnection impl
             
             physicalConnection_ =
             ClientDriver.getFactory().newNetConnection(
-                    (NetLogWriter) logWriter_,
+                    logWriter_,
                     user,
                     password,
                     ds,
@@ -175,7 +174,7 @@ public class ClientPooledConnection impl
 
         try {
             netXAPhysicalConnection_ = new NetXAConnection(
-                    (NetLogWriter)logWriter,
+                    logWriter,
                     user,
                     password,
                     ds,

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/ClientXAConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/ClientXAConnection.java?rev=1505928&r1=1505927&r2=1505928&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/ClientXAConnection.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/ClientXAConnection.java Tue Jul
23 08:07:21 2013
@@ -26,8 +26,8 @@ import javax.sql.XAConnection;
 import javax.transaction.xa.XAResource;
 
 import org.apache.derby.client.am.ClientMessageId;
+import org.apache.derby.client.am.LogWriter;
 import org.apache.derby.client.am.SqlException;
-import org.apache.derby.client.net.NetLogWriter;
 import org.apache.derby.client.net.NetXAConnection;
 import org.apache.derby.client.net.NetXAResource;
 import org.apache.derby.jdbc.ClientBaseDataSourceRoot;
@@ -47,7 +47,7 @@ public class ClientXAConnection extends 
     private NetXAConnection controlCon_ = null;
 
     public ClientXAConnection(ClientBaseDataSourceRoot ds,
-                              NetLogWriter logWtr,
+                              LogWriter logWtr,
                               String userId,
                               String password) throws SQLException {
         super(ds, logWtr, userId, password, getUnigueRmId());

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Agent.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/Agent.java?rev=1505928&r1=1505927&r2=1505928&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Agent.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Agent.java Tue Jul 23 08:07:21
2013
@@ -156,9 +156,6 @@ public abstract class Agent {
         return (logWriter_ == null) ? null : logWriter_.printWriter_;
     }
 
-    abstract public LogWriter newLogWriter_(
-        PrintWriter printWriter, int traceLevel);
-
     //----------------------------------------------------------------------------
 
 

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientJDBCObjectFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientJDBCObjectFactory.java?rev=1505928&r1=1505927&r2=1505928&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientJDBCObjectFactory.java
(original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientJDBCObjectFactory.java
Tue Jul 23 08:07:21 2013
@@ -212,7 +212,7 @@ public interface ClientJDBCObjectFactory
      * this implements the java.sql.Connection interface
      */
     ClientConnection newNetConnection(
-            LogWriter netLogWriter,
+            LogWriter logWriter,
             int driverManagerLoginTimeout,String serverName,
             int portNumber,String databaseName, Properties properties)
             throws SqlException;
@@ -223,7 +223,7 @@ public interface ClientJDBCObjectFactory
      * implements the {@code java.sql.Connection} interface.
      */
     ClientConnection newNetConnection(
-            LogWriter netLogWriter,
+            LogWriter logWriter,
             String user,
             String password,
             ClientBaseDataSourceRoot dataSource,
@@ -238,7 +238,7 @@ public interface ClientJDBCObjectFactory
      * object to the NetConnection object which can then be used to pass the 
      * statement events back to the user
      *
-     * @param netLogWriter placeholder for NetLogWriter object associated with this connection
+     * @param logWriter    LogWriter object associated with this connection
      * @param user         user id for this connection
      * @param password     password for this connection
      * @param dataSource   The DataSource object passed from the PooledConnection 
@@ -252,7 +252,7 @@ public interface ClientJDBCObjectFactory
      * @throws             SqlException
      */
     ClientConnection newNetConnection(
-            LogWriter netLogWriter,
+            LogWriter logWriter,
             String user,String password,
             ClientBaseDataSourceRoot dataSource,int rmId,
             boolean isXAConn,ClientPooledConnection cpc) throws SqlException;

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl.java?rev=1505928&r1=1505927&r2=1505928&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl.java
(original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl.java
Tue Jul 23 08:07:21 2013
@@ -90,8 +90,7 @@ public class ClientJDBCObjectFactoryImpl
     public ClientXAConnection newClientXAConnection(ClientBaseDataSourceRoot ds,
         LogWriter logWriter,String user, String password) throws SQLException
     {
-        return new ClientXAConnection(ds,
-            (NetLogWriter)logWriter,user,password);
+        return new ClientXAConnection(ds, logWriter, user, password);
     }
     /**
      * Returns an instance of ClientCallableStatement.
@@ -269,7 +268,7 @@ public class ClientJDBCObjectFactoryImpl
      * @return an instance of {@link org.apache.derby.client.net.NetConnection}
      */
     public ClientConnection newNetConnection(
-            LogWriter netLogWriter,
+            LogWriter logWriter,
             int driverManagerLoginTimeout,
             String serverName,
             int portNumber,
@@ -277,7 +276,7 @@ public class ClientJDBCObjectFactoryImpl
             Properties properties) throws SqlException {
 
         return new NetConnection(
-                (NetLogWriter)netLogWriter,
+                logWriter,
                 driverManagerLoginTimeout,
                 serverName,
                 portNumber,
@@ -288,14 +287,13 @@ public class ClientJDBCObjectFactoryImpl
      * @return an instance of {@link org.apache.derby.client.net.NetConnection}
      */
     public ClientConnection newNetConnection(
-            LogWriter netLogWriter,String user,
-            String password,
+            LogWriter logWriter, String user, String password,
             ClientBaseDataSourceRoot dataSource,
             int rmId,
             boolean isXAConn) throws SqlException {
 
         return new NetConnection(
-                (NetLogWriter)netLogWriter,
+                logWriter,
                 user,
                 password,
                 dataSource,
@@ -305,8 +303,7 @@ public class ClientJDBCObjectFactoryImpl
 
     /**
      * Returns an instance of NetConnection.
-     * @param netLogWriter Placeholder for NetLogWriter object associated
-     *                     with this connection.
+     * @param logWriter    LogWriter object associated with this connection.
      * @param user         user id for this connection.
      * @param password     password for this connection.
      * @param dataSource   The DataSource object passed from the PooledConnection
@@ -321,14 +318,14 @@ public class ClientJDBCObjectFactoryImpl
      * @throws             SqlException
      */
     public ClientConnection newNetConnection(
-            LogWriter netLogWriter,String user,
+            LogWriter logWriter,String user,
             String password,
             ClientBaseDataSourceRoot dataSource,
             int rmId,boolean isXAConn,
             ClientPooledConnection cpc) throws SqlException {
 
         return new NetConnection(
-            (NetLogWriter)netLogWriter,
+            logWriter,
             user,
             password,
             dataSource,

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetAgent.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetAgent.java?rev=1505928&r1=1505927&r2=1505928&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetAgent.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetAgent.java Tue Jul 23 08:07:21
2013
@@ -24,7 +24,6 @@ package org.apache.derby.client.net;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.io.PrintWriter;
 import java.net.Socket;
 import java.net.SocketException;
 import java.security.AccessController;
@@ -437,11 +436,6 @@ public class NetAgent extends Agent {
         
     // ----------------------- call-down methods ---------------------------------
 
-    public LogWriter newLogWriter_(PrintWriter printWriter,
-                                                              int traceLevel) {
-        return new NetLogWriter(printWriter, traceLevel);
-    }
-
     protected void markChainBreakingException_() {
         setSvrcod(CodePoint.SVRCOD_ERROR);
     }

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection.java?rev=1505928&r1=1505927&r2=1505928&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection.java Tue Jul
23 08:07:21 2013
@@ -188,34 +188,15 @@ public class NetConnection extends Clien
 
     //---------------------constructors/finalizer---------------------------------
 
-    NetConnection(NetLogWriter netLogWriter,
-                         String databaseName,
-                         Properties properties) throws SqlException {
-        super(netLogWriter, 0, "", -1, databaseName, properties);
-        this.pooledConnection_ = null;
-        this.closeStatementsOnClose = true;
-    }
-
-    NetConnection(
-            NetLogWriter netLogWriter,
-            ClientBaseDataSourceRoot dataSource,
-            String user,
-            String password) throws SqlException {
-
-        super(netLogWriter, user, password, dataSource);
-        this.pooledConnection_ = null;
-        this.closeStatementsOnClose = true;
-        setDeferredResetPassword(password);
-    }
-
     // For jdbc 1 connections
-    NetConnection(NetLogWriter netLogWriter,
+    NetConnection(LogWriter logWriter,
                          int driverManagerLoginTimeout,
                          String serverName,
                          int portNumber,
                          String databaseName,
                          Properties properties) throws SqlException {
-        super(netLogWriter, driverManagerLoginTimeout, serverName, portNumber, databaseName,
properties);
+        super(logWriter, driverManagerLoginTimeout, serverName, portNumber,
+              databaseName, properties);
         this.pooledConnection_ = null;
         this.closeStatementsOnClose = true;
         netAgent_ = (NetAgent) super.agent_;
@@ -234,13 +215,13 @@ public class NetConnection extends Clien
     }
 
     // For JDBC 2 Connections
-    NetConnection(NetLogWriter netLogWriter,
+    NetConnection(LogWriter logWriter,
                          String user,
                          String password,
                          ClientBaseDataSourceRoot dataSource,
                          int rmId,
                          boolean isXAConn) throws SqlException {
-        super(netLogWriter, user, password, isXAConn, dataSource);
+        super(logWriter, user, password, isXAConn, dataSource);
         this.pooledConnection_ = null;
         this.closeStatementsOnClose = true;
         netAgent_ = (NetAgent) super.agent_;
@@ -253,7 +234,7 @@ public class NetConnection extends Clien
      * to enable the NetConnection to pass <code>this</code> on to the associated

      * prepared statement object thus enabling the prepared statement object 
      * to in turn raise the statement events to the ClientPooledConnection object
-     * @param netLogWriter NetLogWriter object associated with this connection
+     * @param logWriter    LogWriter object associated with this connection
      * @param user         user id for this connection
      * @param password     password for this connection
      * @param dataSource   The DataSource object passed from the PooledConnection 
@@ -267,14 +248,14 @@ public class NetConnection extends Clien
      * @throws             SqlException
      */
     
-    NetConnection(NetLogWriter netLogWriter,
+    NetConnection(LogWriter logWriter,
                          String user,
                          String password,
                          ClientBaseDataSourceRoot dataSource,
                          int rmId,
                          boolean isXAConn,
                          ClientPooledConnection cpc) throws SqlException {
-        super(netLogWriter, user, password, isXAConn, dataSource);
+        super(logWriter, user, password, isXAConn, dataSource);
         netAgent_ = (NetAgent) super.agent_;
         initialize(password, dataSource, isXAConn);
         this.pooledConnection_=cpc;
@@ -989,7 +970,7 @@ public class NetConnection extends Clien
             int clientSSLMode) throws SqlException {
 
         return new NetAgent(this,
-                (NetLogWriter) logWriter,
+                logWriter,
                 loginTimeout,
                 serverName,
                 portNumber,

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetXAConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetXAConnection.java?rev=1505928&r1=1505927&r2=1505928&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetXAConnection.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetXAConnection.java Tue Jul
23 08:07:21 2013
@@ -28,6 +28,7 @@ import org.apache.derby.client.am.Client
 
 import org.apache.derby.client.ClientPooledConnection;
 import org.apache.derby.client.am.ClientMessageId;
+import org.apache.derby.client.am.LogWriter;
 import org.apache.derby.jdbc.ClientBaseDataSourceRoot;
 import org.apache.derby.shared.common.reference.SQLState;
 
@@ -46,7 +47,7 @@ public class NetXAConnection {    
      * used to raise StatementEvents from any PreparedStatement that
      * would be created from that NetConnection.
      *
-     * @param netLogWriter NetLogWriter object associated with this connection
+     * @param logWriter    LogWriter object associated with this connection
      * @param user         user id for this connection
      * @param password     password for this connection
      * @param dataSource   The DataSource object passed from the ClientXAConnection 
@@ -61,7 +62,7 @@ public class NetXAConnection {    
      * 
      */
     public NetXAConnection(
-            NetLogWriter netLogWriter,
+            LogWriter logWriter,
             String user,
             String password,
             ClientBaseDataSourceRoot dataSource,
@@ -69,7 +70,7 @@ public class NetXAConnection {    
             boolean isXAConn,
             ClientPooledConnection cpc) throws SqlException {
 
-        netCon = createNetConnection (netLogWriter, user, password, 
+        netCon = createNetConnection(logWriter, user, password,
                 dataSource, rmId, isXAConn,cpc);
         checkPlatformVersion();
     }
@@ -210,7 +211,7 @@ public class NetXAConnection {    
      * Creates NetConnection for the supported version of jdbc.
      * This method can be overwritten to return NetConnection
      * of the supported jdbc version.
-     * @param netLogWriter NetLogWriter object associated with this connection
+     * @param logWriter    LogWriter object associated with this connection
      * @param user         user id for this connection
      * @param password     password for this connection
      * @param dataSource   The DataSource object passed from the ClientXAConnection 
@@ -225,7 +226,7 @@ public class NetXAConnection {    
      *
      */
     private NetConnection createNetConnection (
-            NetLogWriter netLogWriter,
+            LogWriter logWriter,
             String user,
             String password,
             ClientBaseDataSourceRoot dataSource,
@@ -234,6 +235,6 @@ public class NetXAConnection {    
             ClientPooledConnection cpc) throws SqlException {
 
         return (NetConnection)ClientDriver.getFactory().newNetConnection
-            (netLogWriter, user, password,dataSource, rmId, isXAConn,cpc);
+            (logWriter, user, password,dataSource, rmId, isXAConn,cpc);
     }
 }

Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSourceRoot.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSourceRoot.java?rev=1505928&r1=1505927&r2=1505928&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSourceRoot.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSourceRoot.java Tue
Jul 23 08:07:21 2013
@@ -1201,7 +1201,7 @@ public abstract class ClientBaseDataSour
                                       String user, String password)
             throws SqlException {
         return ClientDriver.getFactory().newNetConnection(
-                (NetLogWriter)dncLogWriter, user, password, this, -1, false);
+                dncLogWriter, user, password, this, -1, false);
 
     }
 
@@ -1329,12 +1329,11 @@ public abstract class ClientBaseDataSour
     }
 
     protected final XAConnection getXAConnectionMinion() throws SQLException {
-        NetLogWriter dncLogWriter = null;
+        LogWriter dncLogWriter = null;
         try {
             updateDataSourceValues(
                     tokenizeAttributes(getConnectionAttributes(), null));
-            dncLogWriter = (NetLogWriter)
-                    computeDncLogWriterForNewConnection("_xads");
+            dncLogWriter = computeDncLogWriterForNewConnection("_xads");
             return getXAConnectionX(
                     dncLogWriter, this, getUser(), getPassword());
         } catch (SqlException se) {
@@ -1348,13 +1347,12 @@ public abstract class ClientBaseDataSour
     protected final XAConnection getXAConnectionMinion(
             String user, String password) throws SQLException {
 
-        NetLogWriter dncLogWriter = null;
+        LogWriter dncLogWriter = null;
         try
         {
             updateDataSourceValues(
                     tokenizeAttributes(getConnectionAttributes(), null));
-            dncLogWriter = (NetLogWriter)
-                    computeDncLogWriterForNewConnection("_xads");
+            dncLogWriter = computeDncLogWriterForNewConnection("_xads");
             return getXAConnectionX(dncLogWriter, this, user, password);
         }
         catch ( SqlException se )

Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java?rev=1505928&r1=1505927&r2=1505928&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java Tue Jul 23 08:07:21
2013
@@ -41,7 +41,6 @@ import org.apache.derby.client.am.Client
 import org.apache.derby.client.am.LogWriter;
 import org.apache.derby.client.net.ClientJDBCObjectFactoryImpl;
 import org.apache.derby.client.net.NetConnection;
-import org.apache.derby.client.net.NetLogWriter;
 import org.apache.derby.shared.common.reference.Attribute;
 import org.apache.derby.shared.common.reference.SQLState;
 import org.apache.derby.shared.common.reference.MessageId;
@@ -167,7 +166,7 @@ public class ClientDriver implements Dri
             
             
             conn = (NetConnection)getFactory().
-                    newNetConnection((NetLogWriter)dncLogWriter,
+                    newNetConnection(dncLogWriter,
                     DriverManager.getLoginTimeout(),
                     server,
                     port,



Mime
View raw message