Class ThreadAsyncHandlerProvider.AsyncRunnableWrapper

java.lang.Object
com.gigaspaces.internal.utils.concurrent.ThreadAsyncHandlerProvider.AsyncRunnableWrapper
All Implemented Interfaces:
IAsyncHandler, Runnable
Enclosing class:
ThreadAsyncHandlerProvider

public static class ThreadAsyncHandlerProvider.AsyncRunnableWrapper extends Object implements Runnable, IAsyncHandler
  • Constructor Details

  • Method Details

    • setThread

      public void setThread(Thread thread)
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • wakeUp

      public void wakeUp()
      Description copied from interface: IAsyncHandler
      Wakes up the handler if in idle state and execute a cycle of the runnable
      Specified by:
      wakeUp in interface IAsyncHandler
    • wakeUpAndWait

      public boolean wakeUpAndWait(long timeout, TimeUnit units)
      Description copied from interface: IAsyncHandler
      Wakes up the handler if in idle or suspended state and wait for it complete one cycle. Will wait for the specified timeout until one cycle is completed and returns true if the cycle was completed during that timeout, otherwise false.
      Specified by:
      wakeUpAndWait in interface IAsyncHandler
    • stop

      public void stop(long timeout, TimeUnit units)
      Description copied from interface: IAsyncHandler
      Stop the execution of this async handler. Will wait for the specified timeout until the handler is stopped which guarantees no following execution of the wrapped runnable. If the timeout elapsed this method returns but there might be an ongoing execution which was not stopped yet. However that will be no new execution after this method returns
      Specified by:
      stop in interface IAsyncHandler
    • resume

      public void resume()
      Description copied from interface: IAsyncHandler
      Resume the life cycle of the handler if it is in suspended mode, the next execution will be scheduled according to the idle delay timeout the handler was created with
      Specified by:
      resume in interface IAsyncHandler
    • resumeNow

      public void resumeNow()
      Description copied from interface: IAsyncHandler
      Resume the life cycle of the handler if it is in suspended mode, the next execution will start immediately.
      Specified by:
      resumeNow in interface IAsyncHandler
    • isTerminated

      public boolean isTerminated()
      Description copied from interface: IAsyncHandler
      Specifies whether this async handler is terminated and will not run again
      Specified by:
      isTerminated in interface IAsyncHandler
    • getName

      public String getName()
      Specified by:
      getName in interface IAsyncHandler