io.sarl.sre.janus.services.executor
Class AbstractThreadExecutorPolicy
All Superinterfaces:
java.lang.Thread.UncaughtExceptionHandler, java.util.concurrent.RejectedExecutionHandler
All Known Subclasses:
AbstractLoggingThreadExecutorPolicy, QuietThreadExecutorPolicy
@javax.inject.Singleton
abstract class AbstractThreadExecutorPolicy
extends java.lang.Object
implements java.util.concurrent.RejectedExecutionHandler, java.lang.Thread.UncaughtExceptionHandler
Abstract implementation of the thread executor policies for rejected tasks and uncaught exceptions.

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).
Maven Group Identifier:
io.sarl.sre.janus
Maven Artifact Identifier:
janus.kernel
See:
java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy
Action Summary
Modifier and type Action and description
void rejectedExecution(Runnable,ThreadPoolExecutor)
protected static boolean runRejectedTask(Runnable,ThreadPoolExecutor)
Run the given task within the current thread if the executor is not shut down.
Action Details
rejectedExecution(Runnable,ThreadPoolExecutor)
def rejectedExecution(Runnable,ThreadPoolExecutor)
runRejectedTask(Runnable,ThreadPoolExecutor)
protected def runRejectedTask(Runnable,ThreadPoolExecutor) : boolean
Run the given task within the current thread if the executor is not shut down. The task is not run by the given executor. The executor is used for checking if the executor service is shut down.
Parameters:
runnable - the runnable task to be executed
executor - the executor attempting to give the shut down status
Returns:
true if the task is run. false if the task was not run.
See:
java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy