@Deprecated public class DefaultMuleEventContext extends Object implements MuleEventContext
DefaultMuleEventContext 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 | Field and Description |
|---|---|
protected static org.slf4j.Logger |
logger
Deprecated.
logger used by this class
|
| Constructor and Description |
|---|
DefaultMuleEventContext(FlowConstruct flow,
Event event)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
Transaction |
getCurrentTransaction()
Deprecated.
Returns the current transaction (if any) for the session
|
Event |
getEvent()
Deprecated.
Returns the event
|
FlowConstruct |
getFlowConstruct()
Deprecated.
|
org.mule.runtime.api.message.Message |
getMessage()
Deprecated.
Returns the message payload for this event
|
String |
getMessageAsString(Charset encoding,
MuleContext muleContext)
Deprecated.
Returns the message contents as a string
|
String |
getMessageAsString(MuleContext muleContext)
Deprecated.
Returns the message contents as a string This method will use the default encoding on the event
|
MuleSession |
getSession()
Deprecated.
|
Transaction |
getTransaction()
Deprecated.
Returns the transaction for the current event or null if there is no transaction in progresss
|
void |
setEvent(Event event)
Deprecated.
Sets the event for this context.
|
String |
toString()
Deprecated.
|
Object |
transformMessage(Class expectedType,
MuleContext muleContext)
Deprecated.
Returns the message transformed into its recognised or expected format.
|
Object |
transformMessage(org.mule.runtime.api.metadata.DataType dataType,
MuleContext muleContext)
Deprecated.
Returns the message transformed into its recognised or expected format.
|
String |
transformMessageToString(MuleContext muleContext)
Deprecated.
Returns the message transformed into it's recognised or expected format and then into a String.
|
protected static final org.slf4j.Logger logger
public DefaultMuleEventContext(FlowConstruct flow, Event event)
public org.mule.runtime.api.message.Message getMessage()
getMessage in interface MuleEventContextpublic Event getEvent()
MuleEventContextgetEvent in interface MuleEventContextpublic void setEvent(Event event)
MuleEventContextsetEvent in interface MuleEventContextpublic Object transformMessage(org.mule.runtime.api.metadata.DataType dataType, MuleContext muleContext) throws TransformerException
transformMessage in interface MuleEventContextdataType - 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 transformerTransformerpublic Object transformMessage(Class expectedType, MuleContext muleContext) throws TransformerException
transformMessage in interface MuleEventContextexpectedType - 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 transformerTransformerpublic String getMessageAsString(Charset encoding, MuleContext muleContext) throws org.mule.runtime.api.exception.MuleException
getMessageAsString in interface MuleEventContextencoding - 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 stringpublic String transformMessageToString(MuleContext muleContext) throws TransformerException
transformMessageToString in interface MuleEventContextmuleContext - the Mule node.TransformerException - if a failure occurs in the transformerTransformerpublic String getMessageAsString(MuleContext muleContext) throws org.mule.runtime.api.exception.MuleException
getMessageAsString in interface MuleEventContextmuleContext - the Mule node.org.mule.runtime.api.exception.MuleException - if the message cannot be converted into a stringpublic Transaction getCurrentTransaction()
getCurrentTransaction in interface MuleEventContextpublic FlowConstruct getFlowConstruct()
getFlowConstruct in interface MuleEventContextpublic Transaction getTransaction()
getTransaction in interface MuleEventContextpublic MuleSession getSession()
getSession in interface MuleEventContextCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.