|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.mule.providers.AbstractMessageAdapter
AbstractMessageAdapter provides a base implementation for simple
message types that maybe don't normally allow for meta information, such as a File
or TCP.
| Field Summary | |
protected ConcurrentMap |
attachments
|
protected String |
encoding
|
protected UMOExceptionPayload |
exceptionPayload
|
protected String |
id
|
protected Log |
logger
logger used by this class |
protected ConcurrentMap |
properties
|
| Constructor Summary | |
AbstractMessageAdapter()
|
|
| Method Summary | |
void |
addAttachment(String name,
DataHandler dataHandler)
|
void |
addProperties(Map props)
Adds a map of properties to be associated with this message |
void |
clearProperties()
Removes all properties on this message |
protected byte[] |
convertToBytes(Object object)
|
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 |
String |
getPayloadAsString()
Converts the message implementation into a String representation. |
Object |
getProperty(String key)
Gets a property of the message implementation |
Object |
getProperty(String name,
Object defaultValue)
Gets a property from the event |
Set |
getPropertyNames()
|
Object |
getReplyTo()
Returns 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. |
void |
removeAttachment(String name)
|
Object |
removeProperty(String key)
Removes an associated property from the message |
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 correlationId)
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 payload)
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)
Set a property on the message |
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 |
| Methods inherited from interface org.mule.umo.provider.UMOMessageAdapter |
getPayload, getPayloadAsBytes, getPayloadAsString |
| Field Detail |
protected transient Log logger
protected ConcurrentMap properties
protected ConcurrentMap attachments
protected String encoding
protected UMOExceptionPayload exceptionPayload
protected String id
| Constructor Detail |
public AbstractMessageAdapter()
| Method Detail |
public String toString()
public void addProperties(Map props)
UMOMessageAdapter
addProperties in interface UMOMessageAdapterprops - the properties add to this messagepublic void clearProperties()
UMOMessageAdapter
clearProperties in interface UMOMessageAdapterpublic Object removeProperty(String key)
removeProperty in interface UMOMessageAdapterkey - the key of the property to remove
public Object getProperty(String key)
UMOMessageAdapter
getProperty in interface UMOMessageAdapterkey - the key on which to lookup the property value
public Set getPropertyNames()
getPropertyNames in interface UMOMessageAdapter
public void setProperty(String key,
Object value)
UMOMessageAdapter
setProperty in interface UMOMessageAdapterkey - the key on which to associate the valuevalue - the property valuepublic String getUniqueId()
UMOMessageAdapter
getUniqueId in interface UMOMessageAdapter
public Object getProperty(String name,
Object defaultValue)
UMOMessageAdapter
getProperty in interface UMOMessageAdaptername - 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 UMOMessageAdaptername - 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 UMOMessageAdaptername - the name or key of the propertydefaultValue - a default value if the property doesn't exist in the event
public double getDoubleProperty(String name,
double defaultValue)
UMOMessageAdapter
getDoubleProperty in interface UMOMessageAdaptername - 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 UMOMessageAdaptername - the name or key of the propertydefaultValue - a default value if the property doesn't exist in the event
public String getStringProperty(String name,
String defaultValue)
UMOMessageAdapter
getStringProperty in interface UMOMessageAdaptername - 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 UMOMessageAdaptername - the property name or keyvalue - the property value
public void setIntProperty(String name,
int value)
UMOMessageAdapter
setIntProperty in interface UMOMessageAdaptername - the property name or keyvalue - the property value
public void setLongProperty(String name,
long value)
UMOMessageAdapter
setLongProperty in interface UMOMessageAdaptername - the property name or keyvalue - the property value
public void setDoubleProperty(String name,
double value)
UMOMessageAdapter
setDoubleProperty in interface UMOMessageAdaptername - the property name or keyvalue - the property value
public void setStringProperty(String name,
String value)
UMOMessageAdapter
setStringProperty in interface UMOMessageAdaptername - the property name or keyvalue - the property valuepublic Object getReplyTo()
UMOMessageAdapter
getReplyTo in interface UMOMessageAdapterpublic void setReplyTo(Object replyTo)
UMOMessageAdapter
setReplyTo in interface UMOMessageAdapterreplyTo - the endpointUri url to reply topublic String getCorrelationId()
UMOMessageAdapter
getCorrelationId in interface UMOMessageAdapterpublic void setCorrelationId(String correlationId)
UMOMessageAdapter
setCorrelationId in interface UMOMessageAdaptercorrelationId - the Id reference for this relationshippublic int getCorrelationSequence()
getCorrelationSequence in interface UMOMessageAdapterpublic void setCorrelationSequence(int sequence)
setCorrelationSequence in interface UMOMessageAdaptersequence - the sequence number or -1 if the sequence is not importantpublic int getCorrelationGroupSize()
getCorrelationGroupSize in interface UMOMessageAdapterpublic void setCorrelationGroupSize(int size)
setCorrelationGroupSize in interface UMOMessageAdaptersize - the total messages in this group or -1 if the size is not knownpublic UMOExceptionPayload getExceptionPayload()
UMOMessageAdapter
getExceptionPayload in interface UMOMessageAdapterpublic void setExceptionPayload(UMOExceptionPayload payload)
UMOMessageAdapter
setExceptionPayload in interface UMOMessageAdapterpayload - The exception payloaad to attach to this message
public void addAttachment(String name,
DataHandler dataHandler)
throws Exception
addAttachment in interface UMOMessageAdapterException
public void removeAttachment(String name)
throws Exception
removeAttachment in interface UMOMessageAdapterExceptionpublic DataHandler getAttachment(String name)
getAttachment in interface UMOMessageAdapterpublic Set getAttachmentNames()
getAttachmentNames in interface UMOMessageAdapterpublic String getEncoding()
UMOMessageAdapter
getEncoding in interface UMOMessageAdapterpublic void setEncoding(String encoding)
setEncoding in interface UMOMessageAdapterencoding - the encoding to use
public final String getPayloadAsString()
throws Exception
getPayloadAsString in interface UMOMessageAdapterException - Implementation may throw an endpoint specific exception
protected byte[] convertToBytes(Object object)
throws TransformerException,
UnsupportedEncodingException
TransformerException
UnsupportedEncodingException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||