org.apache.servicemix.jbi.marshaler
Interface PojoMarshaler

All Known Implementing Classes:
DefaultMarshaler

public interface PojoMarshaler

A plugin strategy which marshals an Object into and out of a JBI message. This interface is used by the ServiceMixClient to marshal POJOs into and out of JBI messages.

Version:
$Revision: 564607 $

Field Summary
static java.lang.String BODY
          The key on the message to store the message body which cannot be marshaled into or out of XML easily or to provide a cache of the object representation of the object.
 
Method Summary
 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.
 

Field Detail

BODY

static final java.lang.String BODY
The key on the message to store the message body which cannot be marshaled into or out of XML easily or to provide a cache of the object representation of the object.

See Also:
Constant Field Values
Method Detail

marshal

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

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

java.lang.Object unmarshal(javax.jbi.messaging.MessageExchange exchange,
                           javax.jbi.messaging.NormalizedMessage message)
                           throws javax.jbi.messaging.MessagingException
Unmarshals the response out of the normalized message.

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


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