public class VoidMuleEvent extends Object implements MuleEvent
VoidMuleEvent
represents a void return from a MessageProcessor
such as a ONE_WAY
OutboundEndpoint
.TIMEOUT_DO_NOT_WAIT, TIMEOUT_NOT_SET_VALUE, TIMEOUT_WAIT_FOREVER
Modifier | Constructor and Description |
---|---|
protected |
VoidMuleEvent() |
Modifier and Type | Method and Description |
---|---|
void |
captureReplyToDestination()
Set the reply-to destination from the current message, and remove it from the message, to prevent any
further propagation.
|
void |
clearFlowVariables() |
void |
clearSessionVariables() |
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).
|
static VoidMuleEvent |
getInstance() |
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)
Gets a property associated with the current event.
|
Object |
getProperty(String name,
Object defaultValue)
Gets a property associated with the current event.
|
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) |
DataType<?> |
getSessionVariableDataType(String key)
Gets the data type for a given session variable
|
Set<String> |
getSessionVariableNames() |
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) |
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)
Sets a session variable value with a default data type
|
void |
setSessionVariable(String key,
Serializable value,
DataType dataType)
Sets a session variable value with a given data type
|
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()
Transforms the message into it's recognised or expected format.
|
<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()
Transforms the message into it's recognised or expected format and then into an array of bytes.
|
String |
transformMessageToString()
Returns the message transformed into it's recognised or expected format and then into a String.
|
public static VoidMuleEvent getInstance()
public MuleMessage getMessage()
MuleEvent
getMessage
in interface MuleEvent
public Credentials getCredentials()
getCredentials
in interface MuleEvent
public byte[] getMessageAsBytes() throws MuleException
MuleEvent
getMessageAsBytes
in interface MuleEvent
MuleException
- if the message cannot be converted into an array of bytespublic Object transformMessage() throws TransformerException
MuleEvent
transformMessage
in interface MuleEvent
TransformerException
- if a failure occurs in the transformerTransformer
public <T> T transformMessage(Class<T> outputType) throws TransformerException
MuleEvent
transformMessage
in interface MuleEvent
outputType
- The requested output type.TransformerException
- if a failure occurs in the transformerif the transform fails or the outputtype is null
public <T> T transformMessage(DataType<T> outputType) throws TransformerException
MuleEvent
transformMessage
in interface MuleEvent
outputType
- The requested output type.TransformerException
- if a failure occurs in the transformerif the transform fails or the outputtype is null
public byte[] transformMessageToBytes() throws TransformerException
MuleEvent
transformMessageToBytes
in interface MuleEvent
TransformerException
- if a failure occurs in the transformerTransformer
public String transformMessageToString() throws TransformerException
MuleEvent
transformMessageToString
in interface MuleEvent
TransformerException
- if a failure occurs in the transformerTransformer
public String getMessageAsString() throws MuleException
MuleEvent
getMessageAsString
in interface MuleEvent
MuleException
- if the message cannot be converted into a stringpublic String getMessageAsString(String encoding) throws MuleException
MuleEvent
getMessageAsString
in interface MuleEvent
encoding
- the encoding to use when converting the message to stringMuleException
- if the message cannot be converted into a stringpublic String getId()
MuleEvent
public Object getProperty(String name)
MuleEvent
getProperty
in interface MuleEvent
name
- the property namepublic Object getProperty(String name, Object defaultValue)
MuleEvent
getProperty
in interface MuleEvent
name
- the property namedefaultValue
- a default value if the property doesn't exist in the eventpublic MuleSession getSession()
MuleEvent
getSession
in interface MuleEvent
public FlowConstruct getFlowConstruct()
MuleEvent
getFlowConstruct
in interface MuleEvent
public boolean isStopFurtherProcessing()
MuleEvent
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.isStopFurtherProcessing
in interface MuleEvent
MuleContext
,
MuleEventContext
,
Callable
public void setStopFurtherProcessing(boolean stopFurtherProcessing)
MuleEvent
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.setStopFurtherProcessing
in interface MuleEvent
stopFurtherProcessing
- the value to set.public int getTimeout()
MuleEvent
getTimeout
in interface MuleEvent
public void setTimeout(int timeout)
MuleEvent
setTimeout
in interface MuleEvent
timeout
- the event timeout in millisecondspublic OutputStream getOutputStream()
MuleEvent
getOutputStream
in interface MuleEvent
public String getEncoding()
MuleEvent
getEncoding
in interface MuleEvent
public MuleContext getMuleContext()
MuleEvent
getMuleContext
in interface MuleEvent
public ProcessingTime getProcessingTime()
MuleEvent
getProcessingTime
in interface MuleEvent
public MessageExchangePattern getExchangePattern()
MuleEvent
getExchangePattern
in interface MuleEvent
public boolean isTransacted()
MuleEvent
isTransacted
in interface MuleEvent
public URI getMessageSourceURI()
MuleEvent
URI
of the MessageSource that recieved or generated the message being processed.getMessageSourceURI
in interface MuleEvent
public String getMessageSourceName()
MuleEvent
getMessageSourceName
in interface MuleEvent
public ReplyToHandler getReplyToHandler()
MuleEvent
getReplyToHandler
in interface MuleEvent
public Object getReplyToDestination()
MuleEvent
getReplyToDestination
in interface MuleEvent
public void captureReplyToDestination()
MuleEvent
captureReplyToDestination
in interface MuleEvent
public boolean isSynchronous()
isSynchronous
in interface MuleEvent
public void setMessage(MuleMessage message)
setMessage
in interface MuleEvent
public <T> T getFlowVariable(String key)
getFlowVariable
in interface MuleEvent
public DataType<?> getFlowVariableDataType(String key)
MuleEvent
getFlowVariableDataType
in interface MuleEvent
public void setFlowVariable(String key, Object value)
MuleEvent
setFlowVariable
in interface MuleEvent
key
- the name or key of the variable. This must be non-null.value
- value for the variablepublic void setFlowVariable(String key, Object value, DataType dataType)
MuleEvent
setFlowVariable
in interface MuleEvent
key
- the name or key of the variable. This must be non-null.value
- value for the variabledataType
- value's dataType. Not null.public void removeFlowVariable(String key)
removeFlowVariable
in interface MuleEvent
public Set<String> getFlowVariableNames()
getFlowVariableNames
in interface MuleEvent
public void clearFlowVariables()
clearFlowVariables
in interface MuleEvent
public <T> T getSessionVariable(String key)
getSessionVariable
in interface MuleEvent
public DataType<?> getSessionVariableDataType(String key)
MuleEvent
getSessionVariableDataType
in interface MuleEvent
key
- the name or key of the variable. This must be non-null.public void setSessionVariable(String key, Object value)
MuleEvent
setSessionVariable
in interface MuleEvent
key
- the name or key of the variable. This must be non-null.public void setSessionVariable(String key, Serializable value, DataType dataType)
MuleEvent
setSessionVariable
in interface MuleEvent
key
- the name or key of the variable. This must be non-null.value
- value for the variabledataType
- value's dataType. Not null.public void removeSessionVariable(String key)
removeSessionVariable
in interface MuleEvent
public Set<String> getSessionVariableNames()
getSessionVariableNames
in interface MuleEvent
public void clearSessionVariables()
clearSessionVariables
in interface MuleEvent
public boolean isNotificationsEnabled()
MuleEvent
isNotificationsEnabled
in interface MuleEvent
public void setEnableNotifications(boolean enabled)
MuleEvent
setEnableNotifications
in interface MuleEvent
public boolean isAllowNonBlocking()
MuleEvent
isAllowNonBlocking
in interface MuleEvent
public FlowCallStack getFlowCallStack()
MuleEvent
DefaultMuleConfiguration.isFlowTrace()
is true
. If false
,
the stack will always be empty.getFlowCallStack
in interface MuleEvent
public ProcessorsTrace getProcessorsTrace()
MuleEvent
DefaultMuleConfiguration.isFlowTrace()
is true
. If false
,
the list will always be empty.getProcessorsTrace
in interface MuleEvent
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.