View Javadoc

1   package com.atlassian.config.lifecycle;
2   
3   import javax.servlet.ServletContext;
4   
5   /**
6    * Manages operations that must be performed on startup and shutdown of the application. These operations will
7    * typically be implemented as plugin modules.
8    *
9    * <b>Important:</b> There is no real way the application can guarantee that any of the shutdown tasks will be called
10   * in the event of an unfriendly server shutdown. They are mostly useful for cleanup in situations (like an
11   * appserver-triggered reload) where it can be assumed that the application will have the time to run the shutdown
12   * cleanly.
13   */
14  public interface LifecycleManager
15  {
16      /**
17       * Perform all the startup tasks for the application.
18       *
19       * @param servletContext the web application servlet context
20       */
21      void startUp(ServletContext servletContext);
22  
23      /**
24       * Perform all the shutdown tasks for the application.
25       *
26       * @param servletContext the web application servlet context
27       */
28      void shutDown(ServletContext servletContext);
29  }