public abstract class CallMappingExecutorService extends DelegatingExecutorService
Runnable or Callable objects) using an existing ExecutorService while
providing a custom mapping for all tasks before they get scheduled.| Modifier | Constructor and Description |
|---|---|
protected |
CallMappingExecutorService(ExecutorService delegate)
Constructor to create a new wrapper around the specified
service delegate. |
| Modifier and Type | Method and Description |
|---|---|
protected abstract <V> Callable<V> |
map(Callable<V> callable)
The call mapping that needs to be implemented: map the given callable object into a desired variant before
scheduling.
|
protected <V> Callable<V> |
wrap(Callable<V> callable)
Wrapping a callable object is delegated to the abstract
map(Callable) method. |
protected Runnable |
wrap(Runnable runnable)
|
awaitTermination, equals, execute, hashCode, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit, toString, wrap, wrapFutures, wrapTasksdelegate, nonNullDelegateprotected CallMappingExecutorService(ExecutorService delegate)
service delegate.delegate - The delegate executor service that does the heavy lifting of executing all tasks once they are mapped.protected abstract <V> Callable<V> map(Callable<V> callable)
V - The type of result being returned by the callable object.callable - The callable to be mapped.protected final <V> Callable<V> wrap(Callable<V> callable)
map(Callable) method.wrap in class DelegatingExecutorServiceV - The type of result being returned by the callable object.callable - The callable to be mapped.map(Callable)protected Runnable wrap(Runnable runnable)
Runnable objects before scheduling:
wrap it into a Callable object and return an
unwrapped Runnable implementation that simply runs by calling the mapped Callable object.wrap in class DelegatingExecutorServicerunnable - The runnable object to be wrapped.wrap(Callable)Copyright © 2016–2017 Talsma ICT. All rights reserved.