org.logicblaze.lingo.jms.marshall
Class XStreamMarshaller

java.lang.Object
  extended by org.logicblaze.lingo.jms.marshall.DefaultMarshaller
      extended by org.logicblaze.lingo.jms.marshall.XStreamMarshaller
All Implemented Interfaces:
HeaderMarshaller, Marshaller

public class XStreamMarshaller
extends DefaultMarshaller

Uses XStream to marshall requests and responses into and out of messages.

Version:
$Revision: 84 $

Field Summary
 
Fields inherited from class org.logicblaze.lingo.jms.marshall.DefaultMarshaller
headerMarshaller, nativeHeaderMarshaller
 
Constructor Summary
XStreamMarshaller()
           
 
Method Summary
 javax.jms.Message createObjectMessage(javax.jms.Session session, Object value)
          Creates a message for a Java Object for when distributing objects in collections
 javax.jms.Message createRequestMessage(Requestor requestor, LingoInvocation invocation)
          Creates the request message
 javax.jms.Message createResponseMessage(javax.jms.Session session, org.springframework.remoting.support.RemoteInvocationResult result, javax.jms.Message requestMessage)
          Creates the response message
protected  com.thoughtworks.xstream.XStream createXStream()
           
 org.springframework.remoting.support.RemoteInvocationResult extractInvocationResult(javax.jms.Message message)
          Extracts the invocation result from the response message
protected  Object fromXML(String xml)
           
 com.thoughtworks.xstream.XStream getXStream()
           
 Object readMessage(javax.jms.Message message)
          Extracts the body from the given JMS message
 org.springframework.remoting.support.RemoteInvocation readRemoteInvocation(javax.jms.Message message)
          Read a RemoteInvocation from the given JMS message
 void setXStream(com.thoughtworks.xstream.XStream xStream)
           
protected  String toXML(Object object)
           
 
Methods inherited from class org.logicblaze.lingo.jms.marshall.DefaultMarshaller
addResponseMessageHeaders, appendMessageHeaders, appendMessageHeaders, handleInvocationHeaders, handleInvocationResultHeaders, handleMessageHeaders, isIgnoreInvalidMessages, onInvalidClientMessage, onInvalidMessage, setHeaderMarshaller, setIgnoreInvalidMessages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XStreamMarshaller

public XStreamMarshaller()
Method Detail

createRequestMessage

public javax.jms.Message createRequestMessage(Requestor requestor,
                                              LingoInvocation invocation)
                                       throws javax.jms.JMSException
Description copied from interface: Marshaller
Creates the request message

Specified by:
createRequestMessage in interface Marshaller
Overrides:
createRequestMessage in class DefaultMarshaller
invocation - the remote invocation to send
Throws:
javax.jms.JMSException - if the message could not be created

createResponseMessage

public javax.jms.Message createResponseMessage(javax.jms.Session session,
                                               org.springframework.remoting.support.RemoteInvocationResult result,
                                               javax.jms.Message requestMessage)
                                        throws javax.jms.JMSException
Description copied from interface: Marshaller
Creates the response message

Specified by:
createResponseMessage in interface Marshaller
Overrides:
createResponseMessage in class DefaultMarshaller
Parameters:
session - the JMS session to use
result - the result invocation
requestMessage - the original request message
Returns:
the response message to send
Throws:
javax.jms.JMSException - if the message could not be created

extractInvocationResult

public org.springframework.remoting.support.RemoteInvocationResult extractInvocationResult(javax.jms.Message message)
                                                                                    throws javax.jms.JMSException
Description copied from interface: Marshaller
Extracts the invocation result from the response message

Specified by:
extractInvocationResult in interface Marshaller
Overrides:
extractInvocationResult in class DefaultMarshaller
Parameters:
message - the response message
Returns:
the invocation result
Throws:
javax.jms.JMSException - is thrown if a JMS exception occurs

readRemoteInvocation

public org.springframework.remoting.support.RemoteInvocation readRemoteInvocation(javax.jms.Message message)
                                                                           throws javax.jms.JMSException
Description copied from interface: Marshaller
Read a RemoteInvocation from the given JMS message

Specified by:
readRemoteInvocation in interface Marshaller
Overrides:
readRemoteInvocation in class DefaultMarshaller
Parameters:
message - current JMS message
Returns:
the RemoteInvocation object
Throws:
javax.jms.JMSException

createObjectMessage

public javax.jms.Message createObjectMessage(javax.jms.Session session,
                                             Object value)
                                      throws javax.jms.JMSException
Description copied from interface: Marshaller
Creates a message for a Java Object for when distributing objects in collections

Specified by:
createObjectMessage in interface Marshaller
Overrides:
createObjectMessage in class DefaultMarshaller
Throws:
javax.jms.JMSException

readMessage

public Object readMessage(javax.jms.Message message)
                   throws javax.jms.JMSException
Description copied from interface: Marshaller
Extracts the body from the given JMS message

Specified by:
readMessage in interface Marshaller
Overrides:
readMessage in class DefaultMarshaller
Throws:
javax.jms.JMSException

getXStream

public com.thoughtworks.xstream.XStream getXStream()

setXStream

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

createXStream

protected com.thoughtworks.xstream.XStream createXStream()

fromXML

protected Object fromXML(String xml)

toXML

protected String toXML(Object object)


Copyright © 2012 LogicBlaze, Inc.. All Rights Reserved.