Class ServiceControllerImpl.StopContextImpl

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private StopContextImpl​(long startNanos)  
    • Method Summary

      All Methods Instance Methods Concrete 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​(java.lang.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StopContextImpl

        private StopContextImpl​(long startNanos)
    • Method Detail

      • asynchronous

        public void asynchronous()
                          throws java.lang.IllegalStateException
        Description copied from interface: LifecycleContext
        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 LifecycleContext.complete() method on this interface.
        Specified by:
        asynchronous in interface LifecycleContext
        Throws:
        java.lang.IllegalStateException - if called twice in a row
      • complete

        public void complete()
                      throws java.lang.IllegalStateException
        Description copied from interface: LifecycleContext
        Call when either synchronous or asynchronous lifecycle action is complete.
        Specified by:
        complete in interface LifecycleContext
        Throws:
        java.lang.IllegalStateException - if called twice in a row
      • getElapsedTime

        public long getElapsedTime()
        Description copied from interface: LifecycleContext
        Get the amount of time elapsed since the start or stop was initiated, in nanoseconds.
        Specified by:
        getElapsedTime in interface LifecycleContext
        Returns:
        the elapsed time