View Javadoc

1   package com.atlassian.sal.api.lifecycle;
2   
3   /**
4    * Triggers lifecycle events on {@link LifecycleAware} components.
5    * <p>
6    * <strong>Implementation note:</strong> Invoking the {@link #start()} method on startup and restore satisfies the two
7    * of the lifecycle requirements outlined on the {@link LifecycleAware} javadoc. The third (starting components that are
8    * enabled sometime after the host application starts up) is typically achieved by listening for OSGi bind events.
9    * See {@code DefaultLifecycleManager#onBind()} in {@code sal-core} for an example.
10   *
11   * @since 2.0
12   */
13  public interface LifecycleManager
14  {
15      /**
16       * Triggers {@link LifecycleAware#onStart()} on all enabled {@link LifecycleAware} components. This method can be
17       * called multiple times but will only start components once and only once the plugin framework has started.
18       */
19      void start();
20  
21      /**
22       * @return {@code true} if application is set up and ready to run, {@code false} otherwise.
23       */
24      boolean isApplicationSetUp();
25  }