db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpendle...@apache.org
Subject svn commit: r380722 - in /db/derby/code/trunk: java/drda/org/apache/derby/impl/drda/ java/testing/org/apache/derbyTesting/functionTests/master/ java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ java/testing/org/apache/derbyTesting/fun...
Date Fri, 24 Feb 2006 17:25:30 GMT
Author: bpendleton
Date: Fri Feb 24 09:25:26 2006
New Revision: 380722

URL: http://svn.apache.org/viewcvs?rev=380722&view=rev
Log:
DERBY-515 Network Server should log server start and shutdown time to derby.log

Patch contributed by Deepa Remesh.

Summary of patch:

* Removes identical master files in DerbyNetClient and DerbyNet for
derbynet/NSinSameJVM.java and moves it the top master directory.

* Modified tools/release/build.xml to point to the new master file.

* Adds comments as to why CheapDateFormatter and GMT is used to format
timestamp. Moves formatting of timestamp to a method getFormattedTimestamp().
This will be helpful if timestamp is planned to be used for more messages
as Kathey indicated. 


Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/NSinSameJVM.out
  (with props)
Removed:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/NSinSameJVM.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/NSinSameJVM.out
Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
    db/derby/code/trunk/tools/release/build.xml

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java?rev=380722&r1=380721&r2=380722&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
(original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
Fri Feb 24 09:25:26 2006
@@ -561,10 +561,10 @@
 		// sure we print the error message before doing so (Beetle 5033).
 			throwUnexpectedException(e);
 		}
-		long startTime = System.currentTimeMillis();
+		
 		consolePropertyMessage("DRDA_Ready.I", new String [] 
                     {Integer.toString(portNumber), att_srvclsnm, versionString,
-					CheapDateFormatter.formatDate(startTime)});
+					getFormattedTimestamp()});
 		
 		// We accept clients on a separate thread so we don't run into a problem
 		// blocking on the accept when trying to process a shutdown
@@ -651,10 +651,9 @@
 		}
 		*/
 
-		long shutdownTime = System.currentTimeMillis();
 		consolePropertyMessage("DRDA_ShutdownSuccess.I", new String [] 
 						        {att_srvclsnm, versionString, 
-								CheapDateFormatter.formatDate(shutdownTime)});
+								getFormattedTimestamp()});
 		
 
     }
@@ -1712,10 +1711,9 @@
 				break;
 			case COMMAND_SHUTDOWN:
 				shutdown();
-				long shutdownTime = System.currentTimeMillis();
 				consolePropertyMessage("DRDA_ShutdownSuccess.I", new String [] 
 								{att_srvclsnm, versionString, 
-								CheapDateFormatter.formatDate(shutdownTime)});
+								getFormattedTimestamp()});
 				break;
 			case COMMAND_TRACE:
 				{
@@ -3321,6 +3319,18 @@
 		return myPVH;
 	}
 
+	/**
+	 * This method returns a timestamp to be used in the messages. 
+	 * CheapDateFormatter class, which uses GMT, is used to format timestamps. 
+	 * This is to keep the formatting consistent with Derby boot message since
+	 * network server messages and the boot message get written to derby.log.   
+	 * 
+	 * @return current timestamp formatted in GMT
+	 */
+	private String getFormattedTimestamp(){
+		long currentTime = System.currentTimeMillis();
+		return CheapDateFormatter.formatDate(currentTime);
+	}
 }
 
 

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/NSinSameJVM.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/NSinSameJVM.out?rev=380722&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/NSinSameJVM.out
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/NSinSameJVM.out
Fri Feb 24 09:25:26 2006
@@ -0,0 +1,6 @@
+main-NSinSameJVM: Derby drivers loaded
+Apache Derby Network Server - 10.2.0.0 alpha started and ready to accept connections on port
20000 at xxxxxxFILTERED-TIMESTAMPxxxxxGMT 
+main-NSinSameJVM: NetworkServer started
+main-NSinSameJVM: Connected to database NSinSameJVMTestDB;create=true
+getting ready to shutdown
+Apache Derby Network Server - 10.2.0.0 alpha shutdown at xxxxxxFILTERED-TIMESTAMPxxxxxGMT

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/NSinSameJVM.out
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/tools/release/build.xml
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/tools/release/build.xml?rev=380722&r1=380721&r2=380722&view=diff
==============================================================================
--- db/derby/code/trunk/tools/release/build.xml (original)
+++ db/derby/code/trunk/tools/release/build.xml Fri Feb 24 09:25:26 2006
@@ -270,10 +270,7 @@
       <param name="regex.file" value="java/testing/org/apache/derbyTesting/functionTests/master/dbMetaDataJdbc30.out"/>
     </antcall>
     <antcall target="regex.version"> 
-      <param name="regex.file" value="java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/NSinSameJVM.out"/>
-    </antcall>
-    <antcall target="regex.version"> 
-      <param name="regex.file" value="java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/NSinSameJVM.out"/>
+      <param name="regex.file" value="java/testing/org/apache/derbyTesting/functionTests/master/NSinSameJVM.out"/>
     </antcall>
     <antcall target="regex.version"> 
       <param name="regex.file" value="java/testing/org/apache/derbyTesting/functionTests/master/testProperties.out"/>



Mime
View raw message