public static class ThreadAsyncHandlerProvider.AsyncRunnableWrapper extends Object implements Runnable, IAsyncHandler
Constructor and Description |
---|
AsyncRunnableWrapper(ThreadAsyncHandlerProvider provider,
Callable<IAsyncHandlerProvider.CycleResult> runnable,
long idleDelayMilis,
boolean waitIdleDelayBeforeStart) |
Modifier and Type | Method and Description |
---|---|
boolean |
isTerminated()
Specifies whether this async handler is terminated and will not run again
|
void |
resume()
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
|
void |
resumeNow()
Resume the life cycle of the handler if it is in suspended mode, the next execution will
start immediately.
|
void |
run() |
void |
setThread(Thread thread) |
void |
stop(long timeout,
TimeUnit units)
Stop the execution of this async handler.
|
void |
wakeUp()
Wakes up the handler if in idle state and execute a cycle of the runnable
|
boolean |
wakeUpAndWait(long timeout,
TimeUnit units)
Wakes up the handler if in idle or suspended state and wait for it complete one cycle.
|
public AsyncRunnableWrapper(ThreadAsyncHandlerProvider provider, Callable<IAsyncHandlerProvider.CycleResult> runnable, long idleDelayMilis, boolean waitIdleDelayBeforeStart)
public void setThread(Thread thread)
public void wakeUp()
IAsyncHandler
wakeUp
in interface IAsyncHandler
public boolean wakeUpAndWait(long timeout, TimeUnit units)
IAsyncHandler
wakeUpAndWait
in interface IAsyncHandler
public void stop(long timeout, TimeUnit units)
IAsyncHandler
stop
in interface IAsyncHandler
public void resume()
IAsyncHandler
resume
in interface IAsyncHandler
public void resumeNow()
IAsyncHandler
resumeNow
in interface IAsyncHandler
public boolean isTerminated()
IAsyncHandler
isTerminated
in interface IAsyncHandler
Copyright © GigaSpaces.