MessageConverter that uses a Marshaller and Unmarshaller.
Marshals an object to a BytesMessage, or to a TextMessage if the
targetType is set to MessageType#TEXT.
Unmarshals from a TextMessage or BytesMessage to an object.
| Modifier and Type | Field and Description |
|---|---|
| private Marshaller | |
| private MessageType | |
| private Unmarshaller |
| Access | Constructor and Description |
|---|---|
| public | MarshallingMessageConverter()
Construct a new |
| public | MarshallingMessageConverter(Marshaller
object used as marshaller and unmarshaller marshaller)Construct a new |
| public | MarshallingMessageConverter(Marshaller
the Marshaller to use marshaller, Unmarshaller the Unmarshaller to use unmarshaller)Construct a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | afterPropertiesSet()
Implements org. Invoked by the containing This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set. |
| public Object | fromMessage(Message
the message to convert message)Implements org. This implementation unmarshals the given |
| protected BytesMessage | Returns: the resulting messagethe object to be marshalled object, Session current JMS session session, Marshaller the marshaller to use marshaller)Marshal the given object to a |
| protected Message | Returns: the resulting messagethe object to marshal object, Session the JMS session session, Marshaller the marshaller to use marshaller, MessageType the target message type (other than TEXT or BYTES) targetType)Template method that allows for custom message marshalling. |
| protected TextMessage | Returns: the resulting messagethe object to be marshalled object, Session current JMS session session, Marshaller the marshaller to use marshaller)Marshal the given object to a |
| public void | |
| public void | setTargetType(MessageType targetType)
Specify whether |
| public void | setUnmarshaller(Unmarshaller unmarshaller)
Set the |
| public Message | toMessage(Object
the object to convert object, Session the Session to use for creating a JMS Message session)Implements org. This implementation marshals the given object to a |
| protected Object | Returns: the unmarshalled objectthe message message, Unmarshaller the unmarshaller to use unmarshaller)Unmarshal the given |
| protected Object | Returns: the unmarshalled objectthe message message, Unmarshaller the unmarshaller to use unmarshaller)Template method that allows for custom message unmarshalling. |
| protected Object | Returns: the unmarshalled objectthe message message, Unmarshaller the unmarshaller to use unmarshaller)Unmarshal the given |
| marshaller | back to summary |
|---|---|
| private Marshaller marshaller
| |
| targetType | back to summary |
|---|---|
| private MessageType targetType | |
| unmarshaller | back to summary |
|---|---|
| private Unmarshaller unmarshaller
| |
| MarshallingMessageConverter | back to summary |
|---|---|
| public MarshallingMessageConverter() Construct a new | |
| MarshallingMessageConverter | back to summary |
|---|---|
| public MarshallingMessageConverter(Marshaller marshaller) Construct a new If the given Note that all
| |
| MarshallingMessageConverter | back to summary |
|---|---|
| public MarshallingMessageConverter(Marshaller marshaller, Unmarshaller unmarshaller) Construct a new
| |
| afterPropertiesSet | back to summary |
|---|---|
| public void afterPropertiesSet() Implements org. Doc from org. Invoked by the containing This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
| |
| fromMessage | back to summary |
|---|---|
| public Object fromMessage(Message message) throws JMSException, MessageConversionException Implements org. This implementation unmarshals the given
| |
| marshalToBytesMessage | back to summary |
|---|---|
| protected BytesMessage marshalToBytesMessage(Object object, Session session, Marshaller marshaller) throws JMSException, IOException, XmlMappingException Marshal the given object to a
| |
| marshalToMessage | back to summary |
|---|---|
| protected Message marshalToMessage(Object object, Session session, Marshaller marshaller, MessageType targetType) throws JMSException, IOException, XmlMappingException Template method that allows for custom message marshalling.
Invoked when The default implementation throws an
| |
| marshalToTextMessage | back to summary |
|---|---|
| protected TextMessage marshalToTextMessage(Object object, Session session, Marshaller marshaller) throws JMSException, IOException, XmlMappingException Marshal the given object to a
| |
| setMarshaller | back to summary |
|---|---|
| public void setMarshaller(Marshaller marshaller) Set the | |
| setTargetType | back to summary |
|---|---|
| public void setTargetType(MessageType targetType) Specify whether The default is
| |
| setUnmarshaller | back to summary |
|---|---|
| public void setUnmarshaller(Unmarshaller unmarshaller) Set the | |
| unmarshalFromBytesMessage | back to summary |
|---|---|
| protected Object unmarshalFromBytesMessage(BytesMessage message, Unmarshaller unmarshaller) throws JMSException, IOException, XmlMappingException Unmarshal the given
| |
| unmarshalFromMessage | back to summary |
|---|---|
| protected Object unmarshalFromMessage(Message message, Unmarshaller unmarshaller) throws JMSException, IOException, XmlMappingException Template method that allows for custom message unmarshalling.
Invoked when The default implementation throws an
| |
| unmarshalFromTextMessage | back to summary |
|---|---|
| protected Object unmarshalFromTextMessage(TextMessage message, Unmarshaller unmarshaller) throws JMSException, IOException, XmlMappingException Unmarshal the given
| |