|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.impl.MuleMessage
public class MuleMessage
MuleMessage
is a wrapper that contains a payload and properties
associated with the payload.
Field Summary | |
---|---|
protected UMOExceptionPayload |
exceptionPayload
|
Constructor Summary | |
---|---|
MuleMessage(Object message)
|
|
MuleMessage(Object message,
Map properties)
|
|
MuleMessage(Object message,
UMOMessageAdapter previous)
|
Method Summary | |
---|---|
void |
addAttachment(String name,
DataHandler dataHandler)
|
void |
addProperties(Map properties)
Adds a map of properties to be associated with this message |
void |
assertAccess(boolean write)
This method may be called before data in the object are accessed. |
void |
clearProperties()
Removes all properties on this message |
UMOMessageAdapter |
getAdapter()
|
DataHandler |
getAttachment(String name)
|
Set |
getAttachmentNames()
|
boolean |
getBooleanProperty(String name,
boolean defaultValue)
Gets a boolean property from the event |
int |
getCorrelationGroupSize()
Determines how many messages are in the correlation group |
String |
getCorrelationId()
Sets a correlationId for this message. |
int |
getCorrelationSequence()
Gets the sequence or ordering number for this message in the the correlation group (as defined by the correlationId) |
double |
getDoubleProperty(String name,
double defaultValue)
Gets a double property from the event |
String |
getEncoding()
Gets the encoding for the current message. |
UMOExceptionPayload |
getExceptionPayload()
If an error occurred during the processing of this message this will return a ErrorPayload that contains the root exception and Mule error code, plus any other releated info |
int |
getIntProperty(String name,
int defaultValue)
Gets an integer property from the event |
long |
getLongProperty(String name,
long defaultValue)
Gets a long property from the event |
Object |
getPayload()
|
byte[] |
getPayloadAsBytes()
Converts the payload implementation into a String representation |
String |
getPayloadAsString()
Converts the payload implementation into a String representation |
String |
getPayloadAsString(String encoding)
Converts the message implementation into a String representation |
Object |
getProperty(String key)
Gets a property of the payload implementation |
Object |
getProperty(String name,
Object defaultValue)
Gets a property from the event |
Set |
getPropertyNames()
|
Object |
getReplyTo()
Sets a replyTo address for this message. |
String |
getStringProperty(String name,
String defaultValue)
Gets a String property from the event |
String |
getUniqueId()
gets the unique identifier for the message. |
ThreadSafeAccess |
newThreadCopy()
|
void |
removeAttachment(String name)
|
Object |
removeProperty(String key)
Removes a property on this message |
void |
resetAccessControl()
This method should ONLY be used in the construction of composite ThreadSafeAccess instances. |
void |
setBooleanProperty(String name,
boolean value)
Sets a boolean property on the event |
void |
setCorrelationGroupSize(int size)
Determines how many messages are in the correlation group |
void |
setCorrelationId(String id)
Sets a correlationId for this message. |
void |
setCorrelationSequence(int sequence)
Gets the sequence or ordering number for this message in the the correlation group (as defined by the correlationId) |
void |
setDoubleProperty(String name,
double value)
Sets a double property on the event |
void |
setEncoding(String encoding)
Sets the encoding for this message |
void |
setExceptionPayload(UMOExceptionPayload exceptionPayload)
If an error occurs while processing this message, a ErrorPayload is attached which contains the root exception and Mule error code, plus any other releated info |
void |
setIntProperty(String name,
int value)
Sets a integerproperty on the event |
void |
setLongProperty(String name,
long value)
Sets a long property on the event |
void |
setProperty(String key,
Object value)
Gets a property of the payload implementation |
void |
setReplyTo(Object replyTo)
Sets a replyTo address for this message. |
void |
setStringProperty(String name,
String value)
Sets a String property on the event |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected UMOExceptionPayload exceptionPayload
Constructor Detail |
---|
public MuleMessage(Object message)
public MuleMessage(Object message, Map properties)
public MuleMessage(Object message, UMOMessageAdapter previous)
Method Detail |
---|
public UMOMessageAdapter getAdapter()
getAdapter
in interface UMOMessage
public Object getProperty(String key)
getProperty
in interface UMOMessageAdapter
key
- the key on which to lookup the property value
public Object removeProperty(String key)
UMOMessageAdapter
removeProperty
in interface UMOMessageAdapter
key
- the property key to remove
public void setProperty(String key, Object value)
setProperty
in interface UMOMessageAdapter
key
- the key on which to associate the valuevalue
- the property valuepublic String getPayloadAsString() throws Exception
getPayloadAsString
in interface UMOMessageAdapter
Exception
- Implemetation may throw an endpoint specific exceptionpublic String getPayloadAsString(String encoding) throws Exception
getPayloadAsString
in interface UMOMessageAdapter
encoding
- The encoding to use when transforming the message (if
necessary). The parameter is used when converting from a byte array
Exception
- Implementation may throw an endpoint specific exceptionpublic Set getPropertyNames()
getPropertyNames
in interface UMOMessageAdapter
public byte[] getPayloadAsBytes() throws Exception
getPayloadAsBytes
in interface UMOMessageAdapter
Exception
- Implemetation may throw an endpoint specific exceptionpublic Object getPayload()
getPayload
in interface UMOMessageAdapter
public void addProperties(Map properties)
UMOMessageAdapter
addProperties
in interface UMOMessageAdapter
properties
- the properties add to this messagepublic void clearProperties()
UMOMessageAdapter
clearProperties
in interface UMOMessageAdapter
public double getDoubleProperty(String name, double defaultValue)
getDoubleProperty
in interface UMOMessageAdapter
name
- the name or key of the propertydefaultValue
- a default value if the property doesn't exist in the event
public void setDoubleProperty(String name, double value)
setDoubleProperty
in interface UMOMessageAdapter
name
- the property name or keyvalue
- the property valuepublic String getUniqueId()
UMOMessageAdapter
getUniqueId
in interface UMOMessageAdapter
public Object getProperty(String name, Object defaultValue)
UMOMessageAdapter
getProperty
in interface UMOMessageAdapter
name
- the name or key of the propertydefaultValue
- a default value if the property doesn't exist in the event
public int getIntProperty(String name, int defaultValue)
UMOMessageAdapter
getIntProperty
in interface UMOMessageAdapter
name
- the name or key of the propertydefaultValue
- a default value if the property doesn't exist in the event
public long getLongProperty(String name, long defaultValue)
UMOMessageAdapter
getLongProperty
in interface UMOMessageAdapter
name
- the name or key of the propertydefaultValue
- a default value if the property doesn't exist in the event
public boolean getBooleanProperty(String name, boolean defaultValue)
UMOMessageAdapter
getBooleanProperty
in interface UMOMessageAdapter
name
- the name or key of the propertydefaultValue
- a default value if the property doesn't exist in the event
public void setBooleanProperty(String name, boolean value)
UMOMessageAdapter
setBooleanProperty
in interface UMOMessageAdapter
name
- the property name or keyvalue
- the property valuepublic void setIntProperty(String name, int value)
UMOMessageAdapter
setIntProperty
in interface UMOMessageAdapter
name
- the property name or keyvalue
- the property valuepublic void setLongProperty(String name, long value)
UMOMessageAdapter
setLongProperty
in interface UMOMessageAdapter
name
- the property name or keyvalue
- the property valuepublic void setCorrelationId(String id)
setCorrelationId
in interface UMOMessageAdapter
id
- the Id reference for this relationshippublic String getCorrelationId()
getCorrelationId
in interface UMOMessageAdapter
public void setReplyTo(Object replyTo)
setReplyTo
in interface UMOMessageAdapter
replyTo
- the endpointUri url to reply topublic Object getReplyTo()
getReplyTo
in interface UMOMessageAdapter
public int getCorrelationSequence()
getCorrelationSequence
in interface UMOMessageAdapter
public void setCorrelationSequence(int sequence)
setCorrelationSequence
in interface UMOMessageAdapter
sequence
- the sequence number or -1 if the sequence is not importantpublic int getCorrelationGroupSize()
getCorrelationGroupSize
in interface UMOMessageAdapter
public void setCorrelationGroupSize(int size)
setCorrelationGroupSize
in interface UMOMessageAdapter
size
- the total messages in this group or -1 if the size is not knownpublic UMOExceptionPayload getExceptionPayload()
UMOMessageAdapter
getExceptionPayload
in interface UMOMessageAdapter
public void setExceptionPayload(UMOExceptionPayload exceptionPayload)
UMOMessageAdapter
setExceptionPayload
in interface UMOMessageAdapter
exceptionPayload
- The exception payloaad to attach to this messagepublic String toString()
toString
in class Object
public void addAttachment(String name, DataHandler dataHandler) throws Exception
addAttachment
in interface UMOMessageAdapter
Exception
public void removeAttachment(String name) throws Exception
removeAttachment
in interface UMOMessageAdapter
Exception
public DataHandler getAttachment(String name)
getAttachment
in interface UMOMessageAdapter
public Set getAttachmentNames()
getAttachmentNames
in interface UMOMessageAdapter
public String getEncoding()
getEncoding
in interface UMOMessageAdapter
public void setEncoding(String encoding)
setEncoding
in interface UMOMessageAdapter
encoding
- the encoding to usepublic String getStringProperty(String name, String defaultValue)
getStringProperty
in interface UMOMessageAdapter
name
- the name or key of the propertydefaultValue
- a default value if the property doesn't exist in the event
public void setStringProperty(String name, String value)
setStringProperty
in interface UMOMessageAdapter
name
- the property name or keyvalue
- the property valuepublic ThreadSafeAccess newThreadCopy()
newThreadCopy
in interface ThreadSafeAccess
public void resetAccessControl()
ThreadSafeAccess
resetAccessControl
in interface ThreadSafeAccess
public void assertAccess(boolean write)
ThreadSafeAccess
assertAccess
in interface ThreadSafeAccess
write
- True if the access will mutate values.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |