org.apache.servicemix.jbi.helper
Class MessageHelper

java.lang.Object
  extended by org.apache.servicemix.jbi.helper.MessageHelper

public final class MessageHelper
extends java.lang.Object

Some helper methods for working with messages

Version:
$Revision: $

Method Summary
static java.lang.Object getBody(javax.jbi.messaging.NormalizedMessage message)
          A helper method to return the body of the message as a POJO which could be a bean or some DOMish model of the body.
static java.lang.Object getBody(javax.jbi.messaging.NormalizedMessage message, PojoMarshaler marshaller)
          A helper method to return the body of the message as a POJO which could be a bean or some DOMish model of the body.
static void setBody(javax.jbi.messaging.NormalizedMessage message, java.lang.Object body)
          Sets the body of the message as a POJO
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBody

public static java.lang.Object getBody(javax.jbi.messaging.NormalizedMessage message)
                                throws javax.jbi.messaging.MessagingException
A helper method to return the body of the message as a POJO which could be a bean or some DOMish model of the body.

Parameters:
message - the message on which to extract the body
Returns:
the body of the message as a POJO or DOM object
Throws:
javax.jbi.messaging.MessagingException

getBody

public static java.lang.Object getBody(javax.jbi.messaging.NormalizedMessage message,
                                       PojoMarshaler marshaller)
                                throws javax.jbi.messaging.MessagingException
A helper method to return the body of the message as a POJO which could be a bean or some DOMish model of the body.

Parameters:
message - the message on which to extract the body
marshaller - the marshaller used to map from the XML representation to the POJO
Returns:
the body of the message as a POJO or DOM object
Throws:
javax.jbi.messaging.MessagingException

setBody

public static void setBody(javax.jbi.messaging.NormalizedMessage message,
                           java.lang.Object body)
                    throws javax.jbi.messaging.MessagingException
Sets the body of the message as a POJO

Parameters:
message - the message on which to set the body
body - the POJO or DOMish model to set
Throws:
javax.jbi.messaging.MessagingException


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