|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.providers.AbstractMessageAdapter
public abstract class 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
|
static boolean |
DEFAULT_FAILFAST
Should we fail when we detect scribbling? This can be overridden by setting the property MuleProperties.MULE_THREAD_UNSAFE_MESSAGES_PROPERTY |
protected String |
encoding
|
protected UMOExceptionPayload |
exceptionPayload
|
protected String |
id
|
protected Log |
logger
logger used by this class |
protected ConcurrentMap |
properties
|
static boolean |
READ
|
static boolean |
WRITE
|
Constructor Summary | |
---|---|
protected |
AbstractMessageAdapter()
|
protected |
AbstractMessageAdapter(UMOMessageAdapter template)
|
Method Summary | |
---|---|
void |
addAttachment(String name,
DataHandler dataHandler)
|
void |
addProperties(Map props)
Adds a map of properties to be associated with this message |
void |
assertAccess(boolean write)
Restrict mutation to private use within a single thread. |
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. |
protected boolean |
isDisabled()
|
protected IllegalStateException |
newException(String message)
|
ThreadSafeAccess |
newThreadCopy()
By default we return "this". |
void |
removeAttachment(String name)
|
Object |
removeProperty(String key)
Removes an associated property from the 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 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
public static final boolean DEFAULT_FAILFAST
MuleProperties.MULE_THREAD_UNSAFE_MESSAGES_PROPERTY
protected UMOExceptionPayload exceptionPayload
protected String id
public static final boolean WRITE
public static final boolean READ
Constructor Detail |
---|
protected AbstractMessageAdapter()
protected AbstractMessageAdapter(UMOMessageAdapter template)
Method Detail |
---|
public String toString()
toString
in class Object
public void addProperties(Map props)
UMOMessageAdapter
addProperties
in interface UMOMessageAdapter
props
- the properties add to this messagepublic void clearProperties()
UMOMessageAdapter
clearProperties
in interface UMOMessageAdapter
public Object removeProperty(String key)
removeProperty
in interface UMOMessageAdapter
key
- the key of the property to remove
public Object getProperty(String key)
UMOMessageAdapter
getProperty
in interface UMOMessageAdapter
key
- 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 UMOMessageAdapter
key
- 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 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 double getDoubleProperty(String name, double defaultValue)
UMOMessageAdapter
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 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 String getStringProperty(String name, String defaultValue)
UMOMessageAdapter
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 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 setDoubleProperty(String name, double value)
UMOMessageAdapter
setDoubleProperty
in interface UMOMessageAdapter
name
- the property name or keyvalue
- the property valuepublic void setStringProperty(String name, String value)
UMOMessageAdapter
setStringProperty
in interface UMOMessageAdapter
name
- the property name or keyvalue
- the property valuepublic Object getReplyTo()
UMOMessageAdapter
getReplyTo
in interface UMOMessageAdapter
public void setReplyTo(Object replyTo)
UMOMessageAdapter
setReplyTo
in interface UMOMessageAdapter
replyTo
- the endpointUri url to reply topublic String getCorrelationId()
UMOMessageAdapter
getCorrelationId
in interface UMOMessageAdapter
public void setCorrelationId(String correlationId)
UMOMessageAdapter
setCorrelationId
in interface UMOMessageAdapter
correlationId
- the Id reference for this relationshippublic 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 payload)
UMOMessageAdapter
setExceptionPayload
in interface UMOMessageAdapter
payload
- The exception payloaad to attach to this messagepublic 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()
UMOMessageAdapter
getEncoding
in interface UMOMessageAdapter
public void setEncoding(String encoding)
setEncoding
in interface UMOMessageAdapter
encoding
- the encoding to usepublic final String getPayloadAsString() throws Exception
getPayloadAsString
in interface UMOMessageAdapter
Exception
- Implementation may throw an endpoint specific exceptionprotected byte[] convertToBytes(Object object) throws TransformerException, UnsupportedEncodingException
TransformerException
UnsupportedEncodingException
public void assertAccess(boolean write)
assertAccess
in interface ThreadSafeAccess
write
- protected IllegalStateException newException(String message)
protected boolean isDisabled()
public void resetAccessControl()
ThreadSafeAccess
resetAccessControl
in interface ThreadSafeAccess
public ThreadSafeAccess newThreadCopy()
newThreadCopy
in interface ThreadSafeAccess
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |