Added ReplyHolder and modified signature of AbstractReplyProducingMessageConsumer to return void and accept this additional parameter instead.

This commit is contained in:
Mark Fisher
2008-10-13 19:30:23 +00:00
parent 78ae171dd7
commit 6f7bd01c2a
22 changed files with 249 additions and 245 deletions

View File

@@ -20,6 +20,7 @@ import java.io.Serializable;
import org.springframework.integration.channel.MessageChannel;
import org.springframework.integration.endpoint.AbstractReplyProducingMessageConsumer;
import org.springframework.integration.endpoint.ReplyHolder;
import org.springframework.integration.message.Message;
import org.springframework.integration.message.MessageHandlingException;
import org.springframework.remoting.RemoteAccessException;
@@ -49,10 +50,13 @@ public abstract class AbstractRemotingOutboundGateway extends AbstractReplyProdu
protected abstract MessageHandler createHandlerProxy(String url);
public final Message<?> handle(Message<?> message) {
public final void handle(Message<?> message, ReplyHolder replyHolder) {
this.verifySerializability(message);
try {
return this.handlerProxy.handle(message);
Message<?> reply = this.handlerProxy.handle(message);
if (reply != null) {
replyHolder.set(reply);
}
}
catch (RemoteAccessException e) {
throw new MessageHandlingException(message, "unable to handle message remotely", e);