TargetEndpoint now returns false when one of its MessageSelectors rejects a Message rather than throwing an Exception. Added Source, BlockingSource, and BlockingTarget interfaces. MessageChannel now extends BlockingSource and BlockingTarget.

This commit is contained in:
Mark Fisher
2008-04-17 21:06:14 +00:00
parent 0f6bd60ee0
commit 0bd9ea9255
22 changed files with 163 additions and 140 deletions

View File

@@ -84,7 +84,7 @@ public class FileSource implements PollableSource<Object>, InitializingBean {
}
}
public Message poll() {
public Message receive() {
File[] files = null;
if (this.fileFilter != null) {
files = this.directory.listFiles(this.fileFilter);

View File

@@ -120,7 +120,7 @@ public class FtpSource implements PollableSource<Object>, MessageDeliveryAware {
}
}
public final Message poll() {
public final Message receive() {
try {
this.establishConnection();
FTPFile[] fileList = this.client.listFiles();

View File

@@ -47,7 +47,7 @@ public class JmsPollableSource extends AbstractJmsTemplateBasedAdapter implement
}
public Message<Object> poll() {
public Message<Object> receive() {
Object receivedObject = this.getJmsTemplate().receiveAndConvert();
if (receivedObject == null) {
return null;

View File

@@ -67,7 +67,7 @@ public class ByteStreamSource implements PollableSource<byte[]> {
this.shouldTruncate = shouldTruncate;
}
public Message<byte[]> poll() {
public Message<byte[]> receive() {
try {
byte[] bytes;
int bytesRead = 0;

View File

@@ -58,7 +58,7 @@ public class CharacterStreamSource implements PollableSource<String> {
}
public StringMessage poll() {
public StringMessage receive() {
try {
synchronized (this.monitor) {
if (!this.reader.ready()) {