Interface SmartMessageConverter
- All Superinterfaces:
MessageConverter
- All Known Implementing Classes:
MappingJackson2MessageConverter
public interface SmartMessageConverter extends MessageConverter
An extendedMessageConverterSPI with conversion hint support.In case of a conversion hint being provided, the framework will call the extended method if a converter implements this interface, instead of calling the regular
toMessagevariant.- Since:
- 4.3
- Author:
- Stephane Nicoll
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MessagetoMessage(Object object, Session session, Object conversionHint)A variant ofMessageConverter.toMessage(Object, Session)which takes an extra conversion context as an argument, allowing to take e.g.Methods inherited from interface org.springframework.jms.support.converter.MessageConverter
fromMessage, toMessage
Method Detail
toMessage
Message toMessage(Object object, Session session, Object conversionHint) throws JMSException, MessageConversionException
A variant ofMessageConverter.toMessage(Object, Session)which takes an extra conversion context as an argument, allowing to take e.g. annotations on a payload parameter into account.- Parameters:
object- the object to convertsession- the Session to use for creating a JMS MessageconversionHint- an extra object passed to theMessageConverter, e.g. the associatedMethodParameter(may benull}- Returns:
- the JMS Message
- Throws:
JMSException- if thrown by JMS API methodsMessageConversionException- in case of conversion failure- See Also:
MessageConverter.toMessage(Object, Session)