use of org.springframework.beans.factory.support.BeanDefinitionBuilder in project elastic-job by dangdangdotcom.
the class SimpleJobBeanDefinitionParser method getJobTypeConfigurationBeanDefinition.
@Override
protected BeanDefinition getJobTypeConfigurationBeanDefinition(final BeanDefinition jobCoreConfigurationBeanDefinition, final Element element) {
BeanDefinitionBuilder result = BeanDefinitionBuilder.rootBeanDefinition(SimpleJobConfiguration.class);
result.addConstructorArgValue(jobCoreConfigurationBeanDefinition);
result.addConstructorArgValue(element.getAttribute(CLASS_ATTRIBUTE));
return result.getBeanDefinition();
}
use of org.springframework.beans.factory.support.BeanDefinitionBuilder in project sharding-jdbc by dangdangdotcom.
the class MasterSlaveDataSourceBeanDefinitionParser method parseInternal.
@Override
protected //CHECKSTYLE:OFF
AbstractBeanDefinition parseInternal(final Element element, final ParserContext parserContext) {
//CHECKSTYLE:ON
BeanDefinitionBuilder factory = BeanDefinitionBuilder.rootBeanDefinition(MasterSlaveDataSource.class);
factory.addConstructorArgValue(parseId(element));
factory.addConstructorArgReference(parseMasterDataSourceRef(element));
factory.addConstructorArgValue(parseSlaveDataSources(element, parserContext));
return factory.getBeanDefinition();
}
use of org.springframework.beans.factory.support.BeanDefinitionBuilder in project elastic-job by dangdangdotcom.
the class ZookeeperBeanDefinitionParser method parseInternal.
@Override
protected AbstractBeanDefinition parseInternal(final Element element, final ParserContext parserContext) {
BeanDefinitionBuilder result = BeanDefinitionBuilder.rootBeanDefinition(ZookeeperRegistryCenter.class);
result.addConstructorArgValue(buildZookeeperConfigurationBeanDefinition(element));
result.setInitMethodName("init");
return result.getBeanDefinition();
}
use of org.springframework.beans.factory.support.BeanDefinitionBuilder in project elastic-job by dangdangdotcom.
the class ZookeeperBeanDefinitionParser method buildZookeeperConfigurationBeanDefinition.
private AbstractBeanDefinition buildZookeeperConfigurationBeanDefinition(final Element element) {
BeanDefinitionBuilder configuration = BeanDefinitionBuilder.rootBeanDefinition(ZookeeperConfiguration.class);
configuration.addConstructorArgValue(element.getAttribute("server-lists"));
configuration.addConstructorArgValue(element.getAttribute("namespace"));
addPropertyValueIfNotEmpty("base-sleep-time-milliseconds", "baseSleepTimeMilliseconds", element, configuration);
addPropertyValueIfNotEmpty("max-sleep-time-milliseconds", "maxSleepTimeMilliseconds", element, configuration);
addPropertyValueIfNotEmpty("max-retries", "maxRetries", element, configuration);
addPropertyValueIfNotEmpty("session-timeout-milliseconds", "sessionTimeoutMilliseconds", element, configuration);
addPropertyValueIfNotEmpty("connection-timeout-milliseconds", "connectionTimeoutMilliseconds", element, configuration);
addPropertyValueIfNotEmpty("digest", "digest", element, configuration);
return configuration.getBeanDefinition();
}
use of org.springframework.beans.factory.support.BeanDefinitionBuilder in project opennms by OpenNMS.
the class ReferenceListBeanDefinitionParser method parseListener.
private BeanDefinitionBuilder parseListener(Element element) {
BeanDefinitionBuilder listener = BeanDefinitionBuilder.rootBeanDefinition(RegistrationListenerBean.class);
listener.addPropertyReference("target", element.getAttribute("ref"));
listener.addPropertyValue("serviceInterface", m_serviceInterface);
listener.addPropertyValue("bindMethod", element.getAttribute("bind-method"));
listener.addPropertyValue("unbindMethod", element.getAttribute("unbind-method"));
return listener;
}
Aggregations