|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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(java.lang.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,
java.lang.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 |
boolean |
getBooleanProperty(java.lang.String name,
boolean defaultValue)
Gets a Boolean property associated with the current event. |
UMODescriptor |
getComponentDescriptor()
|
UMOTransaction |
getCurrentTransaction()
Returns the current transaction (if any) for the session |
double |
getDoubleProperty(java.lang.String name,
double defaultValue)
Gets a Double property associated with the current event. |
UMOEndpointURI |
getEndpointURI()
Returns a reference to the Endpoint Uri for this context This is the endpoint on which the event was received |
int |
getIntProperty(java.lang.String name,
int defaultValue)
Gets an Integer property associated with the current event. |
long |
getLongProperty(java.lang.String name,
long defaultValue)
Gets a Long property associated with the current event. |
UMOMessage |
getMessage()
Returns the message payload for this event |
byte[] |
getMessageAsBytes()
Reterns the conents of the message as a byte array. |
java.lang.String |
getMessageAsString()
Returns the message contents as a string |
java.io.OutputStream |
getOutputStream()
An outputstream the can optionally be used write response data to an incoming message. |
java.util.Map |
getProperties()
Returns a map of properties associated with the event |
java.lang.Object |
getProperty(java.lang.String name)
Gets a property associated with the current event. |
java.lang.Object |
getProperty(java.lang.String name,
java.lang.Object defaultValue)
Gets a property associated with the current event. |
UMOTransaction |
getTransaction()
Returns the transaction for the current event or null if there is no transaction in progresss |
java.lang.Object |
getTransformedMessage()
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. |
java.lang.String |
getTransformedMessageAsString()
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 |
isSynchronous()
Determines whether the was sent synchrounously or not |
void |
markTransactionForRollback()
Mark the current transaction (if any) for rollback |
UMOMessage |
receiveEvent(java.lang.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(java.lang.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,
java.lang.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(java.lang.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,
java.lang.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 |
setBooleanProperty(java.lang.String name,
boolean value)
Sets a Boolean property associated with the current event. |
void |
setDoubleProperty(java.lang.String name,
double value)
Sets a Double property associated with the current event. |
void |
setIntProperty(java.lang.String name,
int value)
Sets an Integer property associated with the current event. |
void |
setLongProperty(java.lang.String name,
long value)
Sets a Long property associated with the current event. |
void |
setProperty(java.lang.String name,
java.lang.Object value)
Sets a property associated with the current event. |
void |
setStopFurtherProcessing(boolean stopFurtherProcessing)
Determines whether the default processing for this event will be executed. |
Method Detail |
public UMOMessage getMessage()
public byte[] getMessageAsBytes() throws UMOException
UMOException
- if the message cannot be converted into an array of bytespublic java.lang.Object getTransformedMessage() throws TransformerException
TransformerException
- if a failure occurs in the transformerUMOTransformer
public byte[] getTransformedMessageAsBytes() throws TransformerException
TransformerException
- if a failure occurs in the transformerUMOTransformer
public java.lang.String getTransformedMessageAsString() throws TransformerException
TransformerException
- if a failure occurs in the transformerUMOTransformer
public java.lang.String getMessageAsString() throws UMOException
UMOException
- if the message cannot be converted into a stringpublic UMOTransaction getCurrentTransaction()
public void markTransactionForRollback() throws TransactionException
TransactionException
public UMOMessage sendEvent(java.lang.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 dispatchpublic UMOMessage 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 endpointpublic UMOMessage 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 endpointpublic UMOMessage sendEvent(UMOMessage message, java.lang.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 endpointpublic UMOMessage 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 endpointpublic FutureMessageResult sendEventAsync(java.lang.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
public 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
public 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
public FutureMessageResult sendEventAsync(UMOMessage message, java.lang.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
public 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 dispatchpublic void dispatchEvent(java.lang.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 dispatchpublic void 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 endpointpublic void dispatchEvent(UMOMessage message, java.lang.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 endpointpublic void 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 endpointpublic UMOMessage receiveEvent(UMOEndpoint endpoint, long timeout) throws UMOException
endpoint
- the endpoint identifing the endpointUri on ewhich the event will be receivedtimeout
- time in milliseconds before the request timesout
UMOException
- if the request operation failspublic UMOMessage receiveEvent(java.lang.String endpointName, long timeout) throws UMOException
endpointName
- the endpoint identifing the endpointUri on ewhich the event will be receivedtimeout
- time in milliseconds before the request timesout
UMOException
- if the request operation failspublic UMOMessage 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 failspublic UMODescriptor getComponentDescriptor()
public java.lang.Object getProperty(java.lang.String name)
event.getMessage().getProperty(...)
name
- the property name
public java.lang.Object getProperty(java.lang.String name, java.lang.Object defaultValue)
event.getMessage().getProperty(..., ...)
name
- the property namedefaultValue
- a default value if the property doesn't exist in the event
public int getIntProperty(java.lang.String name, int defaultValue)
event.getMessage().getIntProperty(..., ...)
name
- the property namedefaultValue
- a default value if the property doesn't exist in the event
public long getLongProperty(java.lang.String name, long defaultValue)
event.getMessage().getLongProperty(..., ...)
name
- the property namedefaultValue
- a default value if the property doesn't exist in the event
public double getDoubleProperty(java.lang.String name, double defaultValue)
event.getMessage().getDoubleProperty(..., ...)
name
- the property namedefaultValue
- a default value if the property doesn't exist in the event
public boolean getBooleanProperty(java.lang.String name, boolean defaultValue)
event.getMessage().getbooleanProperty(..., ...)
name
- the property namedefaultValue
- a default value if the property doesn't exist in the event
public void setProperty(java.lang.String name, java.lang.Object value)
event.getMessage().setProperty(..., ...)
name
- the property name or keyvalue
- the property valuepublic void setBooleanProperty(java.lang.String name, boolean value)
event.getMessage().setBooleanProperty(..., ...)
name
- the property name or keyvalue
- the property valuepublic void setIntProperty(java.lang.String name, int value)
event.getMessage().setIntProperty(..., ...)
name
- the property name or keyvalue
- the property valuepublic void setLongProperty(java.lang.String name, long value)
event.getMessage().setLongProperty(..., ...)
name
- the property name or keyvalue
- the property valuepublic void setDoubleProperty(java.lang.String name, double value)
event.getMessage().setDoubleProperty(..., ...)
name
- the property name or keyvalue
- the property valuepublic java.util.Map getProperties()
public 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
public 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.public java.io.OutputStream getOutputStream()
public boolean isSynchronous()
public UMOEndpointURI getEndpointURI()
public UMOTransaction getTransaction()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |