mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-22 15:10:02 +00:00
#25890 - Tidy only, no effective change for BackgroundExecutorWrapper
This commit is contained in:
1 parent
1615beadd1
commit
267a81b792
3 files changed
+28
-25
No files matched your search
@@ -3,9 +3,9 @@ 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.
|
||||
*
|
||||
* BackgroundExecutorWrapper that can be used to wrap tasks that are sent to background (i.e. another thread).
|
||||
* It should copy all necessary thread-local variables. See {@link MdcBackgroundExecutorWrapper} for implementation details.
|
||||
*
|
||||
* @author Roland Praml, FOCONIS AG
|
||||
*/
|
||||
public interface BackgroundExecutorWrapper {
|
||||
@@ -21,22 +21,22 @@ public interface BackgroundExecutorWrapper {
|
||||
Runnable wrap(Runnable task);
|
||||
|
||||
/**
|
||||
* Combines two wrappers by joining them.
|
||||
* Combines two wrappers by nesting them.
|
||||
*/
|
||||
default BackgroundExecutorWrapper with(BackgroundExecutorWrapper inner) {
|
||||
return new BackgroundExecutorWrapper() {
|
||||
|
||||
|
||||
@Override
|
||||
public Runnable wrap(Runnable task) {
|
||||
return BackgroundExecutorWrapper.this.wrap(inner.wrap(task));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public <T> Callable<T> wrap(Callable<T> task) {
|
||||
return BackgroundExecutorWrapper.this.wrap(inner.wrap(task));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,15 @@
|
||||
package io.ebean.config;
|
||||
|
||||
import org.slf4j.MDC;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import org.slf4j.MDC;
|
||||
/**
|
||||
* Propagates MDC context for tasks executed in the background.
|
||||
*/
|
||||
public final class MdcBackgroundExecutorWrapper implements BackgroundExecutorWrapper {
|
||||
|
||||
public class MdcBackgroundExecutorWrapper implements BackgroundExecutorWrapper {
|
||||
|
||||
|
||||
/**
|
||||
* Wrap the task with MDC context if defined.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user