db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r378388 - in /db/derby/code/trunk: java/drda/org/apache/derby/impl/drda/ java/drda/org/apache/derby/loc/drda/ java/testing/org/apache/derbyTesting/functionTests/master/ java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ jav...
Date Thu, 16 Feb 2006 22:52:41 GMT
Author: kmarsden
Date: Thu Feb 16 14:52:37 2006
New Revision: 378388

URL: http://svn.apache.org/viewcvs?rev=378388&view=rev
Log:
* Changes network server start and shutdown messages to include product name, version and
timestamp. I changed the messages to what Kathey suggested. With the patch, messages will
look like this:
Apache Derby Network Server - 10.2.0.0 alpha started and ready to accept connections on port
1527 at 2006-02-15 03:42:51.676 GMT
Apache Derby Network Server - 10.2.0.0 alpha shutdown at 2006-02-15 03:49:14.988 GMT

* Changes only English messages. The first parameter for start message is kept the same.

* Modifies NetworkServerControlImpl to pass in the additional parameters to the messages.
Formatiing of timestamp is done same way as it is done for Derby boot message.

* Modifies master files.

* Since the changed master files contain version information, they are added to tools\release\build.xml
so that version will get bumped at release time.


I chose GMT to keep it consistent with what is used for Derby boot message. The network server
start and shutdown messages get printed along with derby boot messages in derby.log. Something
like this:

Contributed by Deepa Remesh


Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
    db/derby/code/trunk/java/drda/org/apache/derby/loc/drda/messages_en.properties
    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
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProperties.out
    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=378388&r1=378387&r2=378388&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
Thu Feb 16 14:52:37 2006
@@ -62,6 +62,7 @@
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.tools.i18n.LocalizedOutput;
 import org.apache.derby.iapi.tools.i18n.LocalizedResource;
+import org.apache.derby.iapi.util.CheapDateFormatter;
 import org.apache.derby.iapi.util.StringUtil;
 import org.apache.derby.impl.jdbc.EmbedSQLException;
 
@@ -149,6 +150,7 @@
     protected static byte[] prdIdBytes_;
     
 	private static String buildNumber;
+	private static String versionString;
 	// we will use single or mixed, not double byte to reduce traffic on the
 	// wire, this is in keeping with JCC
 	// Note we specify UTF8 for the single byte encoding even though it can
@@ -323,7 +325,8 @@
 		att_extnam = ATT_SRVNAM + " " + java.lang.Thread.currentThread().getName();
 		
 		att_srvclsnm = myPVH.getProductName();
-
+		versionString = myPVH.getVersionBuildString(false);
+		
 		String majorStr = String.valueOf(myPVH.getMajorVersion());
 		String minorStr = String.valueOf(myPVH.getMinorVersion());
 		// Maintenance version. Server protocol version.
@@ -558,9 +561,11 @@
 		// sure we print the error message before doing so (Beetle 5033).
 			throwUnexpectedException(e);
 		}
-
-		consolePropertyMessage("DRDA_Ready.I", Integer.toString(portNumber));
-
+		long startTime = System.currentTimeMillis();
+		consolePropertyMessage("DRDA_Ready.I", new String [] 
+                    {Integer.toString(portNumber), att_srvclsnm, versionString,
+					CheapDateFormatter.formatDate(startTime)});
+		
 		// 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
 		acceptClients = (Runnable)new ClientThread(this, serverSocket);
@@ -646,8 +651,10 @@
 		}
 		*/
 
-
-		consolePropertyMessage("DRDA_ShutdownSuccess.I");
+		long shutdownTime = System.currentTimeMillis();
+		consolePropertyMessage("DRDA_ShutdownSuccess.I", new String [] 
+						        {att_srvclsnm, versionString, 
+								CheapDateFormatter.formatDate(shutdownTime)});
 		
 
     }
@@ -1705,7 +1712,10 @@
 				break;
 			case COMMAND_SHUTDOWN:
 				shutdown();
