feature:merge diff

pull/1050/head
wangzhuo 3 years ago
commit 50b01ab6f2

@ -39,7 +39,6 @@ public class DynamicThreadPoolAdapterChoose {
DYNAMIC_THREAD_POOL_ADAPTERS.add(new TransmittableThreadLocalExecutorServiceAdapter()); DYNAMIC_THREAD_POOL_ADAPTERS.add(new TransmittableThreadLocalExecutorServiceAdapter());
DYNAMIC_THREAD_POOL_ADAPTERS.add(new ThreadPoolTaskExecutorAdapter()); DYNAMIC_THREAD_POOL_ADAPTERS.add(new ThreadPoolTaskExecutorAdapter());
DYNAMIC_THREAD_POOL_ADAPTERS.add(new ZipkinExecutorAdapter()); DYNAMIC_THREAD_POOL_ADAPTERS.add(new ZipkinExecutorAdapter());
DynamicThreadPoolServiceLoader.register(DynamicThreadPoolAdapterSPI.class);
loadCustomerAdapter(); loadCustomerAdapter();
} }
@ -85,6 +84,7 @@ public class DynamicThreadPoolAdapterChoose {
* load SPI customer adapter * load SPI customer adapter
*/ */
private static void loadCustomerAdapter() { private static void loadCustomerAdapter() {
DynamicThreadPoolServiceLoader.register(DynamicThreadPoolAdapterSPI.class);
Collection<DynamicThreadPoolAdapterSPI> instances = DynamicThreadPoolServiceLoader.getSingletonServiceInstances(DynamicThreadPoolAdapterSPI.class); Collection<DynamicThreadPoolAdapterSPI> instances = DynamicThreadPoolServiceLoader.getSingletonServiceInstances(DynamicThreadPoolAdapterSPI.class);
for (DynamicThreadPoolAdapterSPI instance : instances) { for (DynamicThreadPoolAdapterSPI instance : instances) {
DynamicThreadPoolAdapter adapter = instance.adapter(); DynamicThreadPoolAdapter adapter = instance.adapter();

@ -75,6 +75,4 @@ public class ZipkinExecutorAdapter implements DynamicThreadPoolAdapter {
} }
return null; return null;
} }
} }

@ -20,6 +20,7 @@ package cn.hippo4j.core.executor.support.spi;
import cn.hippo4j.core.executor.support.adpter.DynamicThreadPoolAdapter; import cn.hippo4j.core.executor.support.adpter.DynamicThreadPoolAdapter;
public interface DynamicThreadPoolAdapterSPI { public interface DynamicThreadPoolAdapterSPI {
String name(); String name();
DynamicThreadPoolAdapter adapter(); DynamicThreadPoolAdapter adapter();
} }

Loading…
Cancel
Save