|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Method Summary | |
---|---|
void |
dispatchEvent(MuleMessage message)
Deprecated. |
void |
dispatchEvent(MuleMessage message,
EndpointURI endpoint)
Deprecated. |
void |
dispatchEvent(MuleMessage message,
OutboundEndpoint endpoint)
Depending on the session state this methods either Passes an event asynchronously to the next available Mule component in the pool or via the endpoint configured for the event |
void |
dispatchEvent(MuleMessage message,
String endpointName)
Depending on the session state this methods either Passes an event asynchronously to the next available Mule component in the pool or via the endpoint configured for the event. |
void |
dispatchEvent(Object payload)
Deprecated. |
Transaction |
getCurrentTransaction()
Returns the current transaction (if any) for the session |
String |
getEncoding()
Gets the encoding for the current message. |
URI |
getEndpointURI()
Returns a reference to the Endpoint Uri for this context This is the endpoint on which the event was received |
MessageExchangePattern |
getExchangePattern()
|
FlowConstruct |
getFlowConstruct()
|
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 This method will use the encoding set on the event |
String |
getMessageAsString(String encoding)
Returns the message contents as a string |
MuleContext |
getMuleContext()
|
OutputStream |
getOutputStream()
An outputstream the can optionally be used write response data to an incoming message. |
MuleSession |
getSession()
|
int |
getTimeout()
Get the timeout value associated with the event |
Transaction |
getTransaction()
Returns the transaction for the current event or null if there is no transaction in progresss |
boolean |
isStopFurtherProcessing()
Determines whether the default processing for this event will be executed. |
void |
markTransactionForRollback()
Mark the current transaction (if any) for rollback |
MuleMessage |
requestEvent(EndpointURI endpoint,
long timeout)
Deprecated. |
MuleMessage |
requestEvent(InboundEndpoint endpoint,
long timeout)
Requests a synchronous receive of an event on the service. |
MuleMessage |
requestEvent(String endpointName,
long timeout)
Requests a synchronous receive of an event on the service. |
MuleMessage |
sendEvent(MuleMessage message)
Deprecated. |
MuleMessage |
sendEvent(MuleMessage message,
EndpointURI endpoint)
Deprecated. |
MuleMessage |
sendEvent(MuleMessage message,
OutboundEndpoint endpoint)
Depending on the session state this methods either Passes an event synchronously to the next available Mule component in the pool or via the endpoint configured for the event |
MuleMessage |
sendEvent(MuleMessage message,
String endpointName)
Depending on the session state this methods either Passes an event synchronously to the next available Mule component in the pool or via the endpoint configured for the event |
MuleMessage |
sendEvent(Object message)
Deprecated. |
FutureMessageResult |
sendEventAsync(MuleMessage message,
EndpointURI endpoint,
int timeout)
sends an event request via the configured outbound router for this service. |
FutureMessageResult |
sendEventAsync(MuleMessage message,
int timeout)
sends an event request via the configured outbound router for this service. |
FutureMessageResult |
sendEventAsync(MuleMessage message,
String endpointName,
int timeout)
sends an event request via the configured outbound router for this service. |
FutureMessageResult |
sendEventAsync(Object message,
int timeout)
sends an event request via the configured outbound router for this service. |
void |
setStopFurtherProcessing(boolean stopFurtherProcessing)
Determines whether the default processing for this event will be executed. |
Object |
transformMessage(Class expectedType)
Returns the message transformed into it's recognised or expected format. |
Object |
transformMessage(DataType dataType)
Returns the message transformed into its recognised or expected format. |
byte[] |
transformMessageToBytes()
Deprecated. use transformMessage(org.mule.api.transformer.DataType) instead |
String |
transformMessageToString()
Returns the message transformed into it's recognised or expected format and then into a String. |
Method Detail |
---|
MuleMessage getMessage()
byte[] getMessageAsBytes() throws MuleException
MuleException
- if the message cannot be converted into an array of bytesObject transformMessage(DataType dataType) throws TransformerException
dataType
- The dataType required for the return object. This param
just provides a convienient way to manage type casting of
transformed objects
TransformerException
- if a failure occurs or
if the return type is not the same as the expected type in the
transformerTransformer
Object transformMessage(Class expectedType) throws TransformerException
expectedType
- The class type required for the return object. This param
just provides a convienient way to manage type casting of
transformed objects
TransformerException
- if a failure occurs or
if the return type is not the same as the expected type in the
transformerTransformer
@Deprecated byte[] transformMessageToBytes() throws TransformerException
transformMessage(org.mule.api.transformer.DataType)
instead
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 transforming the message
MuleException
- if the message cannot be converted into a stringTransaction getCurrentTransaction()
void markTransactionForRollback() throws TransactionException
TransactionException
- if operation failed@Deprecated MuleMessage sendEvent(Object message) throws MuleException
message
- the message to send
MuleException
- if there is no outbound endpoint configured on the
service or the events fails during dispatch@Deprecated MuleMessage sendEvent(MuleMessage message) throws MuleException
message
- the message payload to send
MuleException
- if the event fails to be processed by the service or
the transport for the endpoint@Deprecated MuleMessage sendEvent(MuleMessage message, EndpointURI endpoint) throws MuleException
message
- the event message payload to sendendpoint
- The endpointUri to disptch the event through
MuleException
- if the event fails to be processed by the service or
the transport for the endpointMuleMessage sendEvent(MuleMessage message, String endpointName) throws MuleException
message
- the event message payload to sendendpointName
- The endpoint name to disptch the event through. This will
be looked up first on the service configuration and then on the
mule manager configuration
MuleException
- if the event fails to be processed by the service or
the transport for the endpointMuleMessage sendEvent(MuleMessage message, OutboundEndpoint endpoint) throws MuleException
message
- the event message payload to sendendpoint
- The endpoint to disptch the event through.
MuleException
- if the event fails to be processed by the service or
the transport for the endpointFutureMessageResult sendEventAsync(Object message, int timeout) throws MuleException
message
- the object that is the payload of the eventtimeout
- how long to block in milliseconds waiting for a result
MuleException
- if the dispatch fails or the components or
transfromers cannot be foundFutureMessageResult
FutureMessageResult sendEventAsync(MuleMessage message, int timeout) throws MuleException
message
- the MuleMessage of the eventtimeout
- how long to block in milliseconds waiting for a result
MuleException
- if the dispatch fails or the components or
transfromers cannot be foundFutureMessageResult
FutureMessageResult sendEventAsync(MuleMessage message, EndpointURI endpoint, int timeout) throws MuleException
message
- the MuleMessage of the eventendpoint
- the endpointUri to dispatch totimeout
- how long to block in milliseconds waiting for a result
MuleException
- if the dispatch fails or the components or
transfromers cannot be foundFutureMessageResult
FutureMessageResult sendEventAsync(MuleMessage message, String endpointName, int timeout) throws MuleException
message
- the MuleMessage of the eventendpointName
- The endpoint name to disptch the event through. This will
be looked up first on the service configuration and then on the
mule manager configurationtimeout
- how long to block in milliseconds waiting for a result
MuleException
- if the dispatch fails or the components or
transfromers cannot be foundFutureMessageResult
@Deprecated void dispatchEvent(MuleMessage message) throws MuleException
message
- the message to send
MuleException
- if there is no outbound endpoint configured on the
service or the events fails during dispatch@Deprecated void dispatchEvent(Object payload) throws MuleException
payload
- the message payloadto send
MuleException
- if there is no outbound endpoint configured on the
service or the events fails during dispatch@Deprecated void dispatchEvent(MuleMessage message, EndpointURI endpoint) throws MuleException
message
- the event message payload to sendendpoint
- the endpointUri to dispatc the event to first on the service
configuration and then on the mule manager configuration
MuleException
- if the event fails to be processed by the service or
the transport for the endpointvoid dispatchEvent(MuleMessage message, String endpointName) throws MuleException
message
- the event message payload to sendendpointName
- The endpoint name to disptch the event through. This will
be looked up first on the service configuration and then on the
mule manager configuration
MuleException
- if the event fails to be processed by the service or
the transport for the endpointvoid dispatchEvent(MuleMessage message, OutboundEndpoint endpoint) throws MuleException
message
- the event message payload to sendendpoint
- The endpoint name to disptch the event through.
MuleException
- if the event fails to be processed by the service or
the transport for the endpointMuleMessage requestEvent(InboundEndpoint endpoint, long timeout) throws MuleException
endpoint
- the endpoint identifying the endpointUri on which the event
will be receivedtimeout
- time in milliseconds before the request times out
MuleException
- if the request operation failsMuleMessage requestEvent(String endpointName, long timeout) throws MuleException
endpointName
- the endpoint identifying the endpointUri on which the
event will be receivedtimeout
- time in milliseconds before the request timesout
MuleException
- if the request operation fails@Deprecated MuleMessage requestEvent(EndpointURI endpoint, long timeout) throws MuleException
endpoint
- the endpointUri on which the event will be receivedtimeout
- time in milliseconds before the request timesout
MuleException
- if the request operation failsFlowConstruct 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
UMOManager.getEventContext
to obtain the MuleEventContext for
the current thread. The user can programmatically control how events are
dispached.
stopFurtherProcessing
- the value to set.OutputStream getOutputStream()
MessageExchangePattern getExchangePattern()
URI getEndpointURI()
Transaction getTransaction()
int getTimeout()
String getEncoding()
MuleSession getSession()
MuleContext getMuleContext()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |