Class AbstractMessageReceivingTemplate<D>
java.lang.Object
org.springframework.messaging.core.AbstractMessageSendingTemplate<D>
org.springframework.messaging.core.AbstractMessageReceivingTemplate<D>
- Type Parameters:
- D- the destination type
- All Implemented Interfaces:
- MessageReceivingOperations<D>, MessageSendingOperations<D>
- Direct Known Subclasses:
- AbstractMessagingTemplate
public abstract class AbstractMessageReceivingTemplate<D>
extends AbstractMessageSendingTemplate<D>
implements MessageReceivingOperations<D>
An extension of 
AbstractMessageSendingTemplate that adds support for
receive style operations as defined by MessageReceivingOperations.- Since:
- 4.1
- Author:
- Mark Fisher, Rossen Stoyanchev, Stephane Nicoll
- 
Field SummaryFields inherited from class AbstractMessageSendingTemplateCONVERSION_HINT_HEADER, logger
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected <T> @Nullable TConvert from the given message to the given target class.Actually receive a message from the given destination.receive()Receive a message from a default destination.Receive a message from the given destination.<T> @Nullable TreceiveAndConvert(D destination, Class<T> targetClass) Receive a message from the given destination and convert its payload to the specified target class.<T> @Nullable TreceiveAndConvert(Class<T> targetClass) Receive a message from a default destination and convert its payload to the specified target class.Methods inherited from class AbstractMessageSendingTemplateconvertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, doConvert, doSend, getDefaultDestination, getMessageConverter, getRequiredDefaultDestination, processHeadersToSend, send, send, setDefaultDestination, setMessageConverter
- 
Constructor Details- 
AbstractMessageReceivingTemplatepublic AbstractMessageReceivingTemplate()
 
- 
- 
Method Details- 
receiveDescription copied from interface:MessageReceivingOperationsReceive a message from a default destination.- Specified by:
- receivein interface- MessageReceivingOperations<D>
- Returns:
- the received message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
receiveDescription copied from interface:MessageReceivingOperationsReceive a message from the given destination.- Specified by:
- receivein interface- MessageReceivingOperations<D>
- Parameters:
- destination- the target destination
- Returns:
- the received message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
receiveAndConvertDescription copied from interface:MessageReceivingOperationsReceive a message from a default destination and convert its payload to the specified target class.- Specified by:
- receiveAndConvertin interface- MessageReceivingOperations<D>
- Parameters:
- targetClass- the target class to convert the payload to
- Returns:
- the converted payload of the reply message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
receiveAndConvertpublic <T> @Nullable T receiveAndConvert(D destination, Class<T> targetClass) throws MessagingException Description copied from interface:MessageReceivingOperationsReceive a message from the given destination and convert its payload to the specified target class.- Specified by:
- receiveAndConvertin interface- MessageReceivingOperations<D>
- Parameters:
- destination- the target destination
- targetClass- the target class to convert the payload to
- Returns:
- the converted payload of the reply message, possibly nullif the message could not be received, for example due to a timeout
- Throws:
- MessagingException
 
- 
doConvertConvert from the given message to the given target class.- Parameters:
- message- the message to convert
- targetClass- the target class to convert the payload to
- Returns:
- the converted payload of the reply message (never null)
 
- 
doReceive
 
-