xiaoyong931011
2021-04-09 0f7c4c9e8e84ccb7786b63d3e2a29095a533e42d
src/main/java/com/xcong/excoin/utils/SpringContextHolder.java
@@ -5,6 +5,7 @@
import org.springframework.beans.factory.DisposableBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
 * @Author wzy
@@ -12,6 +13,7 @@
 * @email wangdoubleone@gmail.com
 * @Version V1.0
 **/
@Component
@Slf4j
public class SpringContextHolder implements ApplicationContextAware, DisposableBean {
@@ -59,6 +61,7 @@
        if (SpringContextHolder.applicationContext != null) {
            log.warn("SpringContextHolder中的ApplicationContext被覆盖, 原有ApplicationContext为:" + SpringContextHolder.applicationContext);
        }
        log.info("=====================");
        SpringContextHolder.applicationContext = applicationContext;
    }
}