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();
}
}
}
MyScriptFactoryPostProcessor.java 文件源码
java
阅读 19
收藏 0
点赞 0
评论 0
项目:game
作者:
评论列表
文章目录