|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.impl.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.
Field Summary | |
protected static Log |
logger
logger used by this class |
Method Summary | |
void |
dispatchEvent(java.lang.Object message)
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 endpointUri)
Depending on the session state this methods either Passes an event asynchronously to the next available Mule UMO in the pool or via the endpointUri 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 endpointUri,
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 endpointUri)
Depending on the session state this methods either Passes an event synchronously to the next available Mule UMO in the pool or via the endpointUri 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 endpointUri,
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static transient Log logger
Method Detail |
public UMOMessage getMessage()
getMessage
in interface UMOEventContext
public byte[] getMessageAsBytes() throws UMOException
getMessageAsBytes
in interface UMOEventContext
UMOException
- if the message cannot be converted into an array of bytespublic java.lang.Object getTransformedMessage() throws TransformerException
getTransformedMessage
in interface UMOEventContext
TransformerException
- if a failure occurs in the transformerUMOTransformer
public byte[] getTransformedMessageAsBytes() throws TransformerException
getTransformedMessageAsBytes
in interface UMOEventContext
TransformerException
- if a failure occurs in the transformerUMOTransformer
public java.lang.String getTransformedMessageAsString() throws TransformerException
getTransformedMessageAsString
in interface UMOEventContext
TransformerException
- if a failure occurs in the transformerUMOTransformer
public java.lang.String getMessageAsString() throws UMOException
getMessageAsString
in interface UMOEventContext
UMOException
- if the message cannot be converted into a stringpublic UMOTransaction getCurrentTransaction()
getCurrentTransaction
in interface UMOEventContext
public void markTransactionForRollback() throws TransactionException
UMOEventContext
markTransactionForRollback
in interface UMOEventContext
TransactionException
public UMOMessage sendEvent(java.lang.Object message) throws UMOException
sendEvent
in interface UMOEventContext
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, UMOEndpoint endpoint) throws UMOException
sendEvent
in interface UMOEventContext
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 UMOMessage sendEvent(UMOMessage message) throws UMOException
sendEvent
in interface UMOEventContext
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 endpointUri) throws UMOException
sendEvent
in interface UMOEventContext
message
- the event message payload to sendendpointUri
- The endpointUri to disptch the event through
UMOException
- if the event fails to be processed by the component or
the transport for the endpointUripublic FutureMessageResult sendEventAsync(java.lang.Object message, int timeout) throws UMOException
sendEventAsync
in interface UMOEventContext
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
sendEventAsync
in interface UMOEventContext
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 endpointUri, int timeout) throws UMOException
sendEventAsync
in interface UMOEventContext
message
- the UMOMessage of the eventendpointUri
- 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
sendEventAsync
in interface UMOEventContext
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 UMOMessage sendEvent(UMOMessage message, java.lang.String endpointName) throws UMOException
sendEvent
in interface UMOEventContext
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(java.lang.Object message) throws UMOException
dispatchEvent
in interface UMOEventContext
message
- payload to dispatch
UMOException
- if there is no outbound endpoint configured on the
component or the events fails during dispatchpublic void dispatchEvent(UMOMessage message) throws UMOException
dispatchEvent
in interface UMOEventContext
message
- the message to send
UMOException
- if there is no outbound endpoint configured on the
component or the events fails during dispatchpublic void dispatchEvent(UMOMessage message, UMOEndpointURI endpointUri) throws UMOException
dispatchEvent
in interface UMOEventContext
message
- the event message payload to sendendpointUri
- 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 endpointUripublic void dispatchEvent(UMOMessage message, java.lang.String endpointName) throws UMOException
dispatchEvent
in interface UMOEventContext
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
dispatchEvent
in interface UMOEventContext
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
receiveEvent
in interface UMOEventContext
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
receiveEvent
in interface UMOEventContext
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 endpointUri, long timeout) throws UMOException
receiveEvent
in interface UMOEventContext
endpointUri
- the endpointUri on which the event will be receivedtimeout
- time in milliseconds before the request timesout
UMOException
- if the request operation failspublic UMODescriptor getComponentDescriptor()
getComponentDescriptor
in interface UMOEventContext
public java.lang.Object getProperty(java.lang.String name)
event.getMessage().getProperty(...)
getProperty
in interface UMOEventContext
name
- the property name
public java.lang.Object getProperty(java.lang.String name, java.lang.Object defaultValue)
event.getMessage().getProperty(..., ...)
getProperty
in interface UMOEventContext
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(..., ...)
getIntProperty
in interface UMOEventContext
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(..., ...)
getLongProperty
in interface UMOEventContext
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(..., ...)
getDoubleProperty
in interface UMOEventContext
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(..., ...)
getBooleanProperty
in interface UMOEventContext
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(..., ...)
setProperty
in interface UMOEventContext
name
- the property name or keyvalue
- the property valuepublic void setBooleanProperty(java.lang.String name, boolean value)
event.getMessage().setBooleanProperty(..., ...)
setBooleanProperty
in interface UMOEventContext
name
- the property name or keyvalue
- the property valuepublic void setIntProperty(java.lang.String name, int value)
event.getMessage().setIntProperty(..., ...)
setIntProperty
in interface UMOEventContext
name
- the property name or keyvalue
- the property valuepublic void setLongProperty(java.lang.String name, long value)
event.getMessage().setLongProperty(..., ...)
setLongProperty
in interface UMOEventContext
name
- the property name or keyvalue
- the property valuepublic void setDoubleProperty(java.lang.String name, double value)
event.getMessage().setDoubleProperty(..., ...)
setDoubleProperty
in interface UMOEventContext
name
- the property name or keyvalue
- the property valuepublic java.util.Map getProperties()
getProperties
in interface UMOEventContext
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.
isStopFurtherProcessing
in interface UMOEventContext
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.
setStopFurtherProcessing
in interface UMOEventContext
stopFurtherProcessing
- the value to set.public java.io.OutputStream getOutputStream()
getOutputStream
in interface UMOEventContext
public boolean isSynchronous()
isSynchronous
in interface UMOEventContext
public UMOEndpointURI getEndpointURI()
UMOEventContext
getEndpointURI
in interface UMOEventContext
public UMOTransaction getTransaction()
getTransaction
in interface UMOEventContext
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |