2 Replies Latest reply on Dec 17, 2012 11:10 AM by matlach

    deployment hook

    matlach

      Hello everyone,

       

      I was wondering if there was any hook or any cdi event we could observes when a .war or a .ear has been fully deployed i.e. when jboss as print :

      INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "my-application.ear"

       

      Big thanks !

        • 1. Re: deployment hook
          nickarls

          I don't think there as any specific event. Externally you can use jboss-cli as mentioned in https://community.jboss.org/message/611161

          Depending on what you want, a @Startup @Singleton might also work?

          • 2. Re: deployment hook
            matlach

            Thanks Nicklas for your anwser though I don't think that @Singleton @Startup would do the trick here.

             

            Actually, I'm facing two differents concurrency issue at deployment :

            - the startup of Quartz Scheduler, which trigger job immediatly, in another thread

            - the startup of Hornet Q, which trigger consumption of elements in the queue immediatly, also in another thread.

             

            The problem is that my Quartz Scheduler or the Hornet Q consumer require that my ear has been fully scanned / initialized by Weld before doing anything.

            That's really why I'd like to have this kind of hook at deployment so I could start at the right moment Quartz and my Consumer.

             

            I don't know if the best practice would be to isolate the Quartz and HornetQueue consumer in different jar and play with the application.xml to ensure both are launched at the very end of my ear deployment ? Any idea ?

             

            Thanks again.