类 AbstractMessageReceivingTemplate<D>
- java.lang.Object
- org.springframework.messaging.core.AbstractMessageSendingTemplate<D>
- org.springframework.messaging.core.AbstractMessageReceivingTemplate<D>
- 所有已实现的接口:
MessageReceivingOperations<D>
,MessageSendingOperations<D>
- 直接已知子类:
AbstractMessagingTemplate
public abstract class AbstractMessageReceivingTemplate<D> extends AbstractMessageSendingTemplate<D> implements MessageReceivingOperations<D>
An extension ofAbstractMessageSendingTemplate
that adds support for receive style operations as defined byMessageReceivingOperations
.- 从以下版本开始:
- 4.1
- 作者:
- Mark Fisher, Rossen Stoyanchev, Stephane Nicoll
字段概要
从类继承的字段 org.springframework.messaging.core.AbstractMessageSendingTemplate
CONVERSION_HINT_HEADER, logger
构造器概要
构造器 构造器 说明 AbstractMessageReceivingTemplate()
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected <T> T
doConvert(Message<?> message, Class<T> targetClass)
Convert from the given message to the given target class.protected abstract Message<?>
doReceive(D destination)
Actually receive a message from the given destination.Message<?>
receive()
Receive a message from a default destination.Message<?>
receive(D destination)
Receive a message from the given destination.<T> T
receiveAndConvert(D destination, Class<T> targetClass)
Receive a message from the given destination and convert its payload to the specified target class.<T> T
receiveAndConvert(Class<T> targetClass)
Receive a message from a default destination and convert its payload to the specified target class.从类继承的方法 org.springframework.messaging.core.AbstractMessageSendingTemplate
convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, doConvert, doSend, getDefaultDestination, getMessageConverter, getRequiredDefaultDestination, processHeadersToSend, send, send, setDefaultDestination, setMessageConverter
构造器详细资料
AbstractMessageReceivingTemplate
public AbstractMessageReceivingTemplate()
方法详细资料
receive
public Message<?> receive()
从接口复制的说明:MessageReceivingOperations
Receive a message from a default destination.- 指定者:
receive
在接口中MessageReceivingOperations<D>
- 返回:
- the received message, possibly
null
if the message could not be received, for example due to a timeout
receive
public Message<?> receive(D destination)
从接口复制的说明:MessageReceivingOperations
Receive a message from the given destination.- 指定者:
receive
在接口中MessageReceivingOperations<D>
- 参数:
destination
- the target destination- 返回:
- the received message, possibly
null
if the message could not be received, for example due to a timeout
doReceive
protected abstract Message<?> doReceive(D destination)
Actually receive a message from the given destination.- 参数:
destination
- the target destination- 返回:
- the received message, possibly
null
if the message could not be received, for example due to a timeout
receiveAndConvert
public <T> T receiveAndConvert(Class<T> targetClass)
从接口复制的说明:MessageReceivingOperations
Receive a message from a default destination and convert its payload to the specified target class.- 指定者:
receiveAndConvert
在接口中MessageReceivingOperations<D>
- 参数:
targetClass
- the target class to convert the payload to- 返回:
- the converted payload of the reply message, possibly
null
if the message could not be received, for example due to a timeout
receiveAndConvert
public <T> T receiveAndConvert(D destination, Class<T> targetClass)
从接口复制的说明:MessageReceivingOperations
Receive a message from the given destination and convert its payload to the specified target class.- 指定者:
receiveAndConvert
在接口中MessageReceivingOperations<D>
- 参数:
destination
- the target destinationtargetClass
- the target class to convert the payload to- 返回:
- the converted payload of the reply message, possibly
null
if the message could not be received, for example due to a timeout