[Jboss-cvs] JBossAS SVN: r56919 - branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Sep 17 09:00:07 EDT 2006


Author: scott.stark at jboss.org
Date: 2006-09-17 09:00:06 -0400 (Sun, 17 Sep 2006)
New Revision: 56919

Modified:
   branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/ServerImpl.java
Log:
Restore the old JMX server start notification and NotificationEmitter implementation

Modified: branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/ServerImpl.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/ServerImpl.java	2006-09-17 10:05:22 UTC (rev 56918)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/ServerImpl.java	2006-09-17 13:00:06 UTC (rev 56919)
@@ -27,6 +27,10 @@
 import java.util.Date;
 import java.util.Properties;
 
+import javax.management.Notification;
+import javax.management.NotificationBroadcasterSupport;
+import javax.management.NotificationEmitter;
+
 import org.jboss.Version;
 import org.jboss.deployers.spi.deployment.MainDeployer;
 import org.jboss.kernel.Kernel;
@@ -48,8 +52,8 @@
  * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
  * @version $Revision$
  */
-public class ServerImpl
-   implements Server
+public class ServerImpl extends NotificationBroadcasterSupport
+   implements Server, NotificationEmitter
 {
    /** Instance logger. */
    private Logger log;
@@ -85,7 +89,7 @@
    private LifeThread lifeThread;
 
    /**
-    * No-arg constructor for {@link ServerLoader}.
+    * No-arg constructor for ServerImpl
     */
    public ServerImpl()
    {
@@ -319,7 +323,21 @@
 
       try
       {
-         Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+         ClassLoader myCL = getClass().getClassLoader();
+         /*
+         URL libURL = config.getLibraryURL();
+         // Hack to add the jmx jars until the mc/legacy jmx integration is cleaned up
+         URL[] jmxJars = {
+               new URL(libURL, "dom4j.jar"),
+               new URL(libURL, "jboss-j2se.jar"),
+               new URL(libURL, "jboss-jmx.jar"),
+               new URL(libURL, "jboss-mbeans.jar"),
+               new URL(libURL, "jboss-system-jmx.jar")
+         };
+         NoAnnotationURLClassLoader jmxLoader = new NoAnnotationURLClassLoader(jmxJars, myCL);
+         Thread.currentThread().setContextClassLoader(jmxLoader);
+         */
+         Thread.currentThread().setContextClassLoader(myCL);
          doStart();
       }
       catch (Throwable t)
@@ -391,7 +409,11 @@
       // Send a notification that the startup is complete
       KernelEvent startEvent = bootstrap.createEvent(START_NOTIFICATION_TYPE, new Long(watch.getLapTime()));
       bootstrap.fireKernelEvent(startEvent);
-      
+      // Send a JMX notification that the startup is complete
+      Notification msg = new Notification(START_NOTIFICATION_TYPE, this, 1);
+      msg.setUserData(new Long(watch.getLapTime()));
+      sendNotification(msg); 
+
       watch.stop();
 
       if (jbossPackage != null)
@@ -403,7 +425,7 @@
       else
       {
          log.warn("could not get package info to display release, either the " +
-            "jar manifest in jboss-boot.jar has been mangled or you're " +
+            "jar manifest in run.jar has been mangled or you're " +
             "running unit tests from ant outside of JBoss itself.");
       }  
    }




More information about the jboss-cvs-commits mailing list