org.apache.servicemix.jbi.marshaler
Class DefaultMarshaler

java.lang.Object
  extended by org.apache.servicemix.jbi.marshaler.DefaultMarshaler
All Implemented Interfaces:
PojoMarshaler

public class DefaultMarshaler
extends java.lang.Object
implements PojoMarshaler

Default implementation of PojoMarshaler which will pass through String objects as XML content, DOM objects or Stream objects, otherwise the payload is stored in a message property.

Version:
$Revision: 564607 $

Field Summary
 
Fields inherited from interface org.apache.servicemix.jbi.marshaler.PojoMarshaler
BODY
 
Constructor Summary
DefaultMarshaler()
           
DefaultMarshaler(PojoMarshaler parent)
           
 
Method Summary
protected  javax.xml.transform.Source asContent(javax.jbi.messaging.NormalizedMessage message, java.lang.Object body)
           
protected  java.lang.Object defaultUnmarshal(javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage message)
           
 PojoMarshaler getParent()
           
 void marshal(javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage message, java.lang.Object body)
          Marshals the payload into the normalized message, typically as the content property.
 java.lang.Object unmarshal(javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage message)
          Unmarshals the response out of the normalized message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMarshaler

public DefaultMarshaler()

DefaultMarshaler

public DefaultMarshaler(PojoMarshaler parent)
Method Detail

getParent

public PojoMarshaler getParent()

marshal

public void marshal(javax.jbi.messaging.MessageExchange exchange,
                    javax.jbi.messaging.NormalizedMessage message,
                    java.lang.Object body)
             throws javax.jbi.messaging.MessagingException
Description copied from interface: PojoMarshaler
Marshals the payload into the normalized message, typically as the content property.

Specified by:
marshal in interface PojoMarshaler
Parameters:
exchange - the message exchange in which to marshal
message - the message in which to marshal
body - the body of the message as a POJO
Throws:
javax.jbi.messaging.MessagingException

unmarshal

public java.lang.Object unmarshal(javax.jbi.messaging.MessageExchange exchange,
                                  javax.jbi.messaging.NormalizedMessage message)
                           throws javax.jbi.messaging.MessagingException
Description copied from interface: PojoMarshaler
Unmarshals the response out of the normalized message.

Specified by:
unmarshal in interface PojoMarshaler
Parameters:
exchange - the message exchange, which is an InOut or InOptionalOut
message - the output message
Returns:
the unmarshaled body object, extracted from the message
Throws:
javax.jbi.messaging.MessagingException

defaultUnmarshal

protected java.lang.Object defaultUnmarshal(javax.jbi.messaging.MessageExchange exchange,
                                            javax.jbi.messaging.NormalizedMessage message)

asContent

protected javax.xml.transform.Source asContent(javax.jbi.messaging.NormalizedMessage message,
                                               java.lang.Object body)


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