INT-1493 poslishing, added comment to SPCAFB about why 1 should be a default maxMessagesPerPoll, change assertion for BF in APE only when it is absolutely required

This commit is contained in:
Oleg Zhurakousky
2010-10-12 08:19:14 -04:00
parent 46e5ef3e14
commit 5f27825974
2 changed files with 3 additions and 1 deletions

View File

@@ -126,6 +126,8 @@ public class SourcePollingChannelAdapterFactoryBean implements FactoryBean<Sourc
+ this.beanName + "', and no default poller is available within the context.");
}
if (this.pollerMetadata.getMaxMessagesPerPoll() < 1){
// the default is 1 since a source might return
// a non-null and non-interruptable value every time it is invoked
this.pollerMetadata.setMaxMessagesPerPoll(1);
}
spca.setPollerMetadata(this.pollerMetadata);

View File

@@ -84,7 +84,6 @@ public abstract class AbstractPollingEndpoint extends AbstractEndpoint implement
return;
}
Assert.notNull(this.pollerMetadata.getTrigger(), "Trigger is required");
Assert.notNull(this.getBeanFactory(), "BeanFactory is required");
TaskExecutor providedExecutor = this.pollerMetadata.getTaskExecutor();
if (providedExecutor != null) {
this.taskExecutor = providedExecutor;
@@ -92,6 +91,7 @@ public abstract class AbstractPollingEndpoint extends AbstractEndpoint implement
if (this.taskExecutor != null) {
if (!(this.taskExecutor instanceof ErrorHandlingTaskExecutor)) {
if (this.errorHandler == null) {
Assert.notNull(this.getBeanFactory(), "BeanFactory is required");
this.errorHandler = new MessagePublishingErrorHandler(
new BeanFactoryChannelResolver(getBeanFactory()));
}