public interface

MessageConverter

org.springframework.jms.support.converter.MessageConverter
Known Indirect Subclasses

Class Overview

Strategy interface that specifies a converter between Java objects and JMS messages.

Check out SimpleMessageConverter for a default implementation, converting between the 'standard' message payloads and JMS Message types.

Summary

Public Methods
abstract Object fromMessage(Message message)
Convert from a JMS Message to a Java object.
abstract Message toMessage(Object object, Session session)
Convert a Java object to a JMS Message using the supplied session to create the message object.

Public Methods

public abstract Object fromMessage (Message message)

Convert from a JMS Message to a Java object.

Parameters
message the message to convert
Returns
  • the converted Java object
Throws
if thrown by JMS API methods
MessageConversionException in case of conversion failure
JMSException

public abstract Message toMessage (Object object, Session session)

Convert a Java object to a JMS Message using the supplied session to create the message object.

Parameters
object the object to convert
session the Session to use for creating a JMS Message
Returns
  • the JMS Message
Throws
if thrown by JMS API methods
MessageConversionException in case of conversion failure
JMSException