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.