org.springframework.integration.gateway
Class RequestReplyTemplate.ReplyHandlingChannelAdapter

java.lang.Object
  extended by org.springframework.integration.gateway.RequestReplyTemplate.ReplyHandlingChannelAdapter
All Implemented Interfaces:
MessageChannel, BlockingSource, BlockingTarget, MessageSource, MessageTarget
Enclosing class:
RequestReplyTemplate

private static class RequestReplyTemplate.ReplyHandlingChannelAdapter
extends java.lang.Object
implements MessageChannel


Field Summary
private  Message<?> originalMessage
           
private  ReplyHandler replyHandler
           
 
Constructor Summary
RequestReplyTemplate.ReplyHandlingChannelAdapter(Message<?> originalMessage, ReplyHandler replyHandler)
           
 
Method Summary
 java.util.List<Message<?>> clear()
          Remove all Messages from this channel.
 java.lang.String getName()
          Return the name of this channel.
 java.util.List<Message<?>> purge(MessageSelector selector)
          Remove any Messages that are not accepted by the provided selector.
 Message receive()
          Receive a message, blocking indefinitely if necessary.
 Message receive(long timeout)
          Receive a message, blocking until either a message is available or the specified timeout period elapses.
 boolean send(Message<?> message)
          Send a message, blocking indefinitely if necessary.
 boolean send(Message<?> message, long timeout)
          Send a message, blocking until either the message is accepted or the specified timeout period elapses.
 void setName(java.lang.String name)
          Set the name of this channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

originalMessage

private final Message<?> originalMessage

replyHandler

private final ReplyHandler replyHandler
Constructor Detail

RequestReplyTemplate.ReplyHandlingChannelAdapter

RequestReplyTemplate.ReplyHandlingChannelAdapter(Message<?> originalMessage,
                                                 ReplyHandler replyHandler)
Method Detail

clear

public java.util.List<Message<?>> clear()
Description copied from interface: MessageChannel
Remove all Messages from this channel.

Specified by:
clear in interface MessageChannel

getName

public java.lang.String getName()
Description copied from interface: MessageChannel
Return the name of this channel.

Specified by:
getName in interface MessageChannel

purge

public java.util.List<Message<?>> purge(MessageSelector selector)
Description copied from interface: MessageChannel
Remove any Messages that are not accepted by the provided selector.

Specified by:
purge in interface MessageChannel

setName

public void setName(java.lang.String name)
Description copied from interface: MessageChannel
Set the name of this channel.

Specified by:
setName in interface MessageChannel

receive

public Message receive()
Description copied from interface: BlockingSource
Receive a message, blocking indefinitely if necessary.

Specified by:
receive in interface BlockingSource
Specified by:
receive in interface MessageSource
Returns:
the next available Message or null if interrupted

receive

public Message receive(long timeout)
Description copied from interface: BlockingSource
Receive a message, blocking until either a message is available or the specified timeout period elapses.

Specified by:
receive in interface BlockingSource
Parameters:
timeout - the timeout in milliseconds
Returns:
the next available Message or null if the specified timeout period elapses or the message reception is interrupted

send

public boolean send(Message<?> message)
Description copied from interface: BlockingTarget
Send a message, blocking indefinitely if necessary.

Specified by:
send in interface BlockingTarget
Specified by:
send in interface MessageTarget
Parameters:
message - the Message to send
Returns:
true if the message is sent successfully, false if interrupted

send

public boolean send(Message<?> message,
                    long timeout)
Description copied from interface: BlockingTarget
Send a message, blocking until either the message is accepted or the specified timeout period elapses.

Specified by:
send in interface BlockingTarget
Parameters:
message - the Message to send
timeout - the timeout in milliseconds
Returns:
true if the message is sent successfully, false if the specified timeout period elapses or the send is interrupted