db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myrn...@apache.org
Subject svn commit: r1153953 - in /db/derby/code/branches/10.7: ./ java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
Date Thu, 04 Aug 2011 17:50:55 GMT
Author: myrnavl
Date: Thu Aug  4 17:50:54 2011
New Revision: 1153953

URL: http://svn.apache.org/viewvc?rev=1153953&view=rev
Log:
DERBY-3689; 'PrivilegedActionException: javax.management.InstanceNotFoundException' in '*(VersionMBeanTest
/ NetworkServerMBeanTest)'
  backporting revision 1138444 from trunk
  merge command: merge -c 1138444 https://svn.apache.org/repos/asf/db/derby/code/trunk

Modified:
    db/derby/code/branches/10.7/   (props changed)
    db/derby/code/branches/10.7/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java

Propchange: db/derby/code/branches/10.7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug  4 17:50:54 2011
@@ -1 +1 @@
-/db/derby/code/trunk:1035603,1036769,1038514,1038813,1039084,1039268,1040658,1041338,1043227,1043389,1044096,1051026,1053724,1055169,1059888,1060480,1062096,1063809,1065061,1066290,1067250,1067357,1069661,1071463,1071886,1076387,1078461,1078693,1081072,1081455,1081568,1085078,1091000,1097247,1103681,1103718,1129136,1130632,1130895,1131272,1132664,1136363,1138341,1139449,1141924
+/db/derby/code/trunk:1035603,1036769,1038514,1038813,1039084,1039268,1040658,1041338,1043227,1043389,1044096,1051026,1053724,1055169,1059888,1060480,1062096,1063809,1065061,1066290,1067250,1067357,1069661,1071463,1071886,1076387,1078461,1078693,1081072,1081455,1081568,1085078,1091000,1097247,1103681,1103718,1129136,1130632,1130895,1131272,1132664,1136363,1138341,1138444,1139449,1141924

Modified: db/derby/code/branches/10.7/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.7/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java?rev=1153953&r1=1153952&r2=1153953&view=diff
==============================================================================
--- db/derby/code/branches/10.7/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
(original)
+++ db/derby/code/branches/10.7/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
Thu Aug  4 17:50:54 2011
@@ -769,7 +769,25 @@ public final class NetworkServerControlI
 				{Integer.toString(portNumber), att_srvclsnm, versionString});
 			break;
 		}
-		
+
+        // First, register any MBeans. We do this before we start accepting
+        // connections from the clients to ease testing of JMX (DERBY-3689).
+        // This way we know that once we can connect to the network server,
+        // the MBeans will be available.
+        ManagementService mgmtService = ((ManagementService)
+                Monitor.getSystemModule(Module.JMX));
+
+        final Object versionMBean = mgmtService.registerMBean(
+                           new Version(
+                                   getNetProductVersionHolder(),
+                                   SystemPermission.SERVER),
+                           VersionMBean.class,
+                           "type=Version,jar=derbynet.jar");
+        final Object networkServerMBean = mgmtService.registerMBean(
+                            new NetworkServerMBeanImpl(this),
+                            NetworkServerMBean.class,
+                            "type=NetworkServer");
+
 		// 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
 		final ClientThread clientThread =	 
@@ -783,22 +801,7 @@ public final class NetworkServerControlI
 								}
 							);
 		clientThread.start();
-        
-        // Now that we are up and running, register any MBeans
-        ManagementService mgmtService = ((ManagementService)
-                Monitor.getSystemModule(Module.JMX));
-        
-        final Object versionMBean = mgmtService.registerMBean(
-                           new Version(
-                                   getNetProductVersionHolder(),
-                                   SystemPermission.SERVER),
-                           VersionMBean.class,
-                           "type=Version,jar=derbynet.jar");
-        final Object networkServerMBean = mgmtService.registerMBean(
-                            new NetworkServerMBeanImpl(this),
-                            NetworkServerMBean.class,
-                            "type=NetworkServer");
-                			
+
 		try {
 			// wait until we are told to shutdown or someone sends an InterruptedException
 	        synchronized(shutdownSync) {



Mime
View raw message