org.mule.impl.message
Class BaseMessage

java.lang.Object
  extended byorg.mule.impl.message.BaseMessage
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ExceptionMessage

public class BaseMessage
extends java.lang.Object
implements java.io.Serializable

BaseMessage A default message implementation used for messages sent over the wire. client messages should NOT implement UMOMessage.

Version:
$Revision: 1.3 $
Author:
Ross Mason
See Also:
Serialized Form

Field Summary
protected  java.util.Map context
           
protected  java.lang.Object message
           
 
Constructor Summary
BaseMessage(java.lang.Object message)
           
 
Method Summary
 void addProperties(java.util.Map properties)
          Adds a map of properties to associated with this message
 void clearProperties()
          Removes all properties on this message
 java.lang.Object getPayload()
           
 byte[] getPayloadAsBytes()
          Converts the message implementation into a String representation
 java.lang.String getPayloadAsString()
          Converts the message implementation into a String representation
 java.util.Map getProperties()
          Returns a map of all properties on this message
 java.lang.Object getProperty(java.lang.Object key)
           
 void setProperty(java.lang.Object key, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

message

protected java.lang.Object message

context

protected java.util.Map context
Constructor Detail

BaseMessage

public BaseMessage(java.lang.Object message)
Method Detail

getPayloadAsString

public java.lang.String getPayloadAsString()
                                    throws java.lang.Exception
Converts the message implementation into a String representation

Returns:
String representation of the message payload
Throws:
java.lang.Exception - Implementation may throw an endpoint specific exception

getPayloadAsBytes

public byte[] getPayloadAsBytes()
                         throws java.lang.Exception
Converts the message implementation into a String representation

Returns:
String representation of the message
Throws:
java.lang.Exception - Implemetation may throw an endpoint specific exception

getPayload

public java.lang.Object getPayload()
Returns:
the current message

addProperties

public void addProperties(java.util.Map properties)
Adds a map of properties to associated with this message

Parameters:
properties - the properties add to this message

clearProperties

public void clearProperties()
Removes all properties on this message


getProperties

public java.util.Map getProperties()
Returns a map of all properties on this message

Returns:
a map of all properties on this message

setProperty

public void setProperty(java.lang.Object key,
                        java.lang.Object value)

getProperty

public java.lang.Object getProperty(java.lang.Object key)


Copyright © 2003-2005 SymphonySoft Limited. All Rights Reserved.