MyScriptFactoryPostProcessor.java 文件源码

java
阅读 19 收藏 0 点赞 0 评论 0

项目:game 作者:
public void setBeanFactory(BeanFactory beanFactory) {
if (!(beanFactory instanceof ConfigurableBeanFactory)) {
    throw new IllegalStateException("ScriptFactoryPostProcessor doesn't work with a BeanFactory "
        + "which does not implement ConfigurableBeanFactory: " + beanFactory.getClass());
}
this.beanFactory = (ConfigurableBeanFactory) beanFactory;

// Required so that references (up container hierarchies) are correctly
// resolved.
this.scriptBeanFactory.setParentBeanFactory(this.beanFactory);

// Required so that all BeanPostProcessors, Scopes, etc become
// available.
this.scriptBeanFactory.copyConfigurationFrom(this.beanFactory);

// Filter out BeanPostProcessors that are part of the AOP
// infrastructure,
// since those are only meant to apply to beans defined in the original
// factory.
for (Iterator<BeanPostProcessor> it = this.scriptBeanFactory.getBeanPostProcessors().iterator(); it
    .hasNext();) {
    if (it.next() instanceof AopInfrastructureBean) {
    it.remove();
    }
}
   }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号