1 Reply Latest reply on May 3, 2018 11:31 AM by Dmitri Zamysloff

    Wildfly 10. Startup Event.

    Dmitri Zamysloff Newbie

      Hi Together,

       

      is there any way to hook on Wildfly 10 "startup done" event, or something similar? In my use-case I want to wait until startup of server is done and only then start some heavy background job. If I am starting this job within the startup process (say singleton EJB on post construct using ManagedExecutorService), depending on hardware, it might disturb other services starting up and cause timeout for startup and server crash.

       

      I would appreciate any information.

       

      Thank you.

       

      P.S. There is no possibility to change to Wildfly 11.

        • 1. Re: Wildfly 10. Startup Event.
          Dmitri Zamysloff Newbie

          I have solved problem myself. Right now implemented very pragmatic solution. In simplified code it looks like following:

          final String serverState = "" + ManagementFactory.getPlatformMBeanServer()

            .getAttribute(new ObjectName("jboss.as:management-root=server"), "serverState");
          if (!"running".equalsIgnoreCase(serverState)) {

          ... here requred code ...
          }

           

          unfortunately have to poll this using timer. If there is any possibility to use notifications - would be nice.