Class StartupListener

java.lang.Object
com.codingchili.core.context.StartupListener

public class StartupListener extends Object
Allows a subscriber to wait for the application context to become available.
  • Constructor Details

    • StartupListener

      public StartupListener()
  • Method Details

    • subscribe

      public static void subscribe(Consumer<CoreContext> listener)
      Adds a subcriber that will be notified when the application context is loaded.
      Parameters:
      listener - called on load or if already loaded.
    • publish

      public static void publish(CoreContext core)
      Calls all listeners once and removes them as listeners.
      Parameters:
      core - the application context that was loaded.