Class Launcher

java.lang.Object
com.atlassian.greenhopper.Launcher
All Implemented Interfaces:
com.atlassian.sal.api.lifecycle.LifecycleAware

public class Launcher extends Object implements com.atlassian.sal.api.lifecycle.LifecycleAware
This is the main entry point for GreenHopper. All initialisation should take place here.

We can't listen to PluginDisableEvent, because these happen after the Spring context has already been destroyed.

Author:
ahennecke
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final LoggerWrapper
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    onClearCache(com.atlassian.jira.event.ClearCacheEvent clearCacheEvent)
    Called when Jira restores data but does NOT re-start the plugin system
    final void
    onPluginStarted(com.atlassian.plugin.event.events.PluginEnabledEvent pluginEnabledEvent)
     
    void
    First event in the lifecycle: Spring context comes up.
    void
    Third event we're interested in: The Spring context shuts down.
    void
    Second event in the lifecycle: System runs (this comes after the plugin framework events)
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Launcher

      public Launcher()
  • Method Details

    • onSpringContextStarted

      @PostConstruct public void onSpringContextStarted()
      First event in the lifecycle: Spring context comes up.
    • onStart

      public void onStart()
      Second event in the lifecycle: System runs (this comes after the plugin framework events)
      Specified by:
      onStart in interface com.atlassian.sal.api.lifecycle.LifecycleAware
    • onPluginStarted

      @EventListener public final void onPluginStarted(com.atlassian.plugin.event.events.PluginEnabledEvent pluginEnabledEvent)
    • onClearCache

      @EventListener public final void onClearCache(com.atlassian.jira.event.ClearCacheEvent clearCacheEvent)
      Called when Jira restores data but does NOT re-start the plugin system

      This is done as an optimisation for functional testing but it can trip you up if you are retaining state.

      Parameters:
      clearCacheEvent - empty event which is not of much use to propagate.
    • onSpringContextStopped

      @PreDestroy public void onSpringContextStopped()
      Third event we're interested in: The Spring context shuts down.
    • onStop

      public void onStop()
      Specified by:
      onStop in interface com.atlassian.sal.api.lifecycle.LifecycleAware