diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/adpter/DynamicThreadPoolAdapterChoose.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/adpter/DynamicThreadPoolAdapterChoose.java index b74421ec..83ca0f63 100644 --- a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/adpter/DynamicThreadPoolAdapterChoose.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/adpter/DynamicThreadPoolAdapterChoose.java @@ -39,7 +39,6 @@ public class DynamicThreadPoolAdapterChoose { DYNAMIC_THREAD_POOL_ADAPTERS.add(new TransmittableThreadLocalExecutorServiceAdapter()); DYNAMIC_THREAD_POOL_ADAPTERS.add(new ThreadPoolTaskExecutorAdapter()); DYNAMIC_THREAD_POOL_ADAPTERS.add(new ZipkinExecutorAdapter()); - DynamicThreadPoolServiceLoader.register(DynamicThreadPoolAdapterSPI.class); loadCustomerAdapter(); } @@ -85,6 +84,7 @@ public class DynamicThreadPoolAdapterChoose { * load SPI customer adapter */ private static void loadCustomerAdapter() { + DynamicThreadPoolServiceLoader.register(DynamicThreadPoolAdapterSPI.class); Collection instances = DynamicThreadPoolServiceLoader.getSingletonServiceInstances(DynamicThreadPoolAdapterSPI.class); for (DynamicThreadPoolAdapterSPI instance : instances) { DynamicThreadPoolAdapter adapter = instance.adapter(); diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/adpter/ZipkinExecutorAdapter.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/adpter/ZipkinExecutorAdapter.java index 5af90f9f..eb344c8c 100644 --- a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/adpter/ZipkinExecutorAdapter.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/adpter/ZipkinExecutorAdapter.java @@ -75,6 +75,4 @@ public class ZipkinExecutorAdapter implements DynamicThreadPoolAdapter { } return null; } - - } diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/spi/DynamicThreadPoolAdapterSPI.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/spi/DynamicThreadPoolAdapterSPI.java index 9f8adcd1..9d0601c1 100644 --- a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/spi/DynamicThreadPoolAdapterSPI.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/spi/DynamicThreadPoolAdapterSPI.java @@ -20,6 +20,7 @@ package cn.hippo4j.core.executor.support.spi; import cn.hippo4j.core.executor.support.adpter.DynamicThreadPoolAdapter; public interface DynamicThreadPoolAdapterSPI { + String name(); DynamicThreadPoolAdapter adapter(); }