com.atlassian.sal.api.lifecycle
Interface LifecycleAware

All Known Implementing Classes:
DefaultPluginUpgradeManager

public interface LifecycleAware

Marker interface that indicates a component wishes to execute some code after application startup. onStart() will be invoked:

  1. immediately after the host application has started up; and
  2. immediately after the host application has been restored from backup (if the host supports backup and restore); and
  3. immediately after a plugin module is enabled, if the plugin is installed or enabled manually after the host application has already started.

Note: for this to work a component must be exposed as an OSGi service with LifecycleAware as a declared interface. The plugin system will do this for you automatically if you add a public="true" attribute and <interface>com.atlassian.sal.api.lifecycle.LifecycleAware</interface> child element to your <component> definition. For example:

      <component key="my-cool-component" class="com.atlassian.stash.MyCoolComponent" public="true">
          <interface>com.atlassian.sal.api.lifecycle.LifecycleAware</interface>
      </component>
 

Since:
2.0

Method Summary
 void onStart()
          Called when the application has started or has been restored from backup
 

Method Detail

onStart

void onStart()
Called when the application has started or has been restored from backup



Copyright © 2015 Atlassian. All rights reserved.