db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r629278 - /db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
Date Tue, 19 Feb 2008 23:49:51 GMT
Author: djd
Date: Tue Feb 19 15:49:46 2008
New Revision: 629278

URL: http://svn.apache.org/viewvc?rev=629278&view=rev
Log:
DERBY-1387 (partial) Add a VersionMBean for the network server code.

Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java?rev=629278&r1=629277&r2=629278&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
Tue Feb 19 15:49:46 2008
@@ -62,12 +62,15 @@
 import org.apache.derby.iapi.jdbc.DRDAServerStarter;
 import org.apache.derby.iapi.reference.Attribute;
 import org.apache.derby.iapi.reference.DRDAConstants;
+import org.apache.derby.iapi.reference.Module;
 import org.apache.derby.iapi.reference.Property;
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.services.i18n.MessageService;
 import org.apache.derby.iapi.services.info.JVMInfo;
 import org.apache.derby.iapi.services.info.ProductGenusNames;
 import org.apache.derby.iapi.services.info.ProductVersionHolder;
+import org.apache.derby.iapi.services.info.Version;
+import org.apache.derby.iapi.services.jmx.ManagementService;
 import org.apache.derby.iapi.services.monitor.Monitor;
 import org.apache.derby.iapi.services.property.PropertyUtil;
 import org.apache.derby.iapi.services.sanity.SanityManager;
@@ -76,6 +79,8 @@
 import org.apache.derby.iapi.util.CheapDateFormatter;
 import org.apache.derby.iapi.util.StringUtil;
 import org.apache.derby.impl.jdbc.EmbedSQLException;
+import org.apache.derby.mbeans.JDBCMBean;
+import org.apache.derby.mbeans.VersionMBean;
 
 /** 
 	
@@ -745,6 +750,15 @@
 								}
 							);
 		clientThread.start();
+        
+        // Now we are up and running register any MBeans
+        ManagementService mgmtService = ((ManagementService)
+                Monitor.getSystemModule(Module.JMX));
+        
+        Object versionMBean = mgmtService.registerMBean(
+                           new Version(getNetProductVersionHolder()),
+                           VersionMBean.class,
+                           "type=Version,jar=derbynet.jar");
 			
 		// wait until we are told to shutdown or someone sends an InterruptedException
         synchronized(shutdownSync) {
@@ -815,7 +829,10 @@
 		// they can close down
 		synchronized (runQueue) {
 			runQueue.notifyAll();
-		}						
+		}	
+        
+        // And now unregister any MBeans.
+        mgmtService.unregisterMBean(versionMBean);
 
 		if (shutdownDatabasesOnShutdown) {
 



Mime
View raw message