Package nl.talsmasoftware.context.delegation
Layered code for delegation such as
CallMappingExecutorService.
Wrapper
The base class for any delegation in this package.
Any wrapper contains an implementation of hashCode, equals
and toString based on the actual class and the wrapped instance.
A wrapper has two accessors for the delegate object: delegate()
and nonNullDelegate(). The latter validates that the delegate is non-null.
The WrapperWithContext is just a wrapper that also contains a context snapshot (or a supplier for it).
CallMappingExecutorService
A DelegatingExecutorService that maps
all Runnable tasks in Callable
objects, providing a base executor service that can wrap any background task
by implementing a single map(Callable) method.
-
Interface Summary Interface Description ContextSnapshotSupplier Interface for aSupplierofContextSnapshot. -
Class Summary Class Description CallMappingExecutorService Abstract base-class that makes it a little easier to schedule tasks (RunnableorCallableobjects) using an existingExecutorServicewhile providing a custommappingfor all tasks before they get scheduled.DelegatingExecutorService Abstract baseclass that makes it a little easier to wrap existingExecutorServiceimplementations by forwarding all methods to adelegateexecutor service.
The class also provides overridablewrappermethods for all complex input (e.g.DelegatingFuture<V> Abstract baseclass that simplifies wrapping an existingFutureby forwarding all required methods to adelegate futureobject.
The class also provides overridable wrapper methods forresultandexceptionoutcomes.Wrapper<T> Base wrapper class offering anon-null delegatemethod.WrapperWithContext<T> Wrapper that also contains a fixed context snapshot.