@FunctionalInterface public static interface InterceptingExecutorService.Interceptor
task.call()
, unless they are
choosing to block execution of the given task. Interceptors can also modify the result of the
call by returning a value other than what the task produced.Modifier and Type | Interface and Description |
---|---|
static class |
InterceptingExecutorService.Interceptor.ListBuilder
Builds a list of interceptors.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
intercept(ExecutorService delegate,
Callable<T> task)
Intercepts the given task.
|
static InterceptingExecutorService.Interceptor.ListBuilder |
newList()
Returns a new builder, for building a list of interceptors from both interceptor and
decorator instances.
|
<T> T intercept(ExecutorService delegate, Callable<T> task) throws Exception
task.run()
to proceed to
the next interceptor in the chain and run the task.delegate
- the underlying executor that is executing the tasktask
- the task to run, which may be a wrapper that invokes subsequent interceptorsException
static InterceptingExecutorService.Interceptor.ListBuilder newList()