public interface MuleEvent
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 UMO understands. The event can also maintain any number of
properties that can be set and retrieved by Mule UMO 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 |
---|---|
Credentials |
getCredentials() |
String |
getEncoding()
Gets the encoding for this message.
|
ImmutableEndpoint |
getEndpoint()
Gets the endpoint associated with this event
|
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()
Reterns the conents 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
|
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.
|
Object |
getProperty(String name,
boolean exhaustiveSearch)
Gets a property associated with the current event.
|
Object |
getProperty(String name,
Object defaultValue,
boolean exhaustiveSearch)
Gets a property associated with the current event.
|
Service |
getService()
Retrieves the service for the current event
|
MuleSession |
getSession()
Retrieves the service session for the current event
|
int |
getTimeout()
The number of milliseconds to wait for a return event when running
synchronously.
|
boolean |
isStopFurtherProcessing()
Determines whether the default processing for this event will be executed.
|
boolean |
isSynchronous()
Determines whether the was sent synchrounously or not
|
void |
setStopFurtherProcessing(boolean stopFurtherProcessing)
Determines whether the default processing for this event will be executed.
|
void |
setSynchronous(boolean value)
Determines whether the was sent synchrounously or not
|
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.
|
Object |
transformMessage(Class 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.
|
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 bytesObject transformMessage() throws TransformerException
TransformerException
- if a failure occurs in the transformerTransformer
Object transformMessage(Class outputType) throws TransformerException
outputType
- The requested output type.TransformerException
- if a failure occurs in the transformerTransformer
byte[] transformMessageToBytes() throws TransformerException
TransformerException
- 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()
Object getProperty(String name, boolean exhaustiveSearch)
exhaustiveSearch
is true, the endpoint and connector associated
with the event will also be searched for the property.name
- the property nameexhaustiveSearch
- also search the endpoint and connector for the
propertyObject getProperty(String name, Object defaultValue, boolean exhaustiveSearch)
exhaustiveSearch
is true, the endpoint and connector associated
with the event will also be searched for the property.name
- the property namedefaultValue
- a default value if the property doesn't exist in the eventexhaustiveSearch
- also search the endpoint and connector for the
propertyImmutableEndpoint getEndpoint()
MuleSession getSession()
Service getService()
boolean isStopFurtherProcessing()
org.mule.api.lifecycle.Callable
or calling
UMOManager.getEventContext
to obtain the MuleEventContext for
the current thread. The user can programmatically control how events are
dispached.org.mule.api.context.UMOManager
,
MuleEventContext
,
Callable
void setStopFurtherProcessing(boolean stopFurtherProcessing)
org.mule.api.lifecycle.Callable
or calling
UMOManager.getEventContext
to obtain the MuleEventContext for
the current thread. The user can programmatically control how events are
dispached.stopFurtherProcessing
- the value to set.boolean isSynchronous()
void setSynchronous(boolean value)
value
- true if the event is synchronousint getTimeout()
void setTimeout(int timeout)
timeout
- the event timeout in millisecondsOutputStream getOutputStream()
String getEncoding()
MuleContext getMuleContext()
Copyright © 2003–2013 MuleSource, Inc.. All rights reserved.