public class DefaultMuleMessage extends Object implements MuleMessage, ThreadSafeAccess, DeserializationPostInitialisable
DefaultMuleMessage
is a wrapper that contains a payload and properties
associated with the payload.Modifier and Type | Class and Description |
---|---|
static class |
DefaultMuleMessage.SerializedDataHandler |
ThreadSafeAccess.AccessControl
DeserializationPostInitialisable.Implementation
Modifier and Type | Field and Description |
---|---|
protected MuleContext |
muleContext |
protected static String |
NOT_SET |
READ, WRITE
Constructor and Description |
---|
DefaultMuleMessage(MuleMessage message) |
DefaultMuleMessage(Object message,
Map<String,Object> outboundProperties,
Map<String,DataHandler> attachments,
MuleContext muleContext) |
DefaultMuleMessage(Object message,
Map<String,Object> inboundProperties,
Map<String,Object> outboundProperties,
Map<String,DataHandler> attachments,
MuleContext muleContext) |
DefaultMuleMessage(Object message,
Map<String,Object> inboundProperties,
Map<String,Object> outboundProperties,
Map<String,DataHandler> attachments,
MuleContext muleContext,
DataType dataType) |
DefaultMuleMessage(Object message,
Map<String,Object> outboundProperties,
MuleContext muleContext) |
DefaultMuleMessage(Object message,
MuleContext muleContext) |
DefaultMuleMessage(Object message,
MuleMessage previous,
MuleContext muleContext) |
Modifier and Type | Method and Description |
---|---|
void |
addAttachment(String name,
DataHandler dataHandler)
Deprecated.
|
void |
addInboundAttachment(String name,
DataHandler dataHandler) |
void |
addInboundProperties(Map<String,Object> props) |
void |
addOutboundAttachment(String name,
DataHandler dataHandler)
Allows for arbitrary data attachments to be associated with the Message.
|
void |
addOutboundAttachment(String name,
Object object,
String contentType)
Adds an outgoing attachment to the message
|
void |
addProperties(Map<String,Object> props)
Adds a map of properties to be associated with this message
|
void |
addProperties(Map<String,Object> props,
PropertyScope scope)
Adds a map of properties to be associated with this message
|
protected void |
applyAllTransformers(MuleEvent event,
List<? extends Transformer> transformers) |
void |
applyTransformers(MuleEvent event,
List<? extends Transformer> transformers)
Will apply a list of transformers to the payload of the message.
|
void |
applyTransformers(MuleEvent event,
List<? extends Transformer> transformers,
Class<?> outputType)
Will apply a list of transformers to the payload of the message.
|
void |
applyTransformers(MuleEvent event,
Transformer... transformers)
Will apply a list of transformers to the payload of the message.
|
void |
assertAccess(boolean write)
This method may be called before data in the object are accessed.
|
void |
clearAttachments()
Removes all outbound attachments on this message.
|
void |
clearProperties()
Removes all properties on this message in the
PropertyScope.INVOCATION and
PropertyScope.OUTBOUND . |
void |
clearProperties(PropertyScope scope)
Removes all properties on this message in the given scope.
|
protected void |
copyMessageProperties(MuleMessage muleMessage) |
protected void |
copyToInbound(DefaultMuleMessage newMessage)
copy outbound artifacts to inbound artifacts in the new message
|
MuleMessage |
createInboundMessage()
Copy an inbound message to an outbound one, moving all message properties and attachments
|
boolean |
equals(Object obj) |
<T> T |
findPropertyInAnyScope(String name,
T defaultValue)
This method was added with the introduction of Property scopes.
|
<T> T |
findPropertyInSpecifiedScopes(String name,
PropertyScope... scopesToSearch)
Find property in one of the specified scopes, in order
|
DataHandler |
getAttachment(String name)
Deprecated.
|
Set<String> |
getAttachmentNames()
Deprecated.
|
boolean |
getBooleanProperty(String name,
boolean defaultValue)
Deprecated.
|
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)
|
DataType<?> |
getDataType()
Returns the data type (if any) associated with the message's payload.
|
double |
getDoubleProperty(String name,
double defaultValue)
Deprecated.
|
String |
getEncoding()
Gets the encoding for the current message.
|
ExceptionPayload |
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
|
DataHandler |
getInboundAttachment(String name)
Retrieve an attachment with the given name.
|
Set<String> |
getInboundAttachmentNames() |
<T> T |
getInboundProperty(String name) |
<T> T |
getInboundProperty(String name,
T defaultValue) |
Set<String> |
getInboundPropertyNames() |
int |
getIntProperty(String name,
int defaultValue)
Deprecated.
|
<T> T |
getInvocationProperty(String name) |
<T> T |
getInvocationProperty(String name,
T defaultValue) |
Set<String> |
getInvocationPropertyNames() |
long |
getLongProperty(String name,
long defaultValue)
Deprecated.
|
String |
getMessageRootId()
gets an identifier that is the same among parent and child messages
|
MuleContext |
getMuleContext() |
Object |
getOriginalPayload()
Returns the original payload used to create this message.
|
protected Map<String,TypedValue> |
getOrphanFlowVariables() |
DataHandler |
getOutboundAttachment(String name)
Retrieve an attachment with the given name.
|
Set<String> |
getOutboundAttachmentNames() |
<T> T |
getOutboundProperty(String name) |
<T> T |
getOutboundProperty(String name,
T defaultValue) |
Set<String> |
getOutboundPropertyNames() |
Object |
getPayload() |
<T> T |
getPayload(Class<T> outputType)
Will attempt to obtain the payload of this message with the desired Class type.
|
<T> T |
getPayload(DataType<T> outputType)
Will attempt to obtain the payload of this message with the desired Class type.
|
protected <T> T |
getPayload(DataType<T> resultType,
String encoding)
Will attempt to obtain the payload of this message with the desired Class type.
|
byte[] |
getPayloadAsBytes()
Converts the message implementation into a byte array representation
|
String |
getPayloadAsString()
Converts the message implementation into a String representation.
|
String |
getPayloadAsString(String encoding)
Converts the message implementation into a String representation
|
String |
getPayloadForLogging()
Get the message payload for logging without throwing exception
Converts the message implementation into a String representation.
|
String |
getPayloadForLogging(String encoding)
Get the message payload for logging without throwing exception
Converts the message implementation into a String representation.
|
Object |
getProperty(String key)
Deprecated.
|
Object |
getProperty(String name,
Object defaultValue)
Gets a property from the message
|
<T> T |
getProperty(String name,
PropertyScope scope)
Gets a property from the message with a given scope.
|
<T> T |
getProperty(String name,
PropertyScope scope,
T defaultValue)
Gets a property from the message with a given scope and provides a default value if the property is not
present on the message in the scope specified.
|
DataType<?> |
getPropertyDataType(String name,
PropertyScope scope)
Gets a property data type from the message with a given scope.
|
Set<String> |
getPropertyNames()
Deprecated.
|
Set<String> |
getPropertyNames(PropertyScope scope)
Gets all property names in a given scope.
|
Object |
getReplyTo()
Returns a replyTo address for this message.
|
<T> T |
getSessionProperty(String name) |
<T> T |
getSessionProperty(String name,
T defaultValue) |
Set<String> |
getSessionPropertyNames() |
String |
getStringProperty(String name,
String defaultValue)
Deprecated.
|
String |
getUniqueId()
gets the unique identifier for the message.
|
int |
hashCode() |
void |
initAfterDeserialisation(MuleContext context)
Invoked after deserialization.
|
boolean |
isConsumable()
Deprecated.
since 3.8.0. Use
ClassUtils.isConsumable(Class) instead.
Determines if the payload of this message is consumable i.e. it can't be read
more than once. |
protected boolean |
isDisabled() |
protected boolean |
isPayloadConsumed(Class<?> inputCls)
Checks if the payload has been consumed for this message.
|
protected IllegalStateException |
newException(String message) |
ThreadSafeAccess |
newThreadCopy() |
void |
propagateRootId(MuleMessage parent)
copy the message root id from parent to child
|
void |
release()
Perform any clean up operations on the message resource.
|
void |
removeAttachment(String name)
Deprecated.
|
void |
removeOutboundAttachment(String name)
Remove an attachment form this message with the specified name
|
Object |
removeProperty(String key)
Removes a property on this message.
|
Object |
removeProperty(String key,
PropertyScope scope)
Removes a property on this message from the specified scope only.
|
void |
resetAccessControl()
This method should ONLY be used in the construction of composite ThreadSafeAccess instances.
|
void |
setBooleanProperty(String name,
boolean value)
Deprecated.
|
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)
|
protected void |
setDataType(DataType<?> dt) |
void |
setDoubleProperty(String name,
double value)
Deprecated.
|
void |
setEncoding(String encoding)
Sets the encoding for this message
|
void |
setExceptionPayload(ExceptionPayload 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 |
setInboundProperty(String key,
Object value) |
void |
setInboundProperty(String key,
Object value,
DataType<?> dataType) |
void |
setIntProperty(String name,
int value)
Deprecated.
|
void |
setInvocationProperty(String key,
Object value) |
void |
setInvocationProperty(String key,
Object value,
DataType<?> dataType) |
void |
setLongProperty(String name,
long value)
Deprecated.
|
void |
setMessageRootId(String rid)
set the root ID for the message
|
void |
setMimeType(String mimeType) |
void |
setMuleContext(MuleContext context) |
void |
setOutboundProperty(String key,
Object value) |
void |
setOutboundProperty(String key,
Object value,
DataType<?> dataType) |
void |
setPayload(Object payload)
Update the message payload.
|
void |
setPayload(Object payload,
DataType<?> dataType)
Updates the message payload.
|
void |
setProperty(String key,
Object value)
Deprecated.
use
setProperty(String, Object, org.mule.api.transport.PropertyScope) or
preferrably any of the scope-specific set methods. |
void |
setProperty(String key,
Object value,
PropertyScope scope)
Set a property on the message.
|
void |
setProperty(String key,
Object value,
PropertyScope scope,
DataType<?> dataType)
Sets a property on the message
|
void |
setReplyTo(Object replyTo)
Sets a replyTo address for this message.
|
void |
setSessionProperty(String key,
Object value) |
void |
setStringProperty(String name,
String value)
Deprecated.
|
void |
setUniqueId(String uid) |
String |
toString() |
protected static final String NOT_SET
protected transient MuleContext muleContext
public DefaultMuleMessage(MuleMessage message)
public DefaultMuleMessage(Object message, MuleContext muleContext)
public DefaultMuleMessage(Object message, Map<String,Object> outboundProperties, MuleContext muleContext)
public DefaultMuleMessage(Object message, Map<String,Object> outboundProperties, Map<String,DataHandler> attachments, MuleContext muleContext)
public DefaultMuleMessage(Object message, Map<String,Object> inboundProperties, Map<String,Object> outboundProperties, Map<String,DataHandler> attachments, MuleContext muleContext)
public DefaultMuleMessage(Object message, Map<String,Object> inboundProperties, Map<String,Object> outboundProperties, Map<String,DataHandler> attachments, MuleContext muleContext, DataType dataType)
public DefaultMuleMessage(Object message, MuleMessage previous, MuleContext muleContext)
protected void copyMessageProperties(MuleMessage muleMessage)
public void setMuleContext(MuleContext context)
public <T> T getPayload(Class<T> outputType) throws TransformerException
getPayload
in interface MuleMessage
outputType
- the desired return typeTransformerException
- if a transformer cannot be found or there is an error during transformation of the
payloadpublic <T> T getPayload(DataType<T> outputType) throws TransformerException
getPayload
in interface MuleMessage
outputType
- the desired return typeTransformerException
- if a transformer cannot be found or there is an error during transformation of the
payloadpublic MuleContext getMuleContext()
getMuleContext
in interface MuleMessage
protected <T> T getPayload(DataType<T> resultType, String encoding) throws TransformerException
resultType
- the desired return typeencoding
- the encoding to use if requiredInputStream
in which
case the stream will be read and the payload will become the fully read stream.TransformerException
- if a transformer cannot be found or there is an error during
transformation of the payload.protected boolean isPayloadConsumed(Class<?> inputCls)
inputCls
- the input type of the message payloadpublic Object getOriginalPayload()
MuleMessage.applyTransformers(MuleEvent,java.util.List)
or
MuleMessage.applyTransformers(MuleEvent, java.util.List, Class)
is called.getOriginalPayload
in interface MuleMessage
public void setInvocationProperty(String key, Object value)
setInvocationProperty
in interface MuleMessage
MuleMessage.setProperty(String, Object, org.mule.api.transport.PropertyScope)
public void setInvocationProperty(String key, Object value, DataType<?> dataType)
setInvocationProperty
in interface MuleMessage
MuleMessage.setProperty(String, Object, org.mule.api.transport.PropertyScope)
public void setOutboundProperty(String key, Object value)
setOutboundProperty
in interface MuleMessage
MuleMessage.setProperty(String, Object, org.mule.api.transport.PropertyScope)
public void setOutboundProperty(String key, Object value, DataType<?> dataType)
setOutboundProperty
in interface MuleMessage
MuleMessage.setProperty(String, Object, org.mule.api.transport.PropertyScope)
public void setSessionProperty(String key, Object value)
setSessionProperty
in interface MuleMessage
public void setProperty(String key, Object value, PropertyScope scope)
setProperty
in interface MuleMessage
key
- the key on which to associate the valuevalue
- the property valuescope
- The scope at which to set the property atPropertyScope
,
MuleMessage.setInvocationProperty(String, Object)
,
MuleMessage.setOutboundProperty(String, Object)
,
MuleMessage.setSessionProperty(String, Object)
public void setProperty(String key, Object value, PropertyScope scope, DataType<?> dataType)
MuleMessage
setProperty
in interface MuleMessage
key
- the key on which to associate the valuevalue
- the property valuescope
- The scope at which to set the property atdataType
- the data type for the property value@Deprecated public Object getProperty(String key)
public Object removeProperty(String key)
removeProperty
in interface MuleMessage
key
- the property key to removepublic Object removeProperty(String key, PropertyScope scope)
removeProperty
in interface MuleMessage
key
- the property key to removescope
- The scope at which to set the property at@Deprecated public void setProperty(String key, Object value)
setProperty(String, Object, org.mule.api.transport.PropertyScope)
or
preferrably any of the scope-specific set methods.setProperty
in interface MuleMessage
key
- the key on which to associate the valuevalue
- the property valuesetInboundProperty(String, Object)
,
setInvocationProperty(String, Object)
,
setOutboundProperty(String, Object)
,
setSessionProperty(String, Object)
public final String getPayloadAsString() throws Exception
getPayloadAsString
in interface MuleMessage
Exception
- Implementation may throw an endpoint specific exceptionpublic String getPayloadForLogging(String encoding)
getPayloadForLogging
in interface MuleMessage
public String getPayloadForLogging()
getPayloadForLogging
in interface MuleMessage
public byte[] getPayloadAsBytes() throws Exception
getPayloadAsBytes
in interface MuleMessage
Exception
- Implemetation may throw an endpoint specific exceptionpublic String getPayloadAsString(String encoding) throws Exception
getPayloadAsString
in interface MuleMessage
encoding
- The encoding to use when transforming the message (if
necessary). The parameter is used when converting from a byte arrayException
- Implementation may throw an endpoint specific exception@Deprecated public Set<String> getPropertyNames()
getPropertyNames(org.mule.api.transport.PropertyScope)
getPropertyNames
in interface MuleMessage
public Set<String> getPropertyNames(PropertyScope scope)
getPropertyNames
in interface MuleMessage
scope
- the scope of property namesMuleMessage.getInvocationPropertyNames()
,
MuleMessage.getInboundPropertyNames()
,
MuleMessage.getOutboundPropertyNames()
,
MuleMessage.getSessionPropertyNames()
public Set<String> getInvocationPropertyNames()
getInvocationPropertyNames
in interface MuleMessage
public Set<String> getInboundPropertyNames()
getInboundPropertyNames
in interface MuleMessage
public Set<String> getOutboundPropertyNames()
getOutboundPropertyNames
in interface MuleMessage
public Set<String> getSessionPropertyNames()
getSessionPropertyNames
in interface MuleMessage
public String getUniqueId()
getUniqueId
in interface MuleMessage
public void setUniqueId(String uid)
public String getMessageRootId()
MuleMessage
getMessageRootId
in interface MuleMessage
public void setMessageRootId(String rid)
MuleMessage
setMessageRootId
in interface MuleMessage
public void propagateRootId(MuleMessage parent)
MuleMessage
propagateRootId
in interface MuleMessage
public Object getProperty(String name, Object defaultValue)
getProperty
in interface MuleMessage
name
- the name or key of the property. This must be non-null.defaultValue
- a default value if the property doesn't exist in the event. This can be null.MuleMessage.getInboundProperty(String)
,
MuleMessage.getOutboundProperty(String)
,
MuleMessage.getInvocationProperty(String)
,
MuleMessage.getSessionProperty(String)
public <T> T getProperty(String name, PropertyScope scope)
getProperty
in interface MuleMessage
name
- the name or key of the property. This must be non-null.scope
- The scope of the property to retrieve. This must be non-null.MuleMessage.getInboundProperty(String)
,
MuleMessage.getOutboundProperty(String)
,
MuleMessage.getInvocationProperty(String)
,
MuleMessage.getSessionProperty(String)
public <T> T getInboundProperty(String name, T defaultValue)
getInboundProperty
in interface MuleMessage
MuleMessage.getProperty(String, org.mule.api.transport.PropertyScope, Object)
public <T> T getInboundProperty(String name)
getInboundProperty
in interface MuleMessage
MuleMessage.getProperty(String, org.mule.api.transport.PropertyScope, Object)
public <T> T getInvocationProperty(String name, T defaultValue)
getInvocationProperty
in interface MuleMessage
MuleMessage.getProperty(String, org.mule.api.transport.PropertyScope, Object)
public <T> T getInvocationProperty(String name)
getInvocationProperty
in interface MuleMessage
MuleMessage.getProperty(String, org.mule.api.transport.PropertyScope, Object)
public <T> T getOutboundProperty(String name, T defaultValue)
getOutboundProperty
in interface MuleMessage
MuleMessage.getProperty(String, org.mule.api.transport.PropertyScope, Object)
public <T> T getOutboundProperty(String name)
getOutboundProperty
in interface MuleMessage
MuleMessage.getProperty(String, org.mule.api.transport.PropertyScope, Object)
public <T> T getSessionProperty(String name, T defaultValue)
getSessionProperty
in interface MuleMessage
public <T> T getSessionProperty(String name)
getSessionProperty
in interface MuleMessage
public <T> T getProperty(String name, PropertyScope scope, T defaultValue)
getProperty
in interface MuleMessage
T
- the defaultValue type ,this is used to validate the property value typename
- the name or key of the property. This must be non-null.scope
- The scope of the property to retrieve. This must be non-null.defaultValue
- the value to return if the property is not in the scope provided. Can be nullpublic void setCorrelationId(String id)
setCorrelationId
in interface MuleMessage
id
- the Id reference for this relationshippublic String getCorrelationId()
getCorrelationId
in interface MuleMessage
public void setReplyTo(Object replyTo)
setReplyTo
in interface MuleMessage
replyTo
- the endpointUri url to reply topublic Object getReplyTo()
getReplyTo
in interface MuleMessage
public int getCorrelationSequence()
getCorrelationSequence
in interface MuleMessage
public void setCorrelationSequence(int sequence)
setCorrelationSequence
in interface MuleMessage
sequence
- the sequence number or -1 if the sequence is not importantpublic int getCorrelationGroupSize()
getCorrelationGroupSize
in interface MuleMessage
public void setCorrelationGroupSize(int size)
setCorrelationGroupSize
in interface MuleMessage
size
- the total messages in this group or -1 if the size is not knownpublic ExceptionPayload getExceptionPayload()
getExceptionPayload
in interface MuleMessage
public void setExceptionPayload(ExceptionPayload exceptionPayload)
setExceptionPayload
in interface MuleMessage
exceptionPayload
- The exception payload to attach to this message@Deprecated public void addAttachment(String name, DataHandler dataHandler) throws Exception
addAttachment
in interface MuleMessage
name
- the name to associate with the attachmentdataHandler
- The attachment datahandler to use. This will be used to
interact with the attachment data.Exception
- if the attachment cannot be added for any reasonDataHandler
@Deprecated public void removeAttachment(String name) throws Exception
removeAttachment
in interface MuleMessage
name
- the name of the attachment to remove. If the attachment does not exist, the request may be ignoredException
- different messaging systems handle attachments differently, as such some will throw an exception
if an attachment does dot exist.@Deprecated public DataHandler getAttachment(String name)
getAttachment
in interface MuleMessage
name
- the name of the attachment to retrieveDataHandler
@Deprecated public Set<String> getAttachmentNames()
getAttachmentNames
in interface MuleMessage
public void addOutboundAttachment(String name, DataHandler dataHandler) throws Exception
MuleMessage
addOutboundAttachment
in interface MuleMessage
name
- the name to associate with the attachmentdataHandler
- The attachment DataHandler
to use. This will be used to interact with the attachment dataException
- if the attachment cannot be added for any reasonDataHandler
public void addInboundAttachment(String name, DataHandler dataHandler) throws Exception
Exception
public void addOutboundAttachment(String name, Object object, String contentType) throws Exception
MuleMessage
addOutboundAttachment
in interface MuleMessage
name
- the name to associate with the attachmentsobject
- the input stream to the contents of the attachment. This object can either be a URL
, which will construct a URL data source, or
a File
, which will construct a file data source. Any other object will be used as the raw contents of the attachmentcontentType
- the content type of the attachment. Note that the charset attribute can be specifed too i.e. text/plain;charset=UTF-8Exception
- if the attachment cannot be read or createdpublic void removeOutboundAttachment(String name) throws Exception
MuleMessage
removeOutboundAttachment
in interface MuleMessage
name
- the name of the attachment to remove. If the attachment does not exist, the request may be ignoredException
- different messaging systems handle attachments differently, as such some will throw an exception
if an attachment does dot exist.public DataHandler getInboundAttachment(String name)
MuleMessage
getInboundAttachment
in interface MuleMessage
name
- the name of the attachment to retrieveDataHandler
public DataHandler getOutboundAttachment(String name)
MuleMessage
getOutboundAttachment
in interface MuleMessage
name
- the name of the attachment to retrieveDataHandler
public Set<String> getInboundAttachmentNames()
getInboundAttachmentNames
in interface MuleMessage
public Set<String> getOutboundAttachmentNames()
getOutboundAttachmentNames
in interface MuleMessage
public <T> T findPropertyInAnyScope(String name, T defaultValue)
MuleMessage
findPropertyInAnyScope
in interface MuleMessage
T
- The Type of the property value that will be returnedname
- the name of the property to look fordefaultValue
- the default value that will be returned if the property is not foundpublic String getEncoding()
getEncoding
in interface MuleMessage
public void setEncoding(String encoding)
setEncoding
in interface MuleMessage
encoding
- the encoding to usepublic void setMimeType(String mimeType)
mimeType
- public void addProperties(Map<String,Object> props)
addProperties
in interface MuleMessage
props
- the properties add to this messagepublic void addProperties(Map<String,Object> props, PropertyScope scope)
addProperties
in interface MuleMessage
props
- the properties add to this messagescope
- the scope in which the properties should be addedpublic void clearProperties()
PropertyScope.INVOCATION
and
PropertyScope.OUTBOUND
.clearProperties
in interface MuleMessage
public void clearProperties(PropertyScope scope)
clearProperties
in interface MuleMessage
scope
- the property scope to clearpublic void clearAttachments()
PropertyScope.OUTBOUND
.clearAttachments
in interface MuleMessage
public Object getPayload()
getPayload
in interface MuleMessage
public void setPayload(Object payload)
setPayload
in interface MuleMessage
payload
- the object to assign as the message payloadpublic void setPayload(Object payload, DataType<?> dataType)
MuleMessage
setPayload
in interface MuleMessage
payload
- the object to assign as the message payloaddataType
- payload's dataType. Not null.public void release()
release
in interface MuleMessage
public void applyTransformers(MuleEvent event, List<? extends Transformer> transformers) throws MuleException
applyTransformers
in interface MuleMessage
event
- the event being processedtransformers
- the transformers to apply to the message payloadTransformerException
- if a transformation error occurs or one or more of the transformers passed in a
are incompatible with the message payloadMuleException
public void applyTransformers(MuleEvent event, Transformer... transformers) throws MuleException
applyTransformers
in interface MuleMessage
event
- the event being processedtransformers
- the transformers to apply to the message payloadTransformerException
- if a transformation error occurs or one or more of the transformers passed in a
are incompatible with the message payloadMuleException
public void applyTransformers(MuleEvent event, List<? extends Transformer> transformers, Class<?> outputType) throws MuleException
MuleMessage
applyTransformers
in interface MuleMessage
event
- the event being processedtransformers
- the transformers to apply to the message payloadoutputType
- the required output type for this transformation. by adding this parameter some additional
transformations will occur on the message payload to ensure that the final payload is of the specified type.
If no transformers can be found in the registry that can transform from the return type of the transformation
list to the outputType and exception will be thrownTransformerException
- if a transformation error occurs or one or more of the transformers passed in a
are incompatible with the message payloadMuleException
protected void applyAllTransformers(MuleEvent event, List<? extends Transformer> transformers) throws MuleException
MuleException
protected void setDataType(DataType<?> dt)
public ThreadSafeAccess newThreadCopy()
newThreadCopy
in interface ThreadSafeAccess
public void resetAccessControl()
resetAccessControl
in interface ThreadSafeAccess
public void assertAccess(boolean write)
assertAccess
in interface ThreadSafeAccess
write
- True if the access will mutate values.protected boolean isDisabled()
protected IllegalStateException newException(String message)
@Deprecated public boolean isConsumable()
ClassUtils.isConsumable(Class)
instead.
Determines if the payload of this message is consumable i.e. it can't be read
more than once.public void initAfterDeserialisation(MuleContext context) throws MuleException
DeserializationPostInitialisable
is used. This will get invoked
after the object has been deserialized passing in the current mulecontext when using either
SerializationWireFormat
,
SerializedMuleMessageWireFormat
or the
ByteArrayToSerializable
transformer.context
- the current muleContext instanceMuleException
- if there is an error initializingpublic DataType<?> getDataType()
MuleMessage
getDataType
in interface MuleMessage
@Deprecated public int getIntProperty(String name, int defaultValue)
getIntProperty
in interface MuleMessage
name
- the name or key of the propertydefaultValue
- a default value if the property doesn't exist in the event@Deprecated public long getLongProperty(String name, long defaultValue)
getLongProperty
in interface MuleMessage
name
- the name or key of the propertydefaultValue
- a default value if the property doesn't exist in the event@Deprecated public double getDoubleProperty(String name, double defaultValue)
getDoubleProperty
in interface MuleMessage
name
- the name or key of the propertydefaultValue
- a default value if the property doesn't exist in the event@Deprecated public boolean getBooleanProperty(String name, boolean defaultValue)
getBooleanProperty
in interface MuleMessage
name
- the name or key of the propertydefaultValue
- a default value if the property doesn't exist in the event@Deprecated public void setBooleanProperty(String name, boolean value)
setBooleanProperty
in interface MuleMessage
name
- the property name or keyvalue
- the property value@Deprecated public void setIntProperty(String name, int value)
setIntProperty
in interface MuleMessage
name
- the property name or keyvalue
- the property value@Deprecated public void setLongProperty(String name, long value)
setLongProperty
in interface MuleMessage
name
- the property name or keyvalue
- the property value@Deprecated public void setDoubleProperty(String name, double value)
setDoubleProperty
in interface MuleMessage
name
- the property name or keyvalue
- the property value@Deprecated public String getStringProperty(String name, String defaultValue)
getStringProperty
in interface MuleMessage
name
- the name or key of the propertydefaultValue
- a default value if the property doesn't exist in the event@Deprecated public void setStringProperty(String name, String value)
setStringProperty
in interface MuleMessage
name
- the property name or keyvalue
- the property valuepublic DataType<?> getPropertyDataType(String name, PropertyScope scope)
MuleMessage
getPropertyDataType
in interface MuleMessage
name
- the name or key of the property. This must be non-null.scope
- The scope of the property to retrieve. This must be non-null.public <T> T findPropertyInSpecifiedScopes(String name, PropertyScope... scopesToSearch)
public MuleMessage createInboundMessage() throws Exception
MuleMessage
createInboundMessage
in interface MuleMessage
Exception
protected void copyToInbound(DefaultMuleMessage newMessage) throws Exception
Exception
protected Map<String,TypedValue> getOrphanFlowVariables()
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.