org.marketcetera.client.jms
Class JMSXMLMessageConverter

java.lang.Object
  extended by org.marketcetera.client.jms.JMSXMLMessageConverter
All Implemented Interfaces:
MessageConverter

public class JMSXMLMessageConverter
extends Object
implements MessageConverter

Converts messaging objects to an XML representation that can be sent over JMS. This class is not meant to be used by clients of this package.

Since:
1.5.0
Version:
$Id: JMSXMLMessageConverter.java 16154 2012-07-14 16:34:05Z colin $
Author:
anshul@marketcetera.com

Constructor Summary
JMSXMLMessageConverter()
          Creates an instance.
 
Method Summary
 Object fromMessage(Message message)
          Converts a JMS Message to a messaging object.
 Message toMessage(Object inObject, Session session)
          Converts a messaging object to a JMS Message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMSXMLMessageConverter

public JMSXMLMessageConverter()
                       throws JAXBException
Creates an instance.

Throws:
JAXBException - if there were errors initializing the XML marshalling / unmarshalling system.
Method Detail

fromMessage

public Object fromMessage(Message message)
                   throws JMSException,
                          MessageConversionException
Converts a JMS Message to a messaging object.

Specified by:
fromMessage in interface MessageConverter
Parameters:
message - the received JMS message. It should be of type ObjectMessage.
Returns:
the messaging object converted from the supplied JMS message.
Throws:
JMSException - if there were errors extracting the contents of the JMS message.
MessageConversionException - if there were errors converting the contents of the JMS message to a messaging object.

toMessage

public Message toMessage(Object inObject,
                         Session session)
                  throws JMSException,
                         MessageConversionException
Converts a messaging object to a JMS Message.

Specified by:
toMessage in interface MessageConverter
Parameters:
inObject - the message to be converted. It should either be an order or a report.
session - the JMS Session instance.
Returns:
the JMS message.
Throws:
JMSException - if there were errors serializing the messaging object.
MessageConversionException - if the supplied object was not an acceptable messaging object.


Copyright © 2012. All Rights Reserved.