db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myrn...@apache.org
Subject svn commit: r1153957 - in /db/derby/code/branches/10.6: ./ java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
Date Thu, 04 Aug 2011 18:15:28 GMT
Author: myrnavl
Date: Thu Aug  4 18:15:27 2011
New Revision: 1153957

URL: http://svn.apache.org/viewvc?rev=1153957&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.6/   (props changed)
    db/derby/code/branches/10.6/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java

Propchange: db/derby/code/branches/10.6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug  4 18:15:27 2011
@@ -1,3 +1,3 @@
 /db/derby/code/branches/10.7:1140196
-/db/derby/code/trunk:938547,938796,938959,939231,940462,940469,941627,942031,942286,942476,942480,942587,944152,946794,948045,948069,951346,951366,952138,952237,952581,954344,954421,954544,954748,955001,955540,955634,956075,956234,956445,956569,956659,957260,957902,958163,958257,958264,958508,958522,958555,958618,958939,959550,961892,962716,963206,963705,964039,964115,964402,965647,966393,967201,967304,980089,980684,986689,986834,987539,989099,990292,997325,998170,999119,999479,999485,1002291,1002682,1002853,1021426,1024511,1024528,1025615,1025795,1028716,1030043,1033485,1033864,1035164,1038514,1040658,1053724,1055169,1062096,1063809,1065061,1067250,1069661,1071886,1078461,1081455,1097247,1103681,1103718,1136363,1138341,1141924
+/db/derby/code/trunk:938547,938796,938959,939231,940462,940469,941627,942031,942286,942476,942480,942587,944152,946794,948045,948069,951346,951366,952138,952237,952581,954344,954421,954544,954748,955001,955540,955634,956075,956234,956445,956569,956659,957260,957902,958163,958257,958264,958508,958522,958555,958618,958939,959550,961892,962716,963206,963705,964039,964115,964402,965647,966393,967201,967304,980089,980684,986689,986834,987539,989099,990292,997325,998170,999119,999479,999485,1002291,1002682,1002853,1021426,1024511,1024528,1025615,1025795,1028716,1030043,1033485,1033864,1035164,1038514,1040658,1053724,1055169,1062096,1063809,1065061,1067250,1069661,1071886,1078461,1081455,1097247,1103681,1103718,1136363,1138341,1138444,1141924
 /db/derby/docs/trunk:954344

Modified: db/derby/code/branches/10.6/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java?rev=1153957&r1=1153956&r2=1153957&view=diff
==============================================================================
--- db/derby/code/branches/10.6/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
(original)
+++ db/derby/code/branches/10.6/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
Thu Aug  4 18:15:27 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