Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-2300

exit/shutdown do not emit org.jboss.system.server.stopped notification

XMLWordPrintable

      When stopping the server on the console by using ctrl-c, no
      org.jboss.system.server.stopped is issued.

      Code inspection shows, that this only happens when halt() is called, but not exit() or shutdown().
      Especially in the graceful shutdown case, it would by interesting to get this notification to inform
      management tools, that the server is going down.

      A patch would probably look like this:

      Index: ServerImpl.java
      ===================================================================
      RCS file: /cvsroot/jboss/jboss-system/src/main/org/jboss/system/server/ServerImpl.java,v
      retrieving revision 1.47.2.5
      diff -u -r1.47.2.5 ServerImpl.java
      — ServerImpl.java 25 Apr 2005 15:26:25 -0000 1.47.2.5
      +++ ServerImpl.java 26 Sep 2005 12:35:43 -0000
      @@ -598,6 +598,8 @@
      throw new IllegalStateException("not started");

      final ServerImpl server = this;
      + Notification msg = new Notification(STOP_NOTIFICATION_TYPE, this, 2);
      + sendNotification(msg);

      log.debug("Shutting down");

      @@ -642,6 +644,9 @@
      */
      public void exit(final int exitcode)
      {
      + Notification msg = new Notification(STOP_NOTIFICATION_TYPE, this, 2);
      + sendNotification(msg);
      +
      // start in new thread so that we might have a chance to give positive
      // feed back to requesting client of success.
      new Thread()

            pilhuhn Heiko Rupp
            pilhuhn Heiko Rupp
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: