Adjusting the code format

1.4.3-upgrade
chen.ma 2 years ago
parent 881f01c70b
commit 46cdd63bea

@ -147,8 +147,8 @@ public class ReflectUtil {
} }
/** /**
* find the method associated with the method name<br> * Find the method associated with the method name<br>
* if find multiple, return the first, parameter is equivocal * if find multiple, return the first, parameter is equivocal.
* *
* @param clazz the class * @param clazz the class
* @param methodName retrieves the method name * @param methodName retrieves the method name
@ -170,7 +170,7 @@ public class ReflectUtil {
} }
/** /**
* find the method associated with the method name * Find the method associated with the method name.
* *
* @param clazz the class * @param clazz the class
* @param methodName retrieves the method name * @param methodName retrieves the method name
@ -190,7 +190,7 @@ public class ReflectUtil {
/** /**
* Cast the value to the type <br> * Cast the value to the type <br>
* If a ClassCastException occurs, return null * If a ClassCastException occurs, return null.
* *
* @param clazz Cast class * @param clazz Cast class
* @param value The cast value * @param value The cast value
@ -205,7 +205,7 @@ public class ReflectUtil {
} }
/** /**
* the default value is obtained if it is a primitive type, and NULL if it is not * The default value is obtained if it is a primitive type, and NULL if it is not.
* *
* @param clazz clazz * @param clazz clazz
* @return default value * @return default value
@ -235,7 +235,7 @@ public class ReflectUtil {
} }
/** /**
* invoke * Invoke.
* *
* @param obj the obj * @param obj the obj
* @param method the method * @param method the method
@ -252,7 +252,7 @@ public class ReflectUtil {
} }
/** /**
* get instance * Get instance.
* *
* @param cls the class * @param cls the class
* @return new Instance * @return new Instance
@ -266,7 +266,8 @@ public class ReflectUtil {
} }
/** /**
* find field by fieldName and fieldType * Find field by fieldName and field-type.
*
* @param obj target obj * @param obj target obj
* @param filedName filedName * @param filedName filedName
* @param fieldType fieldType * @param fieldType fieldType

@ -18,6 +18,7 @@
package cn.hippo4j.core.executor.support.adpter; package cn.hippo4j.core.executor.support.adpter;
import cn.hippo4j.common.spi.DynamicThreadPoolServiceLoader; import cn.hippo4j.common.spi.DynamicThreadPoolServiceLoader;
import cn.hippo4j.common.toolkit.CollectionUtil;
import cn.hippo4j.core.executor.DynamicThreadPoolExecutor; import cn.hippo4j.core.executor.DynamicThreadPoolExecutor;
import cn.hippo4j.core.executor.support.spi.DynamicThreadPoolAdapterSPI; import cn.hippo4j.core.executor.support.spi.DynamicThreadPoolAdapterSPI;
@ -81,11 +82,14 @@ public class DynamicThreadPoolAdapterChoose {
} }
/** /**
* load SPI customer adapter * Load SPI customer adapter.
*/ */
private static void loadCustomerAdapter() { private static void loadCustomerAdapter() {
DynamicThreadPoolServiceLoader.register(DynamicThreadPoolAdapterSPI.class); DynamicThreadPoolServiceLoader.register(DynamicThreadPoolAdapterSPI.class);
Collection<DynamicThreadPoolAdapterSPI> instances = DynamicThreadPoolServiceLoader.getSingletonServiceInstances(DynamicThreadPoolAdapterSPI.class); Collection<DynamicThreadPoolAdapterSPI> instances = DynamicThreadPoolServiceLoader.getSingletonServiceInstances(DynamicThreadPoolAdapterSPI.class);
if (CollectionUtil.isEmpty(instances)) {
return;
}
for (DynamicThreadPoolAdapterSPI instance : instances) { for (DynamicThreadPoolAdapterSPI instance : instances) {
DynamicThreadPoolAdapter adapter = instance.adapter(); DynamicThreadPoolAdapter adapter = instance.adapter();
if (adapter != null) { if (adapter != null) {

@ -19,8 +19,18 @@ package cn.hippo4j.core.executor.support.spi;
import cn.hippo4j.core.executor.support.adpter.DynamicThreadPoolAdapter; import cn.hippo4j.core.executor.support.adpter.DynamicThreadPoolAdapter;
/**
* Dynamic thread-pool adapter SPI.
*/
public interface DynamicThreadPoolAdapterSPI { public interface DynamicThreadPoolAdapterSPI {
/**
* Name.
*/
String name(); String name();
/**
* Adapter.
*/
DynamicThreadPoolAdapter adapter(); DynamicThreadPoolAdapter adapter();
} }

Loading…
Cancel
Save