@Singleton public abstract class AbstractThreadExecutorPolicy extends Object implements RejectedExecutionHandler, Thread.UncaughtExceptionHandler
The handler for rejected tasks runs the rejected task
directly in the calling thread of the execute
method,
unless the executor has been shut down, in which case the task
is discarded (see ThreadPoolExecutor.CallerRunsPolicy
).
ThreadPoolExecutor.CallerRunsPolicy}
Modifier and Type | Method and Description |
---|---|
void |
rejectedExecution(runnable : Runnable,
executor : ThreadPoolExecutor) |
protected static boolean |
runRejectedTask(runnable : Runnable,
executor : ThreadPoolExecutor)
Run the given task within the current thread if the executor is not shut down.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
uncaughtException
protected static def
runRejectedTask(runnable : Runnable,
executor : ThreadPoolExecutor) : boolean
AbstractThreadExecutorPolicy
runnable
- the runnable task to be executedexecutor
- the executor attempting to give the shut down statustrue
if the task is run. false
if the task was not run.ThreadPoolExecutor.CallerRunsPolicy}
public def
rejectedExecution(runnable : Runnable,
executor : ThreadPoolExecutor) : void
rejectedExecution
in interface RejectedExecutionHandler
Copyright © 2021 the original authors or authors.