INT-1411 added tests for asyncReceive operations

This commit is contained in:
Mark Fisher
2010-09-03 00:37:43 +00:00
parent e600243ea8
commit 9e4a84257b
3 changed files with 82 additions and 12 deletions

View File

@@ -27,11 +27,11 @@ import org.springframework.integration.MessageChannel;
*/
public interface AsyncMessagingOperations {
<P> Future<Message<P>> asyncReceive();
Future<Message<?>> asyncReceive();
<P> Future<Message<P>> asyncReceive(PollableChannel channel);
Future<Message<?>> asyncReceive(PollableChannel channel);
<P> Future<Message<P>> asyncReceive(String channelName);
Future<Message<?>> asyncReceive(String channelName);
<R> Future<R> asyncReceiveAndConvert();

View File

@@ -42,25 +42,25 @@ public class AsyncMessagingTemplate extends MessagingTemplate implements AsyncMe
(AsyncTaskExecutor) executor : new TaskExecutorAdapter(executor);
}
public <P> Future<Message<P>> asyncReceive() {
return this.executor.submit(new Callable<Message<P>>() {
public Message<P> call() throws Exception {
public Future<Message<?>> asyncReceive() {
return this.executor.submit(new Callable<Message<?>>() {
public Message<?> call() throws Exception {
return receive();
}
});
}
public <P> Future<Message<P>> asyncReceive(final PollableChannel channel) {
return this.executor.submit(new Callable<Message<P>>() {
public Message<P> call() throws Exception {
public Future<Message<?>> asyncReceive(final PollableChannel channel) {
return this.executor.submit(new Callable<Message<?>>() {
public Message<?> call() throws Exception {
return receive(channel);
}
});
}
public <P> Future<Message<P>> asyncReceive(final String channelName) {
return this.executor.submit(new Callable<Message<P>>() {
public Message<P> call() throws Exception {
public Future<Message<?>> asyncReceive(final String channelName) {
return this.executor.submit(new Callable<Message<?>>() {
public Message<?> call() throws Exception {
return receive(channelName);
}
});