NullChannel now implements PollableChannel instead of MessageChannel only.

This commit is contained in:
Mark Fisher
2008-09-08 16:49:05 +00:00
parent bef98c7f53
commit 3c50a23d85
2 changed files with 8 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -32,15 +32,11 @@ import org.springframework.integration.message.selector.MessageSelector;
*
* @author Mark Fisher
*/
public class NullChannel implements MessageChannel {
public class NullChannel implements PollableChannel {
private Log logger = LogFactory.getLog(this.getClass());
public List<Message<?>> clear() {
return null;
}
/**
* Always returns <code>null</code>.
*/
@@ -48,24 +44,22 @@ public class NullChannel implements MessageChannel {
return null;
}
public List<Message<?>> clear() {
return null;
}
public List<Message<?>> purge(MessageSelector selector) {
return null;
}
/**
* The channel name cannot be set. It is always <code>null</code>.
*/
public void setName(String name) {
}
public Message receive() {
public Message<?> receive() {
if (logger.isDebugEnabled()) {
logger.debug("receive called on null-channel");
}
return null;
}
public Message receive(long timeout) {
public Message<?> receive(long timeout) {
return this.receive();
}