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 of the
7    * lifecycle requirements outlined on the {@link LifecycleAware} javadoc. The third (starting components that are enabled sometime
8    * after the host application starts up) can be done using an OSGi {@code ServiceListener}.
9    * <p/>
10   * See {@code com.atlassian.sal.core.lifecycle.DefaultLifecycleManager.LifecycleAwareServiceListener} in {@code sal-core} for an
11   * example.
12   *
13   * @since 2.0
14   */
15  public interface LifecycleManager
16  {
17      /**
18       * Triggers {@link LifecycleAware#onStart()} on all enabled {@link LifecycleAware} components. This method can be called
19       * multiple times but will only start components once and only once the plugin framework has started.
20       */
21      void start();
22  
23      /**
24       * @return {@code true} if application is set up and ready to run, {@code false} otherwise.
25       */
26      boolean isApplicationSetUp();
27  }