JBOSS Deployment interception

124 Views Asked by At

I would like to execute a code once an application gets deployed completely on JBOSS, is there a way to intercept application deployment on JBOSS, or is there a point where I can be very sure that the application has been deployed completely and I can execute my code just after that point.

1

There are 1 best solutions below

0
On

Reading Execute code after Glassfish Web Deployment i came to the answer of this question.

We have the ability to code a ServletContextListener to be triggered when the context is loaded like this:

public class MyServlet implements ServletContextListener {

  public void contextInitialized(ServletContextEvent e) {
         // implementation code
  }

  public void contextDestroyed(ServletContextEvent e) {
         // implementation code
  }
}

Reference:

Thanks to Garis Suero