Removed BlockingChannel interface. The send(message, timeout) method is now defined directly in the top-level MessageChannel interface.

This commit is contained in:
Mark Fisher
2008-10-15 16:49:00 +00:00
parent 0afc835679
commit 11e3fbb584
9 changed files with 39 additions and 76 deletions

View File

@@ -206,12 +206,10 @@ public class MessageChannelTemplateTests {
public void sendWithReturnAddress() throws InterruptedException {
final List<String> replies = new ArrayList<String>(3);
final CountDownLatch latch = new CountDownLatch(3);
MessageChannel replyChannel = new MessageChannel() {
public String getName() {
return "testReplyChannel";
}
public boolean send(Message<?> replyMessage) {
replies.add((String) replyMessage.getPayload());
MessageChannel replyChannel = new AbstractMessageChannel() {
@Override
protected boolean doSend(Message<?> message, long timeout) {
replies.add((String) message.getPayload());
latch.countDown();
return true;
}

View File

@@ -26,7 +26,6 @@ import org.springframework.beans.DirectFieldAccessor;
import org.springframework.beans.FatalBeanException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.channel.BlockingChannel;
import org.springframework.integration.channel.DirectChannel;
import org.springframework.integration.channel.PollableChannel;
import org.springframework.integration.channel.PublishSubscribeChannel;
@@ -53,7 +52,7 @@ public class ChannelParserTests {
public void testChannelWithCapacity() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
"channelParserTests.xml", this.getClass());
BlockingChannel channel = (BlockingChannel) context.getBean("capacityChannel");
MessageChannel channel = (MessageChannel) context.getBean("capacityChannel");
for (int i = 0; i < 10; i++) {
boolean result = channel.send(new GenericMessage<String>("test"), 10);
assertTrue(result);