@Override
public void postProcessBeanDefinitionRegistry(
BeanDefinitionRegistry registry) throws BeansException {
if (this.mongoTemplate == null) {
if (this.repoId != null) {
// Fetch the MongoTemplate Bean Id
//
BeanDefinition repo = registry.getBeanDefinition(this.repoId);
this.templateId = ((BeanReference)repo.getPropertyValues().get("mongoOperations")).getBeanName();
}
// Check to make sure we have a reference to the MongoTemplate
//
if (this.templateId == null) {
throw new RuntimeException("Unable to obtain a reference to a MongoTemplate");
}
}
// Add in CascadeSupport
//
BeanDefinition mongoCascadeSupportBean = BeanDefinitionBuilder
.genericBeanDefinition(MongoCascadeSupport.class)
.getBeanDefinition();
ConstructorArgumentValues args = mongoCascadeSupportBean.getConstructorArgumentValues();
args.addIndexedArgumentValue(0, this);
registry.registerBeanDefinition(Long.toString((new Random()).nextLong()), mongoCascadeSupportBean);
}
MongoPersister.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:statefulj
作者:
评论列表
文章目录