本文整理汇总了Java中org.springframework.beans.factory.support.BeanDefinitionBuilder.addConstructorArgReference方法的典型用法代码示例。如果您正苦于以下问题:Java BeanDefinitionBuilder.addConstructorArgReference方法的具体用法?Java BeanDefinitionBuilder.addConstructorArgReference怎么用?Java BeanDefinitionBuilder.addConstructorArgReference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.beans.factory.support.BeanDefinitionBuilder
的用法示例。
在下文中一共展示了BeanDefinitionBuilder.addConstructorArgReference方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseDeclareParents
import org.springframework.beans.factory.support.BeanDefinitionBuilder; //导入方法依赖的package包/类
/**
* Parse a '{@code declare-parents}' element and register the appropriate
* DeclareParentsAdvisor with the BeanDefinitionRegistry encapsulated in the
* supplied ParserContext.
*/
private AbstractBeanDefinition parseDeclareParents(Element declareParentsElement, ParserContext parserContext) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(DeclareParentsAdvisor.class);
builder.addConstructorArgValue(declareParentsElement.getAttribute(IMPLEMENT_INTERFACE));
builder.addConstructorArgValue(declareParentsElement.getAttribute(TYPE_PATTERN));
String defaultImpl = declareParentsElement.getAttribute(DEFAULT_IMPL);
String delegateRef = declareParentsElement.getAttribute(DELEGATE_REF);
if (StringUtils.hasText(defaultImpl) && !StringUtils.hasText(delegateRef)) {
builder.addConstructorArgValue(defaultImpl);
}
else if (StringUtils.hasText(delegateRef) && !StringUtils.hasText(defaultImpl)) {
builder.addConstructorArgReference(delegateRef);
}
else {
parserContext.getReaderContext().error(
"Exactly one of the " + DEFAULT_IMPL + " or " + DELEGATE_REF + " attributes must be specified",
declareParentsElement, this.parseState.snapshot());
}
AbstractBeanDefinition definition = builder.getBeanDefinition();
definition.setSource(parserContext.extractSource(declareParentsElement));
parserContext.getReaderContext().registerWithGeneratedName(definition);
return definition;
}
示例2: parse
import org.springframework.beans.factory.support.BeanDefinitionBuilder; //导入方法依赖的package包/类
@Override
public BeanDefinition parse(Element element, ParserContext parserContext) {
//Sort out the Config Class
BeanDefinitionBuilder configBuilder
= helper.createBeanDefinitionBuilder(element, parserContext,
Config.class);
String configId = helper.getId(null, configBuilder, parserContext);
helper.parseAttributes(element, parserContext, configBuilder);
helper.registerBeanDefinition(configBuilder, configId,
null, parserContext);
//Do the main Redisson bean
BeanDefinitionBuilder builder
= helper.createBeanDefinitionBuilder(element, parserContext,
Redisson.class);
builder.setFactoryMethod("create");
builder.setDestroyMethodName("shutdown");
builder.addConstructorArgReference(configId);
parserContext.getDelegate().parseQualifierElements(element,
builder.getRawBeanDefinition());
String id = helper.getId(element, builder, parserContext);
helper.parseAttributes(element, parserContext, configBuilder);
//Sort out all the nested elements
parseChildElements(element, configId, id, builder, parserContext);
helper.registerBeanDefinition(builder, id,
helper.parseAliase(element), parserContext);
return builder.getBeanDefinition();
}
示例3: runnableReference
import org.springframework.beans.factory.support.BeanDefinitionBuilder; //导入方法依赖的package包/类
private RuntimeBeanReference runnableReference(String ref, String method, Element taskElement, ParserContext parserContext) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(
"org.springframework.scheduling.support.ScheduledMethodRunnable");
builder.addConstructorArgReference(ref);
builder.addConstructorArgValue(method);
return beanReference(taskElement, parserContext, builder);
}
示例4: intervalTaskReference
import org.springframework.beans.factory.support.BeanDefinitionBuilder; //导入方法依赖的package包/类
private RuntimeBeanReference intervalTaskReference(String runnableBeanName,
String initialDelay, String interval, Element taskElement, ParserContext parserContext) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(
"org.springframework.scheduling.config.IntervalTask");
builder.addConstructorArgReference(runnableBeanName);
builder.addConstructorArgValue(interval);
builder.addConstructorArgValue(StringUtils.hasLength(initialDelay) ? initialDelay : ZERO_INITIAL_DELAY);
return beanReference(taskElement, parserContext, builder);
}
示例5: cronTaskReference
import org.springframework.beans.factory.support.BeanDefinitionBuilder; //导入方法依赖的package包/类
private RuntimeBeanReference cronTaskReference(String runnableBeanName,
String cronExpression, Element taskElement, ParserContext parserContext) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(
"org.springframework.scheduling.config.CronTask");
builder.addConstructorArgReference(runnableBeanName);
builder.addConstructorArgValue(cronExpression);
return beanReference(taskElement, parserContext, builder);
}
示例6: triggerTaskReference
import org.springframework.beans.factory.support.BeanDefinitionBuilder; //导入方法依赖的package包/类
private RuntimeBeanReference triggerTaskReference(String runnableBeanName,
String triggerBeanName, Element taskElement, ParserContext parserContext) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(
"org.springframework.scheduling.config.TriggerTask");
builder.addConstructorArgReference(runnableBeanName);
builder.addConstructorArgReference(triggerBeanName);
return beanReference(taskElement, parserContext, builder);
}
示例7: createJdbcTemplate
import org.springframework.beans.factory.support.BeanDefinitionBuilder; //导入方法依赖的package包/类
protected final AbstractBeanDefinition createJdbcTemplate(String dataSourceName) {
BeanDefinitionBuilder bdb = BeanDefinitionBuilder.genericBeanDefinition(JdbcTemplate.class);
bdb.addConstructorArgReference(dataSourceName);
return bdb.getRawBeanDefinition();
}
示例8: buildWorkerNodeRegisterBeanDefinition
import org.springframework.beans.factory.support.BeanDefinitionBuilder; //导入方法依赖的package包/类
private AbstractBeanDefinition buildWorkerNodeRegisterBeanDefinition(final Element element, final ParserContext parserContext) {
BeanDefinitionBuilder result = BeanDefinitionBuilder.rootBeanDefinition(ZookeeperWorkerRegister.class);
result.addConstructorArgReference(element.getAttribute(GeneratorBeanDefinitionTag.REGISTRY_CENTER_REF));
result.addConstructorArgValue(buildApplicationConfigurationBeanDefinition(element, parserContext));
return result.getBeanDefinition();
}
示例9: createTransactionManager
import org.springframework.beans.factory.support.BeanDefinitionBuilder; //导入方法依赖的package包/类
protected final AbstractBeanDefinition createTransactionManager(String dataSourceName) {
BeanDefinitionBuilder bdb = BeanDefinitionBuilder.genericBeanDefinition(DataSourceTransactionManager.class);
bdb.addConstructorArgReference(dataSourceName);
return bdb.getRawBeanDefinition();
}