Commit 05c18827 authored by liaozan's avatar liaozan 🏀

Polish

parent 4a0a7061
......@@ -13,16 +13,16 @@ import org.springframework.context.annotation.Configuration;
public class ThreadPoolConfiguration {
@Bean
public TaskExecutorCustomizer mdcSupportTaskExecutorCustomizer() {
public TaskExecutorCustomizer exceptionHandlerAwareTaskExecutorCustomizer() {
return taskExecutor -> {
taskExecutor.setTaskDecorator(new MdcContextPropagationTaskDecorator());
taskExecutor.setThreadFactory(new UnCaughtExceptionHandleThreadFactory(taskExecutor));
taskExecutor.setThreadFactory(new UnCaughtExceptionHandlerThreadFactory(taskExecutor));
};
}
@Bean
public TaskSchedulerCustomizer mdcSupportTaskSchedulerCustomizer() {
return taskScheduler -> taskScheduler.setThreadFactory(new UnCaughtExceptionHandleThreadFactory(taskScheduler));
public TaskSchedulerCustomizer exceptionHandlerAwareTaskSchedulerCustomizer() {
return taskScheduler -> taskScheduler.setThreadFactory(new UnCaughtExceptionHandlerThreadFactory(taskScheduler));
}
}
\ No newline at end of file
}
......@@ -9,11 +9,11 @@ import java.util.concurrent.ThreadFactory;
* @author liaozan
* @since 2022/1/11
*/
public class UnCaughtExceptionHandleThreadFactory implements ThreadFactory {
public class UnCaughtExceptionHandlerThreadFactory implements ThreadFactory {
private final ThreadFactory delegate;
public UnCaughtExceptionHandleThreadFactory(ThreadFactory delegate) {
public UnCaughtExceptionHandlerThreadFactory(ThreadFactory delegate) {
this.delegate = delegate;
}
......@@ -25,7 +25,7 @@ public class UnCaughtExceptionHandleThreadFactory implements ThreadFactory {
}
@Slf4j
public static class LoggingUnCaughtExceptionHandler implements UncaughtExceptionHandler {
private static class LoggingUnCaughtExceptionHandler implements UncaughtExceptionHandler {
@Override
public void uncaughtException(Thread thread, Throwable throwable) {
......@@ -35,4 +35,4 @@ public class UnCaughtExceptionHandleThreadFactory implements ThreadFactory {
}
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment