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.
Since:
1.0.0
  • Constructor Details

    • LifeCycleManager

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

    • setInjector

      @Inject public void setInjector(com.google.inject.Injector injector)
      Sets the injector.
      Parameters:
      injector - The injector instance
      Since:
      1.0.0
    • 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
      Since:
      1.0.0
    • 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
      Since:
      1.0.0
    • startAll

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

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