2 Replies Latest reply on Nov 15, 2004 12:56 PM by dimitris

    detecting jboss startup

    mgmurray

      I need to automatically invoke a stateless session bean method after jboss has started. And probably via a MBean. Can anyone tell me how to detect when jboss has completed its startup process?

        • 1. Re: detecting jboss startup
          meatus

          Ant can do it with the "waitfor" task. Probably something like:

          <waitfor>
           <http url="http://localhost:8080/jmx-console"/>
          </waitfor>
          


          Good luck,
          Brett

          • 2. Re: detecting jboss startup
            dimitris

            1st method:
            Write an MBean (extend org.jboss.system.ServiceMBeanSupport) and inside the startService() method make the call to your EJB - make a ./deploy/deploy.last folder and deploy your MBean in there.

            2nd method:
            Write an MBean (extend org.jboss.system.ListenerServiceMBeanSupport) and inside the handleNotification2() method make the call to your EJB. During serviceStart() call subscribe(true). Configure the subscription-list attribute to listen for the server started notification, as follows:

            ..
            <attribute name="SubscriptionList">
             <subscription-list>
             <mbean name="jboss.system:type=Server">
             <notification type="org.jboss.system.server.started"/>
             </mbean>
             </subscription-list>
            </attribute
            


            See also:
            http://www.jboss.org/wiki/Wiki.jsp?page=FAQJBossJMX

            http://www.jboss.org/wiki/Wiki.jsp?page=ExampleMinimalNotificationListener