The <poller/> element now accepts the "initial-delay" and "fixed-rate" (boolean) attributes (INT-326).

This commit is contained in:
Mark Fisher
2008-08-05 16:37:32 +00:00
parent 8e1c52b312
commit a0b603b0fe
2 changed files with 12 additions and 0 deletions

View File

@@ -148,6 +148,16 @@ public abstract class IntegrationNamespaceUtils {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(PollingDispatcher.class);
Long period = Long.valueOf(element.getAttribute("period"));
PollingSchedule schedule = new PollingSchedule(period);
String initialDelay = element.getAttribute("initial-delay");
if (StringUtils.hasText(initialDelay)) {
schedule.setInitialDelay(Long.valueOf(initialDelay));
}
if ("true".equals(element.getAttribute("fixed-rate").toLowerCase())) {
schedule.setFixedRate(true);
}
else {
schedule.setFixedRate(false);
}
String templateBeanName = parseMessageExhangeTemplate(element, parserContext);
builder.addConstructorArgReference(sourceBeanName);
builder.addConstructorArgValue(schedule);

View File

@@ -229,6 +229,8 @@
<xsd:element name="transactional" type="transactionalType" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="period" type="xsd:long" use="required"/>
<xsd:attribute name="initial-delay" type="xsd:long"/>
<xsd:attribute name="fixed-rate" type="xsd:boolean"/>
<xsd:attribute name="receive-timeout" type="xsd:long"/>
<xsd:attribute name="send-timeout" type="xsd:long"/>
<xsd:attribute name="max-messages-per-poll" type="xsd:long"/>