public interface MuleEventContext
MuleEventContext is the context object for the current request. Using the context, developers can
send/dispatch/receive events programmatically as well as manage transactions.| Modifier and Type | Method and Description |
|---|---|
Transaction |
getCurrentTransaction()
Returns the current transaction (if any) for the session
|
Event |
getEvent()
Returns the event
|
FlowConstruct |
getFlowConstruct() |
org.mule.runtime.api.message.Message |
getMessage()
Returns the message payload for this event
|
String |
getMessageAsString(Charset encoding,
MuleContext muleContext)
Returns the message contents as a string
|
String |
getMessageAsString(MuleContext muleContext)
Returns the message contents as a string This method will use the encoding set on the event
|
MuleSession |
getSession() |
Transaction |
getTransaction()
Returns the transaction for the current event or null if there is no transaction in progress
|
void |
setEvent(Event event)
Sets the event for this context.
|
Object |
transformMessage(Class expectedType,
MuleContext muleContext)
Returns the message transformed into it's recognised or expected format.
|
Object |
transformMessage(org.mule.runtime.api.metadata.DataType dataType,
MuleContext muleContext)
Returns the message transformed into its recognised or expected format.
|
String |
transformMessageToString(MuleContext muleContext)
Returns the message transformed into it's recognised or expected format and then into a String.
|
org.mule.runtime.api.message.Message getMessage()
Event getEvent()
void setEvent(Event event)
event - Object transformMessage(org.mule.runtime.api.metadata.DataType dataType, MuleContext muleContext) throws TransformerException
dataType - The dataType required for the return object. This param just provides a convienient way to manage type
casting of transformed objectsmuleContext - the Mule node.TransformerException - if a failure occurs or if the return type is not the same
as the expected type in the transformerTransformerObject transformMessage(Class expectedType, MuleContext muleContext) throws TransformerException
expectedType - The class type required for the return object. This param just provides a convienient way to manage type
casting of transformed objectsmuleContext - the Mule node.TransformerException - if a failure occurs or if the return type is not the same
as the expected type in the transformerTransformerString transformMessageToString(MuleContext muleContext) throws TransformerException
muleContext - the Mule node.TransformerException - if a failure occurs in the transformerTransformerString getMessageAsString(MuleContext muleContext) throws org.mule.runtime.api.exception.MuleException
muleContext - the Mule node.org.mule.runtime.api.exception.MuleException - if the message cannot be converted into a stringString getMessageAsString(Charset encoding, MuleContext muleContext) throws org.mule.runtime.api.exception.MuleException
encoding - The encoding to use when transforming the messagemuleContext - the Mule node.org.mule.runtime.api.exception.MuleException - if the message cannot be converted into a stringTransaction getCurrentTransaction()
FlowConstruct getFlowConstruct()
Transaction getTransaction()
MuleSession getSession()
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.