-				consolePropertyMessage("DRDA_ShutdownSuccess.I");
+				long shutdownTime = System.currentTimeMillis();
+				consolePropertyMessage("DRDA_ShutdownSuccess.I", new String [] 
+								{att_srvclsnm, versionString, 
+								CheapDateFormatter.formatDate(shutdownTime)});
 				break;
 			case COMMAND_TRACE:
 				{

Modified: db/derby/code/trunk/java/drda/org/apache/derby/loc/drda/messages_en.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/loc/drda/messages_en.properties?rev=378388&r1=378387&r2=378388&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/loc/drda/messages_en.properties (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/loc/drda/messages_en.properties Thu Feb
16 14:52:37 2006
@@ -7,12 +7,12 @@
 DRDA_UnexpectedException.S=Unexpected exception:\n {0}
 DRDA_ListenPort.S=Could not listen on port {0} on host {1}.
 DRDA_NoInputStream.S=Could not get input stream for client socket.
-DRDA_Ready.I=Server is ready to accept connections on port {0}.
+DRDA_Ready.I={1} Network Server - {2} started and ready to accept connections on port {0}
at {3} 
 DRDA_UnableToAccept.S=Unable to accept connections.
 DRDA_ConnNumber.I=Connection number: {0}.
 DRDA_ClientSocketError.S=Error on client socket:\n {0}
 DRDA_ListenerClose.S=Unable to close the listener thread.
-DRDA_ShutdownSuccess.I=Shutdown successful.
+DRDA_ShutdownSuccess.I={0} Network Server - {1} shutdown at {2}
 DRDA_ShutdownWarning.I=Derby shutdown warning:\n {0}
 DRDA_ShutdownError.S=Unable to shutdown server on port  {0} on host {1}.
 DRDA_BootSuccess.I=Booting database, {0}, successful.

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/NSinSameJVM.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/NSinSameJVM.out?rev=378388&r1=378387&r2=378388&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/NSinSameJVM.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/NSinSameJVM.out
Thu Feb 16 14:52:37 2006
@@ -1,6 +1,6 @@
 main-NSinSameJVM: Derby drivers loaded
-Server is ready to accept connections on port 20000.
+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
-Shutdown successful.
+Apache Derby Network Server - 10.2.0.0 alpha shutdown at xxxxxxFILTERED-TIMESTAMPxxxxxGMT

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/NSinSameJVM.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/NSinSameJVM.out?rev=378388&r1=378387&r2=378388&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/NSinSameJVM.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/NSinSameJVM.out
Thu Feb 16 14:52:37 2006
@@ -1,6 +1,6 @@
 main-NSinSameJVM: Derby drivers loaded
-Server is ready to accept connections on port 20000.
+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
-Shutdown successful.
+Apache Derby Network Server - 10.2.0.0 alpha shutdown at xxxxxxFILTERED-TIMESTAMPxxxxxGMT

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProperties.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProperties.out?rev=378388&r1=378387&r2=378388&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProperties.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProperties.out
Thu Feb 16 14:52:37 2006
@@ -3,21 +3,21 @@
 org.apache.derby.drda.NetworkServerControl start 
 Successfully Connected
 org.apache.derby.drda.NetworkServerControl shutdown 
-Shutdown successful.
+Apache Derby Network Server - 10.2.0.0 alpha shutdown at xxxxxxFILTERED-TIMESTAMPxxxxxGMT
 Testing System properties  Port 1529 
 -----Dderby.drda.portNumber=1529 org.apache.derby.drda.NetworkServerControl start 
 Successfully Connected
 org.apache.derby.drda.NetworkServerControl shutdown -p 1529 
-Shutdown successful.
+Apache Derby Network Server - 10.2.0.0 alpha shutdown at xxxxxxFILTERED-TIMESTAMPxxxxxGMT
 Testing command line option. Port 1530
 org.apache.derby.drda.NetworkServerControl start -p 1530 
 Successfully Connected
 org.apache.derby.drda.NetworkServerControl shutdown -p 1530 
-Shutdown successful.
+Apache Derby Network Server - 10.2.0.0 alpha shutdown at xxxxxxFILTERED-TIMESTAMPxxxxxGMT
 Testing start server by specifying system properties without values
 First shutdown server started on default port by the test harness
 org.apache.derby.drda.NetworkServerControl shutdown -p 1527 
-Shutdown successful.
+Apache Derby Network Server - 10.2.0.0 alpha shutdown at xxxxxxFILTERED-TIMESTAMPxxxxxGMT
 -----Dderby.drda.logConnections -Dderby.drda.traceAll -Dderby.drda.traceDirectory -Dderby.drda.keepAlive
-Dderby.drda.timeSlice -Dderby.drda.host -Dderby.drda.portNumber -Dderby.drda.minThreads -Dderby.drda.maxThreads
-Dderby.drda.startNetworkServer -Dderby.drda.debug org.apache.derby.drda.NetworkServerControl
start 
 ----- listing properties --
 derby.drda.maxThreads=0
@@ -58,7 +58,7 @@
 derby.drda.host=xxxFILTERED_HOSTNAMExxx
 derby.drda.traceAll=false
 org.apache.derby.drda.NetworkServerControl shutdown -p 1527 
-Shutdown successful.
+Apache Derby Network Server - 10.2.0.0 alpha shutdown at xxxxxxFILTERED-TIMESTAMPxxxxxGMT
 org.apache.derby.drda.NetworkServerControl 
 No arguments given.
 Usage: NetworkServerControl <commands> 

Modified: db/derby/code/trunk/tools/release/build.xml
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/tools/release/build.xml?rev=378388&r1=378387&r2=378388&view=diff
==============================================================================
--- db/derby/code/trunk/tools/release/build.xml (original)
+++ db/derby/code/trunk/tools/release/build.xml Thu Feb 16 14:52:37 2006
@@ -269,6 +269,15 @@
     <antcall target="regex.version"> 
       <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"/>
+    </antcall>
+    <antcall target="regex.version"> 
+      <param name="regex.file" value="java/testing/org/apache/derbyTesting/functionTests/master/testProperties.out"/>
+    </antcall>
   </target>
 
   <target name="regex.version">



Mime
View raw message