Collects all {@link ThreadLocalTransfer} found in the application context and applies them onrequest. This object is not thread safe, it's meant to be instantiated when a transfer is required To use it:
- Create a {@link ThreadLocalsTransfer} in the request thread
- Pass the object as state to the {@link Runnable}/ {@link Callable} being run in a thread pool
- As the {@link Runnable}/ {@link Callable} starts its activity, invoke {@link #apply()}
- In a finally block wrapping the whole activity of the {@link Runnable}/ {@link Callable} call{@link #cleanup()} to clean the current Thread {@link ThreadLocal} variables
@author Andrea Aime - GeoSolutions