An explicit 'trigger' property is now required for the AbstractPollingEndpoint. It no longer creates an arbitrary default.

This commit is contained in:
Mark Fisher
2008-11-25 21:27:12 +00:00
parent db09791428
commit f572b370f3
7 changed files with 26 additions and 4 deletions

View File

@@ -28,7 +28,6 @@ import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.task.TaskExecutor;
import org.springframework.integration.channel.BeanFactoryChannelResolver;
import org.springframework.integration.channel.MessagePublishingErrorHandler;
import org.springframework.integration.scheduling.IntervalTrigger;
import org.springframework.integration.scheduling.Trigger;
import org.springframework.integration.util.ErrorHandler;
import org.springframework.integration.util.ErrorHandlingTaskExecutor;
@@ -137,9 +136,7 @@ public abstract class AbstractPollingEndpoint extends AbstractEndpoint implement
if (this.initialized) {
return;
}
if (this.trigger == null) {
this.trigger = new IntervalTrigger(10);
}
Assert.notNull(this.trigger, "trigger is required");
if (this.transactionManager != null) {
if (this.transactionDefinition == null) {
this.transactionDefinition = new DefaultTransactionDefinition();

View File

@@ -31,6 +31,7 @@ import org.springframework.integration.handler.ReplyMessageHolder;
import org.springframework.integration.message.ErrorMessage;
import org.springframework.integration.message.MessageHandler;
import org.springframework.integration.message.MessageDeliveryException;
import org.springframework.integration.scheduling.IntervalTrigger;
import org.springframework.util.Assert;
/**
@@ -178,6 +179,7 @@ public abstract class AbstractMessagingGateway extends AbstractEndpoint implemen
else if (this.replyChannel instanceof PollableChannel) {
PollingConsumer endpoint = new PollingConsumer(
(PollableChannel) this.replyChannel, handler);
endpoint.setTrigger(new IntervalTrigger(10));
endpoint.setBeanFactory(this.getBeanFactory());
endpoint.afterPropertiesSet();
correlator = endpoint;