Code optimization

pull/840/head
chen.ma 2 years ago
parent 5334363f32
commit 678ec1dd24

@ -15,12 +15,11 @@
* limitations under the License.
*/
package cn.hippo4j.core.toolkit.inet;
package cn.hippo4j.core.toolkit;
import cn.hippo4j.common.config.ApplicationContextHolder;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.support.AbstractApplicationContext;
@ -30,22 +29,13 @@ import java.lang.annotation.Annotation;
import java.util.Optional;
/**
* {@link DynamicThreadPoolAnnotationUtil} SpringBoot.
*
* <p>Spring version >= 5.2.0 , SpringBoot version 2.2.0.RELEASE
* {@link ListableBeanFactory#findAnnotationOnBean(java.lang.String, java.lang.Class)}
*
* <p>, , Spring .
* , Spring version < 5.3.14 , SpringBoot version < 2.6.2
*
* @author chen.ma
* @date 2022/1/5 21:15
* Adapted to an earlier version of SpringBoot.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class DynamicThreadPoolAnnotationUtil {
/**
* {@param beanName} {@param annotationType} .
* Check for the existence of {@param annotationType} based on {@param beanName}.
*
* @param beanName bean name
* @param annotationType annotation class

@ -32,7 +32,7 @@ import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage;
import cn.hippo4j.core.executor.support.CommonDynamicThreadPool;
import cn.hippo4j.core.executor.support.ThreadPoolBuilder;
import cn.hippo4j.core.executor.support.adpter.DynamicThreadPoolAdapterChoose;
import cn.hippo4j.core.toolkit.inet.DynamicThreadPoolAnnotationUtil;
import cn.hippo4j.core.toolkit.DynamicThreadPoolAnnotationUtil;
import cn.hippo4j.message.service.ThreadPoolNotifyAlarm;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

@ -35,7 +35,7 @@ import cn.hippo4j.core.executor.manage.GlobalNotifyAlarmManage;
import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage;
import cn.hippo4j.core.executor.support.*;
import cn.hippo4j.core.executor.support.adpter.DynamicThreadPoolAdapterChoose;
import cn.hippo4j.core.toolkit.inet.DynamicThreadPoolAnnotationUtil;
import cn.hippo4j.core.toolkit.DynamicThreadPoolAnnotationUtil;
import cn.hippo4j.message.service.ThreadPoolNotifyAlarm;
import cn.hippo4j.springboot.starter.config.BootstrapProperties;
import cn.hippo4j.springboot.starter.core.DynamicThreadPoolSubscribeConfig;
@ -45,14 +45,12 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.core.task.TaskDecorator;
import org.springframework.util.ClassUtils;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

Loading…
Cancel
Save