Class LifeCycleManager

java.lang.Object
dev.voidframework.core.lifecycle.LifeCycleManager

public final class LifeCycleManager extends Object
Life cycle manager takes care of executing the various hooks defined by the use of the LifeCycleStart and LifeCycleStop annotations.
  • Constructor Details

    • LifeCycleManager

      public LifeCycleManager(com.typesafe.config.Config configuration)
      Build a new instance.
      Parameters:
      configuration - The application configuration
  • Method Details

    • setInjector

      @Inject public void setInjector(com.google.inject.Injector injector)
      Sets the injector.
      Parameters:
      injector - The injector instance
    • registerStart

      public void registerStart(Class<?> classType, Method method, int priority)
      Register a "START" method.
      Parameters:
      classType - The class type where is located the method to invoke
      method - The method to invoke
      priority - The priority
    • registerStop

      public void registerStop(Class<?> classType, Method method, int priority, String gracefulStopTimeoutConfigKey)
      Register a "STOP" method.
      Parameters:
      classType - The class type where is located the method to invoke
      method - The method to invoke
      priority - The priority
      gracefulStopTimeoutConfigKey - The graceful stop timeout configuration key
    • startAll

      public void startAll()
      Invoke all registered "START" methods.
    • stopAll

      public void stopAll()
      Invoke all registered "STOP" methods.