From a35a8e1143918db1848c6ae2ae1f36df053deddf Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Mon, 22 Sep 2008 00:21:26 +0000 Subject: [PATCH] Added a getDefaultPollInterval() method and a "default-default" value of 1000 (1 second). --- .../AbstractPollingInboundChannelAdapterParser.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/config/AbstractPollingInboundChannelAdapterParser.java b/org.springframework.integration/src/main/java/org/springframework/integration/config/AbstractPollingInboundChannelAdapterParser.java index 19c1b573a4..e859331171 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/config/AbstractPollingInboundChannelAdapterParser.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/config/AbstractPollingInboundChannelAdapterParser.java @@ -53,11 +53,19 @@ public abstract class AbstractPollingInboundChannelAdapterParser extends Abstrac } } else { - adapterBuilder.addPropertyValue("schedule", new PollingSchedule(0)); + adapterBuilder.addPropertyValue("schedule", new PollingSchedule(this.getDefaultPollInterval())); } return adapterBuilder.getBeanDefinition(); } + /** + * Subclasses may override this to provide the default poll interval (when + * no 'schedule' is configured). Otherwise, the value will be 1 second. + */ + protected int getDefaultPollInterval() { + return 1000; + } + /** * Subclasses must implement this method to parse the PollableSource instance * which the created Channel Adapter will poll.