Removed the PollableSource interface, and migrated the 'receive()' method to MessageSource.

This commit is contained in:
Mark Fisher
2008-09-26 16:31:26 +00:00
parent 78c49157bd
commit 9ee921ed7c
18 changed files with 35 additions and 141 deletions

View File

@@ -22,15 +22,15 @@ import java.io.InputStream;
import org.springframework.integration.message.GenericMessage;
import org.springframework.integration.message.Message;
import org.springframework.integration.message.MessageSource;
import org.springframework.integration.message.MessagingException;
import org.springframework.integration.message.PollableSource;
/**
* A pollable source for receiving bytes from an {@link InputStream}.
*
* @author Mark Fisher
*/
public class ByteStreamSource implements PollableSource<byte[]> {
public class ByteStreamSource implements MessageSource<byte[]> {
private BufferedInputStream stream;

View File

@@ -23,8 +23,8 @@ import java.io.Reader;
import java.io.UnsupportedEncodingException;
import org.springframework.integration.ConfigurationException;
import org.springframework.integration.message.MessageSource;
import org.springframework.integration.message.MessagingException;
import org.springframework.integration.message.PollableSource;
import org.springframework.integration.message.StringMessage;
import org.springframework.util.Assert;
@@ -33,7 +33,7 @@ import org.springframework.util.Assert;
*
* @author Mark Fisher
*/
public class CharacterStreamSource implements PollableSource<String> {
public class CharacterStreamSource implements MessageSource<String> {
private final BufferedReader reader;

View File

@@ -35,7 +35,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.ConfigurationException;
import org.springframework.integration.endpoint.SourcePollingChannelAdapter;
import org.springframework.integration.message.Message;
import org.springframework.integration.message.PollableSource;
import org.springframework.integration.message.MessageSource;
/**
* @author Mark Fisher
@@ -54,7 +54,7 @@ public class ConsoleInboundChannelAdapterParserTests {
"consoleInboundChannelAdapterParserTests.xml", ConsoleInboundChannelAdapterParserTests.class);
SourcePollingChannelAdapter adapter =
(SourcePollingChannelAdapter) context.getBean("adapterWithDefaultCharset.adapter");
PollableSource<?> source = (PollableSource<?>) new DirectFieldAccessor(adapter).getPropertyValue("source");
MessageSource<?> source = (MessageSource<?>) new DirectFieldAccessor(adapter).getPropertyValue("source");
DirectFieldAccessor sourceAccessor = new DirectFieldAccessor(source);
Reader bufferedReader = (Reader) sourceAccessor.getPropertyValue("reader");
assertEquals(BufferedReader.class, bufferedReader.getClass());
@@ -74,7 +74,7 @@ public class ConsoleInboundChannelAdapterParserTests {
"consoleInboundChannelAdapterParserTests.xml", ConsoleInboundChannelAdapterParserTests.class);
SourcePollingChannelAdapter adapter =
(SourcePollingChannelAdapter) context.getBean("adapterWithProvidedCharset.adapter");
PollableSource<?> source = (PollableSource<?>) new DirectFieldAccessor(adapter).getPropertyValue("source");
MessageSource<?> source = (MessageSource<?>) new DirectFieldAccessor(adapter).getPropertyValue("source");
DirectFieldAccessor sourceAccessor = new DirectFieldAccessor(source);
Reader bufferedReader = (Reader) sourceAccessor.getPropertyValue("reader");
assertEquals(BufferedReader.class, bufferedReader.getClass());