类 AbstractMessagingTemplate<D>
- java.lang.Object
- org.springframework.messaging.core.AbstractMessageSendingTemplate<D>
- org.springframework.messaging.core.AbstractMessageReceivingTemplate<D>
- org.springframework.messaging.core.AbstractMessagingTemplate<D>
- 类型参数:
D- the destination type
- 所有已实现的接口:
MessageReceivingOperations<D>,MessageRequestReplyOperations<D>,MessageSendingOperations<D>
public abstract class AbstractMessagingTemplate<D> extends AbstractMessageReceivingTemplate<D> implements MessageRequestReplyOperations<D>
An extension ofAbstractMessageReceivingTemplatethat adds support for request-reply style operations as defined byMessageRequestReplyOperations.- 从以下版本开始:
- 4.0
- 作者:
- Mark Fisher, Rossen Stoyanchev, Stephane Nicoll
字段概要
从类继承的字段 org.springframework.messaging.core.AbstractMessageSendingTemplate
CONVERSION_HINT_HEADER, logger
构造器概要
构造器 构造器 说明 AbstractMessagingTemplate()
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 <T> TconvertSendAndReceive(D destination, Object request, Class<T> targetClass)Convert the given request Object to serialized form, possibly using aMessageConverter, send it as aMessageto the given destination, receive the reply and convert its body of the specified target class.<T> TconvertSendAndReceive(D destination, Object request, Class<T> targetClass, MessagePostProcessor postProcessor)Convert the given request Object to serialized form, possibly using aMessageConverter, apply the given post processor and send the resultingMessageto the given destination, receive the reply and convert its body of the given target class.<T> TconvertSendAndReceive(D destination, Object request, Map<String,Object> headers, Class<T> targetClass)Convert the given request Object to serialized form, possibly using aMessageConverter, send it as aMessagewith the given headers, to the specified destination, receive the reply and convert its body of the specified target class.<T> TconvertSendAndReceive(D destination, Object request, Map<String,Object> headers, Class<T> targetClass, MessagePostProcessor postProcessor)Convert the given request Object to serialized form, possibly using aMessageConverter, wrap it as a message with the given headers, apply the given post processor and send the resultingMessageto the specified destination, receive the reply and convert its body of the given target class.<T> TconvertSendAndReceive(Object request, Class<T> targetClass)Convert the given request Object to serialized form, possibly using aMessageConverter, send it as aMessageto a default destination, receive the reply and convert its body of the specified target class.<T> TconvertSendAndReceive(Object request, Class<T> targetClass, MessagePostProcessor postProcessor)Convert the given request Object to serialized form, possibly using aMessageConverter, apply the given post processor and send the resultingMessageto a default destination, receive the reply and convert its body of the given target class.protected abstract Message<?>doSendAndReceive(D destination, Message<?> requestMessage)Message<?>sendAndReceive(D destination, Message<?> requestMessage)Send a request message and receive the reply from the given destination.Message<?>sendAndReceive(Message<?> requestMessage)Send a request message and receive the reply from a default destination.从类继承的方法 org.springframework.messaging.core.AbstractMessageReceivingTemplate
doConvert, doReceive, receive, receive, receiveAndConvert, receiveAndConvert
从类继承的方法 org.springframework.messaging.core.AbstractMessageSendingTemplate
convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, doConvert, doSend, getDefaultDestination, getMessageConverter, getRequiredDefaultDestination, processHeadersToSend, send, send, setDefaultDestination, setMessageConverter
构造器详细资料
AbstractMessagingTemplate
public AbstractMessagingTemplate()
方法详细资料
sendAndReceive
@Nullable public Message<?> sendAndReceive(Message<?> requestMessage)
从接口复制的说明:MessageRequestReplyOperationsSend a request message and receive the reply from a default destination.- 指定者:
sendAndReceive在接口中MessageRequestReplyOperations<D>- 参数:
requestMessage- the message to send- 返回:
- the reply, possibly
nullif the message could not be received, for example due to a timeout
sendAndReceive
@Nullable public Message<?> sendAndReceive(D destination, Message<?> requestMessage)
从接口复制的说明:MessageRequestReplyOperationsSend a request message and receive the reply from the given destination.- 指定者:
sendAndReceive在接口中MessageRequestReplyOperations<D>- 参数:
destination- the target destinationrequestMessage- the message to send- 返回:
- the reply, possibly
nullif the message could not be received, for example due to a timeout
doSendAndReceive
@Nullable protected abstract Message<?> doSendAndReceive(D destination, Message<?> requestMessage)
convertSendAndReceive
@Nullable public <T> T convertSendAndReceive(Object request, Class<T> targetClass)
从接口复制的说明:MessageRequestReplyOperationsConvert the given request Object to serialized form, possibly using aMessageConverter, send it as aMessageto a default destination, receive the reply and convert its body of the specified target class.- 指定者:
convertSendAndReceive在接口中MessageRequestReplyOperations<D>- 参数:
request- payload for the request message to sendtargetClass- the target type to convert the payload of the reply to- 返回:
- the payload of the reply message, possibly
nullif the message could not be received, for example due to a timeout
convertSendAndReceive
@Nullable public <T> T convertSendAndReceive(D destination, Object request, Class<T> targetClass)
从接口复制的说明:MessageRequestReplyOperationsConvert the given request Object to serialized form, possibly using aMessageConverter, send it as aMessageto the given destination, receive the reply and convert its body of the specified target class.- 指定者:
convertSendAndReceive在接口中MessageRequestReplyOperations<D>- 参数:
destination- the target destinationrequest- payload for the request message to sendtargetClass- the target type to convert the payload of the reply to- 返回:
- the payload of the reply message, possibly
nullif the message could not be received, for example due to a timeout
convertSendAndReceive
@Nullable public <T> T convertSendAndReceive(D destination, Object request, @Nullable Map<String,Object> headers, Class<T> targetClass)
从接口复制的说明:MessageRequestReplyOperationsConvert the given request Object to serialized form, possibly using aMessageConverter, send it as aMessagewith the given headers, to the specified destination, receive the reply and convert its body of the specified target class.- 指定者:
convertSendAndReceive在接口中MessageRequestReplyOperations<D>- 参数:
destination- the target destinationrequest- payload for the request message to sendheaders- the headers for the request message to sendtargetClass- the target type to convert the payload of the reply to- 返回:
- the payload of the reply message, possibly
nullif the message could not be received, for example due to a timeout
convertSendAndReceive
@Nullable public <T> T convertSendAndReceive(Object request, Class<T> targetClass, @Nullable MessagePostProcessor postProcessor)
从接口复制的说明:MessageRequestReplyOperationsConvert the given request Object to serialized form, possibly using aMessageConverter, apply the given post processor and send the resultingMessageto a default destination, receive the reply and convert its body of the given target class.- 指定者:
convertSendAndReceive在接口中MessageRequestReplyOperations<D>- 参数:
request- payload for the request message to sendtargetClass- the target type to convert the payload of the reply topostProcessor- post process to apply to the request message- 返回:
- the payload of the reply message, possibly
nullif the message could not be received, for example due to a timeout
convertSendAndReceive
@Nullable public <T> T convertSendAndReceive(D destination, Object request, Class<T> targetClass, @Nullable MessagePostProcessor postProcessor)
从接口复制的说明:MessageRequestReplyOperationsConvert the given request Object to serialized form, possibly using aMessageConverter, apply the given post processor and send the resultingMessageto the given destination, receive the reply and convert its body of the given target class.- 指定者:
convertSendAndReceive在接口中MessageRequestReplyOperations<D>- 参数:
destination- the target destinationrequest- payload for the request message to sendtargetClass- the target type to convert the payload of the reply topostProcessor- post process to apply to the request message- 返回:
- the payload of the reply message, possibly
nullif the message could not be received, for example due to a timeout
convertSendAndReceive
@Nullable public <T> T convertSendAndReceive(D destination, Object request, @Nullable Map<String,Object> headers, Class<T> targetClass, @Nullable MessagePostProcessor postProcessor)
从接口复制的说明:MessageRequestReplyOperationsConvert the given request Object to serialized form, possibly using aMessageConverter, wrap it as a message with the given headers, apply the given post processor and send the resultingMessageto the specified destination, receive the reply and convert its body of the given target class.- 指定者:
convertSendAndReceive在接口中MessageRequestReplyOperations<D>- 参数:
destination- the target destinationrequest- payload for the request message to sendtargetClass- the target type to convert the payload of the reply topostProcessor- post process to apply to the request message- 返回:
- the payload of the reply message, possibly
nullif the message could not be received, for example due to a timeout