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:
BrokerContextAware, FrameTranslator

public class JmsFrameTranslator
extends LegacyFrameTranslator
implements BrokerContextAware

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()
           
 BrokerContext getBrokerContext()
           
 com.thoughtworks.xstream.XStream getXStream()
           
protected  String marshall(Serializable object, String transformation)
          Marshalls the Object to a string using XML or JSON encoding
protected  String marshallAdvisory(DataStructure ds)
          Return an Advisory message as a JSON formatted string
protected  String marshallAdvisory(DataStructure ds, String transformation)
           
 void setBrokerContext(BrokerContext brokerContext)
           
 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

marshallAdvisory

protected String marshallAdvisory(DataStructure ds,
                                  String transformation)

getXStream

public com.thoughtworks.xstream.XStream getXStream()

setXStream

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

createXStream

protected com.thoughtworks.xstream.XStream createXStream()

setBrokerContext

public void setBrokerContext(BrokerContext brokerContext)
Specified by:
setBrokerContext in interface BrokerContextAware

getBrokerContext

public BrokerContext getBrokerContext()
Specified by:
getBrokerContext in interface BrokerContextAware

marshallAdvisory

protected String marshallAdvisory(DataStructure ds)
Return an Advisory message as a JSON formatted string

Parameters:
ds -
Returns:


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.