|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UMOEventContext
UMOEventContext
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(Object payload)
This will dispatch an event asynchronously via the configured outbound endpoint on the component for this session |
void |
dispatchEvent(UMOMessage message)
This will dispatch an event asynchronously via the configured outbound endpoint on the component for this session |
void |
dispatchEvent(UMOMessage message,
String endpointName)
Depending on the session state this methods either Passes an event asynchronously to the next available Mule UMO in the pool or via the endpoint configured for the event. |
void |
dispatchEvent(UMOMessage message,
UMOEndpoint endpoint)
Depending on the session state this methods either Passes an event asynchronously to the next available Mule UMO in the pool or via the endpoint configured for the event |
void |
dispatchEvent(UMOMessage message,
UMOEndpointURI endpoint)
Depending on the session state this methods either Passes an event asynchronously to the next available Mule UMO in the pool or via the endpoint configured for the event |
UMODescriptor |
getComponentDescriptor()
|
UMOTransaction |
getCurrentTransaction()
Returns the current transaction (if any) for the session |
String |
getEncoding()
Gets the encoding for the current message. |
UMOEndpointURI |
getEndpointURI()
Returns a reference to the Endpoint Uri for this context This is the endpoint on which the event was received |
UMOMessage |
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 |
OutputStream |
getOutputStream()
An outputstream the can optionally be used write response data to an incoming message. |
UMOSession |
getSession()
|
int |
getTimeout()
Get the timeout value associated with the event |
UMOTransaction |
getTransaction()
Returns the transaction for the current event or null if there is no transaction in progresss |
Object |
getTransformedMessage()
Returns the message transformed into it's recognised or expected format. |
Object |
getTransformedMessage(Class expectedType)
Returns the message transformed into it's recognised or expected format. |
byte[] |
getTransformedMessageAsBytes()
Returns the message transformed into it's recognised or expected format and then into an array of bytes. |
String |
getTransformedMessageAsString()
Returns the message transformed into it's recognised or expected format and then into a String. |
String |
getTransformedMessageAsString(String encoding)
Returns the message transformed into it's recognised or expected format and then into a String. |
boolean |
isStopFurtherProcessing()
Determines whether the default processing for this event will be executed. |
boolean |
isStreaming()
Determines whether the event flow is being streamed |
boolean |
isSynchronous()
Determines whether the was sent synchrounously or not |
void |
markTransactionForRollback()
Mark the current transaction (if any) for rollback |
UMOMessage |
receiveEvent(String endpointName,
long timeout)
Requests a synchronous receive of an event on the component. |
UMOMessage |
receiveEvent(UMOEndpoint endpoint,
long timeout)
Requests a synchronous receive of an event on the component. |
UMOMessage |
receiveEvent(UMOEndpointURI endpoint,
long timeout)
Requests a synchronous receive of an event on the component. |
UMOMessage |
sendEvent(Object message)
This will send an event via the configured outbound router on the component |
UMOMessage |
sendEvent(UMOMessage message)
Depending on the session state this methods either Passes an event synchronously to the next available Mule UMO in the pool or via the endpoint configured for the event |
UMOMessage |
sendEvent(UMOMessage message,
String endpointName)
Depending on the session state this methods either Passes an event synchronously to the next available Mule UMO in the pool or via the endpoint configured for the event |
UMOMessage |
sendEvent(UMOMessage message,
UMOEndpoint endpoint)
Depending on the session state this methods either Passes an event synchronously to the next available Mule UMO in the pool or via the endpoint configured for the event |
UMOMessage |
sendEvent(UMOMessage message,
UMOEndpointURI endpoint)
Depending on the session state this methods either Passes an event synchronously to the next available Mule UMO in the pool or via the endpoint configured for the event |
FutureMessageResult |
sendEventAsync(Object message,
int timeout)
sends an event request via the configured outbound router for this component. |
FutureMessageResult |
sendEventAsync(UMOMessage message,
int timeout)
sends an event request via the configured outbound router for this component. |
FutureMessageResult |
sendEventAsync(UMOMessage message,
String endpointName,
int timeout)
sends an event request via the configured outbound router for this component. |
FutureMessageResult |
sendEventAsync(UMOMessage message,
UMOEndpointURI endpoint,
int timeout)
sends an event request via the configured outbound router for this component. |
void |
setStopFurtherProcessing(boolean stopFurtherProcessing)
Determines whether the default processing for this event will be executed. |
Method Detail |
---|
UMOMessage getMessage()
byte[] getMessageAsBytes() throws UMOException
UMOException
- if the message cannot be converted into an array of bytesObject getTransformedMessage() throws TransformerException
TransformerException
- if a failure occurs in
the transformerUMOTransformer
Object getTransformedMessage(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
transformerUMOTransformer
byte[] getTransformedMessageAsBytes() throws TransformerException
TransformerException
- if a failure occurs in the transformerUMOTransformer
String getTransformedMessageAsString() throws TransformerException
TransformerException
- if a failure occurs in the transformerUMOTransformer
String getMessageAsString() throws UMOException
UMOException
- if the message cannot be converted into a stringString getTransformedMessageAsString(String encoding) throws TransformerException
encoding
- The encoding to use when transforming the message
TransformerException
- if a failure occurs in the transformerUMOTransformer
String getMessageAsString(String encoding) throws UMOException
encoding
- The encoding to use when transforming the message
UMOException
- if the message cannot be converted into a stringUMOTransaction getCurrentTransaction()
void markTransactionForRollback() throws TransactionException
TransactionException
UMOMessage sendEvent(Object message) throws UMOException
message
- the message to send
UMOException
- if there is no outbound endpoint configured on the
component or the events fails during dispatchUMOMessage sendEvent(UMOMessage message) throws UMOException
message
- the message payload to send
UMOException
- if the event fails to be processed by the component or
the transport for the endpointUMOMessage sendEvent(UMOMessage message, UMOEndpointURI endpoint) throws UMOException
message
- the event message payload to sendendpoint
- The endpointUri to disptch the event through
UMOException
- if the event fails to be processed by the component or
the transport for the endpointUMOMessage sendEvent(UMOMessage message, String endpointName) throws UMOException
message
- the event message payload to sendendpointName
- The endpoint name to disptch the event through. This will
be looked up first on the component configuration and then on the
mule manager configuration
UMOException
- if the event fails to be processed by the component or
the transport for the endpointUMOMessage sendEvent(UMOMessage message, UMOEndpoint endpoint) throws UMOException
message
- the event message payload to sendendpoint
- The endpoint to disptch the event through.
UMOException
- if the event fails to be processed by the component or
the transport for the endpointFutureMessageResult sendEventAsync(Object message, int timeout) throws UMOException
message
- the object that is the payload of the eventtimeout
- how long to block in milliseconds waiting for a result
UMOException
- if the dispatch fails or the components or
transfromers cannot be foundFutureMessageResult
FutureMessageResult sendEventAsync(UMOMessage message, int timeout) throws UMOException
message
- the UMOMessage of the eventtimeout
- how long to block in milliseconds waiting for a result
UMOException
- if the dispatch fails or the components or
transfromers cannot be foundFutureMessageResult
FutureMessageResult sendEventAsync(UMOMessage message, UMOEndpointURI endpoint, int timeout) throws UMOException
message
- the UMOMessage of the eventendpoint
- the endpointUri to dispatch totimeout
- how long to block in milliseconds waiting for a result
UMOException
- if the dispatch fails or the components or
transfromers cannot be foundFutureMessageResult
FutureMessageResult sendEventAsync(UMOMessage message, String endpointName, int timeout) throws UMOException
message
- the UMOMessage of the eventendpointName
- The endpoint name to disptch the event through. This will
be looked up first on the component configuration and then on the
mule manager configurationtimeout
- how long to block in milliseconds waiting for a result
UMOException
- if the dispatch fails or the components or
transfromers cannot be foundFutureMessageResult
void dispatchEvent(UMOMessage message) throws UMOException
message
- the message to send
UMOException
- if there is no outbound endpoint configured on the
component or the events fails during dispatchvoid dispatchEvent(Object payload) throws UMOException
payload
- the message payloadto send
UMOException
- if there is no outbound endpoint configured on the
component or the events fails during dispatchvoid dispatchEvent(UMOMessage message, UMOEndpointURI endpoint) throws UMOException
message
- the event message payload to sendendpoint
- the endpointUri to dispatc the event to first on the component
configuration and then on the mule manager configuration
UMOException
- if the event fails to be processed by the component or
the transport for the endpointvoid dispatchEvent(UMOMessage message, String endpointName) throws UMOException
message
- the event message payload to sendendpointName
- The endpoint name to disptch the event through. This will
be looked up first on the component configuration and then on the
mule manager configuration
UMOException
- if the event fails to be processed by the component or
the transport for the endpointvoid dispatchEvent(UMOMessage message, UMOEndpoint endpoint) throws UMOException
message
- the event message payload to sendendpoint
- The endpoint name to disptch the event through.
UMOException
- if the event fails to be processed by the component or
the transport for the endpointUMOMessage receiveEvent(UMOEndpoint endpoint, long timeout) throws UMOException
endpoint
- the endpoint identifying the endpointUri on which the event
will be receivedtimeout
- time in milliseconds before the request times out
UMOException
- if the request operation failsUMOMessage receiveEvent(String endpointName, long timeout) throws UMOException
endpointName
- the endpoint identifying the endpointUri on which the
event will be receivedtimeout
- time in milliseconds before the request timesout
UMOException
- if the request operation failsUMOMessage receiveEvent(UMOEndpointURI endpoint, long timeout) throws UMOException
endpoint
- the endpointUri on which the event will be receivedtimeout
- time in milliseconds before the request timesout
UMOException
- if the request operation failsUMODescriptor getComponentDescriptor()
boolean isStopFurtherProcessing()
org.mule.umo.lifecycle.Callable
or calling
UMOManager.getEventContext
to obtain the UMOEventContext for
the current thread. The user can programmatically control how events are
dispached.
UMOManager
,
UMOEventContext
,
Callable
void setStopFurtherProcessing(boolean stopFurtherProcessing)
org.mule.umo.lifecycle.Callable
or calling
UMOManager.getEventContext
to obtain the UMOEventContext for
the current thread. The user can programmatically control how events are
dispached.
stopFurtherProcessing
- the value to set.OutputStream getOutputStream()
boolean isSynchronous()
UMOEndpointURI getEndpointURI()
UMOTransaction getTransaction()
int getTimeout()
boolean isStreaming()
String getEncoding()
UMOSession getSession()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |