public interface MuleEvent extends Serializable
MuleEvent
represents any data event occuring in the Mule environment. All data sent or
received within the mule environment will be passed between components as an MuleEvent.
The MuleEvent holds a MuleMessage payload and provides helper methods for obtaining the data in a format
that the receiving Mule component understands. The event can also maintain any number of properties that
can be set and retrieved by Mule components.MuleMessage
Modifier and Type | Field and Description |
---|---|
static int |
TIMEOUT_DO_NOT_WAIT |
static int |
TIMEOUT_NOT_SET_VALUE |
static int |
TIMEOUT_WAIT_FOREVER |
Modifier and Type | Method and Description |
---|---|
void |
captureReplyToDestination()
Deprecated.
this method was used to move the replyToDestination from the message to the event. The
same must now be done explicitly inside the message receiver which creates the event.
|
void |
clearFlowVariables() |
void |
clearSessionVariables()
Deprecated.
use
getSession() to manipulate session state |
Credentials |
getCredentials() |
String |
getEncoding()
Gets the encoding for this message.
|
MessageExchangePattern |
getExchangePattern()
Returns the message exchange pattern for this event
|
FlowCallStack |
getFlowCallStack()
Events have a stack of executed flows (same as a call stack), so that at any given instant an application
developer can determine where this event came from.
|
FlowConstruct |
getFlowConstruct()
Retrieves the service for the current event
|
<T> T |
getFlowVariable(String key) |
DataType<?> |
getFlowVariableDataType(String key)
Gets the data type for a given flow variable
|
Set<String> |
getFlowVariableNames() |
String |
getId()
Every event in the system is assigned a universally unique id (UUID).
|
MuleMessage |
getMessage()
Returns the message payload for this event
|
byte[] |
getMessageAsBytes()
Returns the contents of the message as a byte array.
|
String |
getMessageAsString()
Returns the message contents as a string If necessary this will use the encoding set on the event
|
String |
getMessageAsString(String encoding)
Returns the message contents as a string
|
String |
getMessageSourceName()
Returns the message source name if it has one, otherwise returns toString() of the URI returned be
getMessageSourceURI()
|
URI |
getMessageSourceURI()
Returns the
URI of the MessageSource that recieved or generated the message being processed. |
MuleContext |
getMuleContext()
Returns the muleContext for the Mule node that this event was received in
|
OutputStream |
getOutputStream()
An outputstream the can optionally be used write response data to an incoming message.
|
ProcessingTime |
getProcessingTime()
Returns the times spent processing this event (so far)
|
ProcessorsTrace |
getProcessorsTrace()
Events have a list of message processor paths it went trough so that the execution path of an event can be
reconstructed after it has executed.
|
Object |
getProperty(String name)
Deprecated.
|
Object |
getProperty(String name,
Object defaultValue)
Deprecated.
|
Object |
getReplyToDestination()
Return the destination (if any) that will be passed to the reply-to handler.
|
ReplyToHandler |
getReplyToHandler()
Return the replyToHandler (if any) that will be used to perform async reply
|
MuleSession |
getSession()
Retrieves the service session for the current event
|
<T> T |
getSessionVariable(String key)
Deprecated.
use
getSession() to manipulate session state |
DataType<?> |
getSessionVariableDataType(String key)
Deprecated.
use
getSession() to manipulate session state |
Set<String> |
getSessionVariableNames()
Deprecated.
use
getSession() to manipulate session state |
int |
getTimeout()
The number of milliseconds to wait for a return event when running synchronously.
|
boolean |
isAllowNonBlocking()
Indicates if the current event allows non-blocking execution and IO.
|
boolean |
isNotificationsEnabled()
Indicates if notifications should be fired when processing this message.
|
boolean |
isStopFurtherProcessing()
Determines whether the default processing for this event will be executed.
|
boolean |
isSynchronous() |
boolean |
isTransacted()
Returns true is this event is being processed in a transaction
|
void |
removeFlowVariable(String key) |
void |
removeSessionVariable(String key)
Deprecated.
use
getSession() to manipulate session state |
void |
setEnableNotifications(boolean enabled)
Enables the firing of notifications when processing the message.
|
void |
setFlowVariable(String key,
Object value)
Sets a session variable value with a default data type
|
void |
setFlowVariable(String key,
Object value,
DataType dataType)
Sets a flow variable value with a given data type
|
void |
setMessage(MuleMessage message) |
void |
setSessionVariable(String key,
Object value)
Deprecated.
use
getSession() to manipulate session state |
void |
setSessionVariable(String key,
Serializable value,
DataType dataType)
Deprecated.
use
getSession() to manipulate session state |
void |
setStopFurtherProcessing(boolean stopFurtherProcessing)
Determines whether the default processing for this event will be executed.
|
void |
setTimeout(int timeout)
The number of milliseconds to wait for a return event when running synchronously.
|
Object |
transformMessage()
Deprecated.
Since Mule 3.0 this method does nothing. The message is already transformed before the
event reaches a component IF you need to have access to the original message, the must be
no transformations before the component, this means that any 'connector-level' transfromers
will have to be explicitly overriden via the service overrides on the connector.
|
<T> T |
transformMessage(Class<T> outputType)
Transforms the message into the requested format.
|
<T> T |
transformMessage(DataType<T> outputType)
Transforms the message into the requested format.
|
byte[] |
transformMessageToBytes()
Deprecated.
|
String |
transformMessageToString()
Returns the message transformed into it's recognised or expected format and then into a String.
|
static final int TIMEOUT_WAIT_FOREVER
static final int TIMEOUT_DO_NOT_WAIT
static final int TIMEOUT_NOT_SET_VALUE
MuleMessage getMessage()
Credentials getCredentials()
byte[] getMessageAsBytes() throws MuleException
MuleException
- if the message cannot be converted into an array of bytes@Deprecated Object transformMessage() throws TransformerException
TransformerException
- if a failure occurs in the transformerTransformer
<T> T transformMessage(Class<T> outputType) throws TransformerException
outputType
- The requested output type.TransformerException
- if a failure occurs in the transformerif the transform fails or the outputtype is null
<T> T transformMessage(DataType<T> outputType) throws TransformerException
outputType
- The requested output type.TransformerException
- if a failure occurs in the transformerif the transform fails or the outputtype is null
@Deprecated byte[] transformMessageToBytes() throws TransformerException
transformMessage(org.mule.api.transformer.DataType)
insteadTransformerException
- if a failure occurs in the transformerTransformer
String transformMessageToString() throws TransformerException
TransformerException
- if a failure occurs in the transformerTransformer
String getMessageAsString() throws MuleException
MuleException
- if the message cannot be converted into a stringString getMessageAsString(String encoding) throws MuleException
encoding
- the encoding to use when converting the message to stringMuleException
- if the message cannot be converted into a stringString getId()
@Deprecated Object getProperty(String name)
name
- the property name@Deprecated Object getProperty(String name, Object defaultValue)
name
- the property namedefaultValue
- a default value if the property doesn't exist in the eventMuleSession getSession()
FlowConstruct getFlowConstruct()
boolean isStopFurtherProcessing()
org.mule.api.lifecycle.Callable
or calling RequestContext.getEventContext
to
obtain the MuleEventContext for the current thread. The user can programmatically control how events
are dispached.MuleContext
,
MuleEventContext
,
Callable
void setStopFurtherProcessing(boolean stopFurtherProcessing)
org.mule.api.lifecycle.Callable
or calling RequestContext.getEventContext
to
obtain the MuleEventContext for the current thread. The user can programmatically control how events
are dispached.stopFurtherProcessing
- the value to set.int getTimeout()
void setTimeout(int timeout)
timeout
- the event timeout in millisecondsOutputStream getOutputStream()
String getEncoding()
MuleContext getMuleContext()
ProcessingTime getProcessingTime()
MessageExchangePattern getExchangePattern()
boolean isTransacted()
URI getMessageSourceURI()
URI
of the MessageSource that recieved or generated the message being processed.String getMessageSourceName()
ReplyToHandler getReplyToHandler()
Object getReplyToDestination()
@Deprecated void captureReplyToDestination()
boolean isSynchronous()
void setMessage(MuleMessage message)
<T> T getFlowVariable(String key)
DataType<?> getFlowVariableDataType(String key)
name
- the name or key of the variable. This must be non-null.void setFlowVariable(String key, Object value)
key
- the name or key of the variable. This must be non-null.value
- value for the variablevoid setFlowVariable(String key, Object value, DataType dataType)
key
- the name or key of the variable. This must be non-null.value
- value for the variabledataType
- value's dataType. Not null.void removeFlowVariable(String key)
void clearFlowVariables()
@Deprecated <T> T getSessionVariable(String key)
getSession()
to manipulate session state@Deprecated DataType<?> getSessionVariableDataType(String key)
getSession()
to manipulate session statekey
- the name or key of the variable. This must be non-null.@Deprecated void setSessionVariable(String key, Object value)
getSession()
to manipulate session statekey
- the name or key of the variable. This must be non-null.@Deprecated void setSessionVariable(String key, Serializable value, DataType dataType)
getSession()
to manipulate session statekey
- the name or key of the variable. This must be non-null.value
- value for the variabledataType
- value's dataType. Not null.@Deprecated void removeSessionVariable(String key)
getSession()
to manipulate session state@Deprecated Set<String> getSessionVariableNames()
getSession()
to manipulate session state@Deprecated void clearSessionVariables()
getSession()
to manipulate session stateboolean isNotificationsEnabled()
void setEnableNotifications(boolean enabled)
enabled
- boolean isAllowNonBlocking()
FlowCallStack getFlowCallStack()
DefaultMuleConfiguration.isFlowTrace()
is true
. If false
,
the stack will always be empty.ProcessorsTrace getProcessorsTrace()
DefaultMuleConfiguration.isFlowTrace()
is true
. If false
,
the list will always be empty.Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.