PollingSourceAdapter does schedule tasks when connected to a SynchronousChannel (INT-187).

This commit is contained in:
Mark Fisher
2008-04-11 12:18:03 +00:00
parent 64d46f7e67
commit 87e5edb0dc
2 changed files with 2 additions and 7 deletions

View File

@@ -39,6 +39,7 @@ public class ByteStreamSourceAdapterTests {
MessageChannel channel = new SimpleChannel();
ByteStreamSourceAdapter adapter = new ByteStreamSourceAdapter(stream);
adapter.setChannel(channel);
adapter.setInitialDelay(10000);
adapter.start();
int count = adapter.processMessages();
assertEquals(1, count);
@@ -62,6 +63,7 @@ public class ByteStreamSourceAdapterTests {
MessageChannel channel = new SimpleChannel();
ByteStreamSourceAdapter adapter = new ByteStreamSourceAdapter(stream);
adapter.setChannel(channel);
adapter.setInitialDelay(10000);
adapter.setBytesPerMessage(8);
adapter.setMaxMessagesPerTask(5);
adapter.start();

View File

@@ -121,13 +121,6 @@ public class PollingSourceAdapter<T> extends AbstractSourceAdapter<T> implements
if (!this.isInitialized()) {
this.afterPropertiesSet();
}
if (this.getChannel() instanceof SynchronousChannel) {
if (logger.isInfoEnabled()) {
logger.info("source adapter configured on synchronous channel, not scheduling");
}
this.running = true;
return;
}
if (this.scheduler == null) {
if (logger.isInfoEnabled()) {
logger.info("no task scheduler has been provided, will create one");