See the JMX message org.jboss.system.server.Server.START_NOTIFICATION_TYPE.
The MBean would look something like this:


import org.jboss.system.server.Server;
import javax.management.Notification;
import javax.management.NotificationFilter;
import javax.management.NotificationListener;
import org.jboss.system.ServiceMBeanSupport;

public class ServerLoadDetector extends ServiceMBeanSupport
      implements ServerLoadDetectorMBean,
      NotificationFilter, NotificationListener
{
  boolean state = false;

  //
  // MBean read only attribute
  // @jmx:managed-attribute
  //
  public boolean isStarted() 
  {
    return state;
  }

  //
  //  NotificationFilter, NotificationListener Implementations
  //
  public boolean isNotificationEnabled(Notification n)
  {
    return (Server.START_NOTIFICATION_TYPE.equals(n.getType()));
  }
  public void handleNotification(Notification n, Object handback)
  {
        // set an attribute that can be remotely introspected
      state = true;
  }
}

-----Original Message-----
From: julien viet [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 9:02 AM
To: Muraly R
Subject: Re: [JBoss-user] Message to User about JBoss Startup Complete


The started field could be added as an attribute on the
ServerImplMBean mbean.

Actually there is no way to know,
though it is possible to know when the server starts because it sends a JMX
notification at this moment.

julien


MR> Hi Gurus,
MR> Objective
MR> ========
MR> Since my web server and all other services start prior to JBoss, I want
to 
MR> provide a notification to user through the web UI, saying that the
services 
MR> are starting, if the user tries to access the application before the
App. 
MR> server is up.

MR> To Know
MR> =======
MR> What I wanted to know is, is there any API exposed from which we can
know 
MR> about the JBoss server startup. So I can access this API at regular 
MR> intervals from UI, and re-direct the URL once the JBoss start has
completed 
MR> successfully.

MR> Thanks
MR> Muraly



MR> -------------------------------------------------------
MR> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
MR> Data Reports, E-commerce, Portals, and Forums are available now.
MR> Download today and enter to win an XBOX or Visual Studio .NET.
MR>
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
MR> _______________________________________________
MR> JBoss-user mailing list
MR> [EMAIL PROTECTED]
MR> https://lists.sourceforge.net/lists/listinfo/jboss-user



-- 
Best regards,
 julien                            mailto:[EMAIL PROTECTED]



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to