| Constructor and Description |
|---|
RunnerDecorator(Runner wrapped)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(Execution execution)
Cancels the specified execution if not already run.
Note that the method will have no effect in case the runner does not maintain a queue or the specified execution has been already processed at the moment of the call. Note also that, in case the same execution has been added more than once to the runner queue, when the method returns, the queue will not contain the execution instance anymore, with the consequence that the Runnable.run() method will never be called. |
boolean |
isExecutionThread()
Checks if the calling thread belongs to the ones employed by the runner implementation.
|
void |
run(Execution execution,
long delay,
TimeUnit timeUnit)
Runs the specified execution (that is, it calls the
Runnable.run() method inside the
runner thread). |
public RunnerDecorator(@NotNull
Runner wrapped)
wrapped - the wrapped instance.public void cancel(@NotNull
Execution execution)
RunnerRunnable.run() method will never be called.
The implementation of this method is optional, still, it may greatly increase the performance
by avoiding to start invocations which are already aborted. The runner implementation can
safely ignore all those executions whose method Execution.mayBeCanceled() returns
false.public boolean isExecutionThread()
RunnerisExecutionThread in interface Runnerpublic void run(@NotNull
Execution execution,
long delay,
@NotNull
TimeUnit timeUnit)
RunnerRunnable.run() method inside the
runner thread).