mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Provide custom BackgroundExecutorWrapper to pass thread locals
(cherry picked from commit 336accf447)
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package io.ebean.config;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
/**
|
||||
* BackgroundExecutorWrapper that can be used to wrap tasks that are sent to background (i.e. an other thread).
|
||||
* It should copy all neccessary thread-local variables. See {@link MdcBackgroundExecutorWrapper} for implementation details.
|
||||
*
|
||||
* @author Roland Praml, FOCONIS AG
|
||||
*/
|
||||
public interface BackgroundExecutorWrapper {
|
||||
|
||||
/**
|
||||
* Wrap the task with MDC context if defined.
|
||||
*/
|
||||
<T> Callable<T> wrap(Callable<T> task);
|
||||
|
||||
/**
|
||||
* Wrap the task with MDC context if defined.
|
||||
*/
|
||||
Runnable wrap(Runnable task);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user