org.apache.activemq.transport.stomp
Class JmsFrameTranslator

java.lang.Object
  extended by org.apache.activemq.transport.stomp.LegacyFrameTranslator
      extended by org.apache.activemq.transport.stomp.JmsFrameTranslator
All Implemented Interfaces:
FrameTranslator, org.springframework.context.ApplicationContextAware

public class JmsFrameTranslator
extends LegacyFrameTranslator
implements org.springframework.context.ApplicationContextAware

Frame translator implementation that uses XStream to convert messages to and from XML and JSON

Author:
Dejan Bosanac

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.activemq.transport.stomp.FrameTranslator
FrameTranslator.Helper
 
Constructor Summary
JmsFrameTranslator()
           
 
Method Summary
 ActiveMQMessage convertFrame(ProtocolConverter converter, StompFrame command)
           
 StompFrame convertMessage(ProtocolConverter converter, ActiveMQMessage message)
           
protected  ActiveMQMapMessage createMapMessage(com.thoughtworks.xstream.io.HierarchicalStreamReader in)
           
protected  ActiveMQObjectMessage createObjectMessage(com.thoughtworks.xstream.io.HierarchicalStreamReader in)
           
protected  com.thoughtworks.xstream.XStream createXStream()
           
 com.thoughtworks.xstream.XStream getXStream()
           
protected  String marshall(Serializable object, String transformation)
          Marshalls the Object to a string using XML or JSON encoding
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setXStream(com.thoughtworks.xstream.XStream xStream)
           
 
Methods inherited from class org.apache.activemq.transport.stomp.LegacyFrameTranslator
convertDestination, convertDestination
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmsFrameTranslator

public JmsFrameTranslator()
Method Detail

convertFrame

public ActiveMQMessage convertFrame(ProtocolConverter converter,
                                    StompFrame command)
                             throws JMSException,
                                    ProtocolException
Specified by:
convertFrame in interface FrameTranslator
Overrides:
convertFrame in class LegacyFrameTranslator
Throws:
JMSException
ProtocolException

convertMessage

public StompFrame convertMessage(ProtocolConverter converter,
                                 ActiveMQMessage message)
                          throws IOException,
                                 JMSException
Specified by:
convertMessage in interface FrameTranslator
Overrides:
convertMessage in class LegacyFrameTranslator
Throws:
IOException
JMSException

marshall

protected String marshall(Serializable object,
                          String transformation)
                   throws JMSException
Marshalls the Object to a string using XML or JSON encoding

Throws:
JMSException

createObjectMessage

protected ActiveMQObjectMessage createObjectMessage(com.thoughtworks.xstream.io.HierarchicalStreamReader in)
                                             throws JMSException
Throws:
JMSException

createMapMessage

protected ActiveMQMapMessage createMapMessage(com.thoughtworks.xstream.io.HierarchicalStreamReader in)
                                       throws JMSException
Throws:
JMSException

getXStream

public com.thoughtworks.xstream.XStream getXStream()

setXStream

public void setXStream(com.thoughtworks.xstream.XStream xStream)

createXStream

protected com.thoughtworks.xstream.XStream createXStream()

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException


Copyright © 2005-2011 Apache Software Foundation. All Rights Reserved.