SpringCloud中RefreshScope实现原理
jar包版本
- spring-cloud-context 2.0.0.RELEASE
scope基础理论
RefreshScope是springCloud在Scope的基础上实现的,因此先了解一下Scope的实现原理。
public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport implements ConfigurableBeanFactory {
protected <T> T doGetBean(final String name, final Class<T> requiredType, final Object[] args, boolean typeCheckOnly){
if (mbd.isSingleton()) {
//省略其他不重要代码
} else if (mbd.isPrototype()) {
//省略其他不重要代码
}else {