SpringBoot的后门
2020-01-05 (周日 · 阴天)
在非springboot工厂管理的普通类中,如果要获取工厂管理的对象,我们不能再使用 @Autowired 等注入的注解,此时的问题SpringBoot官方已给出解决办法,他们提供了一个 “ApplicationContextAware” 接口,实现此接口,即可获取工厂管理的全部内容。
package com.baizhi.cache;
import org.springframework.beans.BeansException;
import org.springframework.context