1 package com.atlassian.config.lifecycle;
2
3 public interface LifecycleItem
4 {
5 /**
6 * Called on application startup.
7 *
8 * @param context the application's lifecycle context
9 * @throws Exception if something goes wrong during startup. No more startup items will be run, and the
10 * application will post a fatal error, shut down all LifecycleItems that have run previously, and
11 * die horribly.
12 */
13 void startup(LifecycleContext context) throws Exception;
14
15 /**
16 * Called on application shutdown
17 *
18 * @param context the application's lifecycle context
19 * @throws Exception if something goes wrong during the shutdown process. The remaining shutdown items
20 * will still be run, but the lifecycle manager will log the error.
21 */
22 void shutdown(LifecycleContext context) throws Exception;
23 }