public abstract class AbstractDestinationResolvingMessagingTemplate<D> extends AbstractMessagingTemplate<D> implements DestinationResolvingMessageSendingOperations<D>, DestinationResolvingMessageReceivingOperations<D>, DestinationResolvingMessageRequestReplyOperations<D>
AbstractMessagingTemplate that adds operations for sending
messages to a resolvable destination name as defined by the following interfaces:
logger| Constructor and Description |
|---|
AbstractDestinationResolvingMessagingTemplate() |
| Modifier and Type | Method and Description |
|---|---|
<T> void |
convertAndSend(String destinationName,
T payload)
Resolve the given destination name to a destination, convert the payload Object
to serialized form, possibly using a
MessageConverter,
wrap it as a message and send it to the resolved destination. |
<T> void |
convertAndSend(String destinationName,
T payload,
Map<String,Object> headers)
Resolve the given destination name to a destination, convert the payload
Object to serialized form, possibly using a
MessageConverter,
wrap it as a message with the given headers and send it to the resolved
destination. |
<T> void |
convertAndSend(String destinationName,
T payload,
Map<String,Object> headers,
MessagePostProcessor postProcessor)
Resolve the given destination name to a destination, convert the payload
Object to serialized form, possibly using a
MessageConverter,
wrap it as a message with the given headers, apply the given post processor,
and send the resulting message to the resolved destination. |
<T> void |
convertAndSend(String destinationName,
T payload,
MessagePostProcessor postProcessor)
Resolve the given destination name to a destination, convert the payload
Object to serialized form, possibly using a
MessageConverter,
wrap it as a message, apply the given post processor, and send the resulting
message to the resolved destination. |
<T> T |
convertSendAndReceive(String destinationName,
Object request,
Class<T> targetClass)
Resolve the given destination name, convert the payload request Object
to serialized form, possibly using a
MessageConverter,
wrap it as a message and send it to the resolved destination, receive a reply
and convert its body to the specified target class. |
<T> T |
convertSendAndReceive(String destinationName,
Object request,
Class<T> targetClass,
MessagePostProcessor postProcessor)
Resolve the given destination name, convert the payload request Object
to serialized form, possibly using a
MessageConverter,
wrap it as a message, apply the given post process, and send the resulting
message to the resolved destination, then receive a reply and convert its
body to the specified target class. |
<T> T |
convertSendAndReceive(String destinationName,
Object request,
Map<String,Object> headers,
Class<T> targetClass)
Resolve the given destination name, convert the payload request Object
to serialized form, possibly using a
MessageConverter,
wrap it as a message with the given headers and send it to the resolved destination,
receive a reply and convert its body to the specified target class. |
<T> T |
convertSendAndReceive(String destinationName,
Object request,
Map<String,Object> headers,
Class<T> targetClass,
MessagePostProcessor postProcessor)
Resolve the given destination name, convert the payload request Object
to serialized form, possibly using a
MessageConverter,
wrap it as a message with the given headers, apply the given post process,
and send the resulting message to the resolved destination, then receive
a reply and convert its body to the specified target class. |
DestinationResolver<D> |
getDestinationResolver()
Return the configured destination resolver.
|
Message<?> |
receive(String destinationName)
Resolve the given destination name and receive a message from it.
|
<T> T |
receiveAndConvert(String destinationName,
Class<T> targetClass)
Resolve the given destination name, receive a message from it, convert the
payload to the specified target type.
|
protected D |
resolveDestination(String destinationName) |
void |
send(String destinationName,
Message<?> message)
Resolve the given destination name to a destination and send a message to it.
|
Message<?> |
sendAndReceive(String destinationName,
Message<?> requestMessage)
Resolve the given destination name to a destination and send the given message,
receive a reply and return it.
|
void |
setDestinationResolver(DestinationResolver<D> destinationResolver)
Configure the
DestinationResolver to use to resolve String destination
names into actual destinations of type <D>. |
convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, doReceive, doSendAndReceive, receive, receive, receiveAndConvert, receiveAndConvert, sendAndReceive, sendAndReceiveconvertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, doSend, getDefaultDestination, getMessageConverter, getRequiredDefaultDestination, processHeadersToSend, send, send, setDefaultDestination, setMessageConverterclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconvertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, send, sendreceive, receive, receiveAndConvert, receiveAndConvertconvertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, sendAndReceive, sendAndReceivepublic AbstractDestinationResolvingMessagingTemplate()
public void setDestinationResolver(DestinationResolver<D> destinationResolver)
DestinationResolver to use to resolve String destination
names into actual destinations of type <D>.
This field does not have a default setting. If not configured, methods that
require resolving a destination name will raise an IllegalArgumentException.
destinationResolver - the destination resolver to usepublic DestinationResolver<D> getDestinationResolver()
public void send(String destinationName, Message<?> message)
DestinationResolvingMessageSendingOperationssend in interface DestinationResolvingMessageSendingOperations<D>destinationName - the destination name to resolvemessage - the message to sendpublic <T> void convertAndSend(String destinationName, T payload)
DestinationResolvingMessageSendingOperationsMessageConverter,
wrap it as a message and send it to the resolved destination.convertAndSend in interface DestinationResolvingMessageSendingOperations<D>destinationName - the destination name to resolvepayload - the Object to use as payloadpublic <T> void convertAndSend(String destinationName, T payload, Map<String,Object> headers)
DestinationResolvingMessageSendingOperationsMessageConverter,
wrap it as a message with the given headers and send it to the resolved
destination.convertAndSend in interface DestinationResolvingMessageSendingOperations<D>destinationName - the destination name to resolvepayload - the Object to use as payloadheaders - headers for the message to sendpublic <T> void convertAndSend(String destinationName, T payload, MessagePostProcessor postProcessor)
DestinationResolvingMessageSendingOperationsMessageConverter,
wrap it as a message, apply the given post processor, and send the resulting
message to the resolved destination.convertAndSend in interface DestinationResolvingMessageSendingOperations<D>destinationName - the destination name to resolvepayload - the Object to use as payloadpostProcessor - the post processor to apply to the messagepublic <T> void convertAndSend(String destinationName, T payload, Map<String,Object> headers, MessagePostProcessor postProcessor)
DestinationResolvingMessageSendingOperationsMessageConverter,
wrap it as a message with the given headers, apply the given post processor,
and send the resulting message to the resolved destination.convertAndSend in interface DestinationResolvingMessageSendingOperations<D>destinationName - the destination name to resolvepayload - the Object to use as payloadheaders - headers for the message to sendpostProcessor - the post processor to apply to the messagepublic Message<?> receive(String destinationName)
DestinationResolvingMessageReceivingOperationsreceive in interface DestinationResolvingMessageReceivingOperations<D>destinationName - the destination name to resolvepublic <T> T receiveAndConvert(String destinationName, Class<T> targetClass)
DestinationResolvingMessageReceivingOperationsreceiveAndConvert in interface DestinationResolvingMessageReceivingOperations<D>destinationName - the destination name to resolvetargetClass - the target class for the converted payloadpublic Message<?> sendAndReceive(String destinationName, Message<?> requestMessage)
DestinationResolvingMessageRequestReplyOperationssendAndReceive in interface DestinationResolvingMessageRequestReplyOperations<D>destinationName - the name of the target destinationrequestMessage - the mesage to sendnull if the message could not
be received, for example due to a timeoutpublic <T> T convertSendAndReceive(String destinationName, Object request, Class<T> targetClass)
DestinationResolvingMessageRequestReplyOperationsMessageConverter,
wrap it as a message and send it to the resolved destination, receive a reply
and convert its body to the specified target class.convertSendAndReceive in interface DestinationResolvingMessageRequestReplyOperations<D>destinationName - the name of the target destinationrequest - the payload for the request message to sendtargetClass - the target class to convert the payload of the reply tonull if
the message could not be received, for example due to a timeoutpublic <T> T convertSendAndReceive(String destinationName, Object request, Map<String,Object> headers, Class<T> targetClass)
DestinationResolvingMessageRequestReplyOperationsMessageConverter,
wrap it as a message with the given headers and send it to the resolved destination,
receive a reply and convert its body to the specified target class.convertSendAndReceive in interface DestinationResolvingMessageRequestReplyOperations<D>destinationName - the name of the target destinationrequest - the payload for the request message to sendheaders - the headers for the request message to sendtargetClass - the target class to convert the payload of the reply tonull if
the message could not be received, for example due to a timeoutpublic <T> T convertSendAndReceive(String destinationName, Object request, Class<T> targetClass, MessagePostProcessor postProcessor)
DestinationResolvingMessageRequestReplyOperationsMessageConverter,
wrap it as a message, apply the given post process, and send the resulting
message to the resolved destination, then receive a reply and convert its
body to the specified target class.convertSendAndReceive in interface DestinationResolvingMessageRequestReplyOperations<D>destinationName - the name of the target destinationrequest - the payload for the request message to sendtargetClass - the target class to convert the payload of the reply topostProcessor - post process for the request messagenull if
the message could not be received, for example due to a timeoutpublic <T> T convertSendAndReceive(String destinationName, Object request, Map<String,Object> headers, Class<T> targetClass, MessagePostProcessor postProcessor)
DestinationResolvingMessageRequestReplyOperationsMessageConverter,
wrap it as a message with the given headers, apply the given post process,
and send the resulting message to the resolved destination, then receive
a reply and convert its body to the specified target class.convertSendAndReceive in interface DestinationResolvingMessageRequestReplyOperations<D>destinationName - the name of the target destinationrequest - the payload for the request message to sendheaders - the headers for the request message to sendtargetClass - the target class to convert the payload of the reply topostProcessor - post process for the request messagenull if
the message could not be received, for example due to a timeout