Interface LifecycleContext

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void asynchronous()
      Call within the service lifecycle method to trigger an asynchronous lifecycle action.
      void complete()
      Call when either synchronous or asynchronous lifecycle action is complete.
      void execute​(Runnable command)
      Execute a task asynchronously using the MSC task executor.
      ServiceController<?> getController()
      Get the associated service controller.
      long getElapsedTime()
      Get the amount of time elapsed since the start or stop was initiated, in nanoseconds.
    • Method Detail

      • asynchronous

        void asynchronous()
                   throws IllegalStateException
        Call within the service lifecycle method to trigger an asynchronous lifecycle action. This action will not be considered complete until indicated so by calling a complete() method on this interface.
        Throws:
        IllegalStateException - if called twice in a row
      • getElapsedTime

        long getElapsedTime()
        Get the amount of time elapsed since the start or stop was initiated, in nanoseconds.
        Returns:
        the elapsed time
      • getController

        ServiceController<?> getController()
        Get the associated service controller.
        Returns:
        the service controller