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:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -58,7 +58,7 @@ public class CharacterStreamSource implements PollableSource<String> {
|
||||
}
|
||||
|
||||
|
||||
public StringMessage poll() {
|
||||
public StringMessage receive() {
|
||||
try {
|
||||
synchronized (this.monitor) {
|
||||
if (!this.reader.ready()) {
|
||||
|
||||
Reference in New Issue
Block a user