org.springframework.integration.message
Class AsyncMessageExchangeTemplate
java.lang.Object
org.springframework.integration.message.MessageExchangeTemplate
org.springframework.integration.message.AsyncMessageExchangeTemplate
- All Implemented Interfaces:
- org.springframework.beans.factory.InitializingBean
public class AsyncMessageExchangeTemplate
- extends MessageExchangeTemplate
An asynchronous version of the MessageExchangeTemplate
.
- Author:
- Mark Fisher
Field Summary |
private org.springframework.core.task.TaskExecutor |
taskExecutor
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
taskExecutor
private final org.springframework.core.task.TaskExecutor taskExecutor
AsyncMessageExchangeTemplate
public AsyncMessageExchangeTemplate(org.springframework.core.task.TaskExecutor taskExecutor)
send
public boolean send(Message<?> message,
MessageTarget target)
- Send the provided message to the given target. Note that the actual
sending occurs asynchronously, so this method will always return
true
unless an exception is thrown by the executor.
- Overrides:
send
in class MessageExchangeTemplate
sendAndReceive
public Message<?> sendAndReceive(Message<?> request,
MessageTarget target)
- Send the provided message to the given target and receive the
result as an
AsyncMessage
.
- Overrides:
sendAndReceive
in class MessageExchangeTemplate
receive
public Message<?> receive(PollableSource<?> source)
- Receive an
AsyncMessage
from the provided source.
- Overrides:
receive
in class MessageExchangeTemplate
receiveAndForward
public boolean receiveAndForward(PollableSource<?> source,
MessageTarget target)
- Receive a Message from the provided source and if not
null
,
send it to the given target. Note that the receive and send operations
occur asynchronously, so this method will always return true
unless an exception is thrown by the executor.
- Overrides:
receiveAndForward
in class MessageExchangeTemplate