org.mule
Class VoidMuleEvent

java.lang.Object
  extended by org.mule.VoidMuleEvent
All Implemented Interfaces:
Serializable, MuleEvent

public class VoidMuleEvent
extends Object
implements MuleEvent

A VoidMuleEvent represents a void return from a MessageProcessor such as a ONE_WAY OutboundEndpoint.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.mule.api.MuleEvent
TIMEOUT_DO_NOT_WAIT, TIMEOUT_NOT_SET_VALUE, TIMEOUT_WAIT_FOREVER
 
Method Summary
 void captureReplyToDestination()
          Set the reply-to destination from the current message, and remove it from the message, to prevent any further propagation.
 void clearFlowVariables()
           
 void clearSessionVariables()
           
 Credentials getCredentials()
           
 String getEncoding()
          Gets the encoding for this message.
 MessageExchangePattern getExchangePattern()
          Returns the message exchange pattern for this event
 FlowConstruct getFlowConstruct()
          Retrieves the service for the current event
<T> T
getFlowVariable(String key)
           
 Set<String> getFlowVariableNames()
           
 String getId()
          Every event in the system is assigned a universally unique id (UUID).
static VoidMuleEvent getInstance()
           
 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 If necessary this will use the encoding set on the event
 String getMessageAsString(String encoding)
          Returns the message contents as a string
 String getMessageSourceName()
          Returns the message source name if it has one, otherwise returns toString() of the URI returned be getMessageSourceURI()
 URI getMessageSourceURI()
          Returns the URI of the MessageSource that recieved or generated the message being processed.
 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.
 ProcessingTime getProcessingTime()
          Returns the times spent processing this event (so far)
 Object getProperty(String name)
          Gets a property associated with the current event.
 Object getProperty(String name, Object defaultValue)
          Gets a property associated with the current event.
 Object getReplyToDestination()
          Return the destination (if any) that will be passed to the reply-to handler.
 ReplyToHandler getReplyToHandler()
          Return the replyToHandler (if any) that will be used to perform async reply
 MuleSession getSession()
          Retrieves the service session for the current event
<T> T
getSessionVariable(String key)
           
 Set<String> getSessionVariableNames()
           
 int getTimeout()
          The number of milliseconds to wait for a return event when running synchronously.
 boolean isNotificationsEnabled()
          Indicates if notifications should be fired when processing this message.
 boolean isStopFurtherProcessing()
          Determines whether the default processing for this event will be executed.
 boolean isSynchronous()
           
 boolean isTransacted()
          Returns true is this event is being processed in a transaction
 void removeFlowVariable(String key)
           
 void removeSessionVariable(String key)
           
 void setEnableNotifications(boolean enabled)
          Enables the firing of notifications when processing the message.
 void setFlowVariable(String key, Object value)
           
 void setMessage(MuleMessage message)
           
 void setSessionVariable(String key, Object value)
           
 void setStopFurtherProcessing(boolean stopFurtherProcessing)
          Determines whether the default processing for this event will be executed.
 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.
<T> T
transformMessage(Class<T> outputType)
          Transforms the message into the requested format.
<T> T
transformMessage(DataType<T> 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static VoidMuleEvent getInstance()

getMessage

public MuleMessage getMessage()
Description copied from interface: MuleEvent
Returns the message payload for this event

Specified by:
getMessage in interface MuleEvent
Returns:
the message payload for this event

getCredentials

public Credentials getCredentials()
Specified by:
getCredentials in interface MuleEvent

getMessageAsBytes

public byte[] getMessageAsBytes()
                         throws MuleException
Description copied from interface: MuleEvent
Returns the contents of the message as a byte array.

Specified by:
getMessageAsBytes in interface MuleEvent
Returns:
the contents of the message as a byte array
Throws:
MuleException - if the message cannot be converted into an array of bytes

transformMessage

public Object transformMessage()
                        throws TransformerException
Description copied from interface: MuleEvent
Transforms the message into it's recognised or expected format. The transformer used is the one configured on the endpoint through which this event was received.

Specified by:
transformMessage in interface MuleEvent
Returns:
the message transformed into it's recognised or expected format.
Throws:
TransformerException - if a failure occurs in the transformer
See Also:
Transformer

transformMessage

public <T> T transformMessage(Class<T> outputType)
                   throws TransformerException
Description copied from interface: MuleEvent
Transforms the message into the requested format. The transformer used is the one configured on the endpoint through which this event was received.

Specified by:
transformMessage in interface MuleEvent
Parameters:
outputType - The requested output type.
Returns:
the message transformed into it's recognised or expected format.
Throws:
TransformerException - if a failure occurs in the transformer
See Also:
if the transform fails or the outputtype is null

transformMessage

public <T> T transformMessage(DataType<T> outputType)
                   throws TransformerException
Description copied from interface: MuleEvent
Transforms the message into the requested format. The transformer used is the one configured on the endpoint through which this event was received.

Specified by:
transformMessage in interface MuleEvent
Parameters:
outputType - The requested output type.
Returns:
the message transformed into it's recognised or expected format.
Throws:
TransformerException - if a failure occurs in the transformer
See Also:
if the transform fails or the outputtype is null

transformMessageToBytes

public byte[] transformMessageToBytes()
                               throws TransformerException
Description copied from interface: MuleEvent
Transforms the message into it's recognised or expected format and then into an array of bytes. The transformer used is the one configured on the endpoint through which this event was received.

Specified by:
transformMessageToBytes in interface MuleEvent
Returns:
the message transformed into it's recognised or expected format as an array of bytes.
Throws:
TransformerException - if a failure occurs in the transformer
See Also:
Transformer

transformMessageToString

public String transformMessageToString()
                                throws TransformerException
Description copied from interface: MuleEvent
Returns the message transformed into it's recognised or expected format and then into a String. The transformer used is the one configured on the endpoint through which this event was received. If necessary this will use the encoding set on the event

Specified by:
transformMessageToString in interface MuleEvent
Returns:
the message transformed into it's recognised or expected format as a Strings.
Throws:
TransformerException - if a failure occurs in the transformer
See Also:
Transformer

getMessageAsString

public String getMessageAsString()
                          throws MuleException
Description copied from interface: MuleEvent
Returns the message contents as a string If necessary this will use the encoding set on the event

Specified by:
getMessageAsString in interface MuleEvent
Returns:
the message contents as a string
Throws:
MuleException - if the message cannot be converted into a string

getMessageAsString

public String getMessageAsString(String encoding)
                          throws MuleException
Description copied from interface: MuleEvent
Returns the message contents as a string

Specified by:
getMessageAsString in interface MuleEvent
Parameters:
encoding - the encoding to use when converting the message to string
Returns:
the message contents as a string
Throws:
MuleException - if the message cannot be converted into a string

getId

public String getId()
Description copied from interface: MuleEvent
Every event in the system is assigned a universally unique id (UUID).

Specified by:
getId in interface MuleEvent
Returns:
the unique identifier for the event

getProperty

public Object getProperty(String name)
Description copied from interface: MuleEvent
Gets a property associated with the current event. This method will check all property scopes on the currnet message and the current session

Specified by:
getProperty in interface MuleEvent
Parameters:
name - the property name
Returns:
the property value or null if the property does not exist

getProperty

public Object getProperty(String name,
                          Object defaultValue)
Description copied from interface: MuleEvent
Gets a property associated with the current event. This method will check all property scopes on the currnet message and the current session

Specified by:
getProperty in interface MuleEvent
Parameters:
name - the property name
defaultValue - a default value if the property doesn't exist in the event
Returns:
the property value or the defaultValue if the property does not exist

getSession

public MuleSession getSession()
Description copied from interface: MuleEvent
Retrieves the service session for the current event

Specified by:
getSession in interface MuleEvent
Returns:
the service session for the event

getFlowConstruct

public FlowConstruct getFlowConstruct()
Description copied from interface: MuleEvent
Retrieves the service for the current event

Specified by:
getFlowConstruct in interface MuleEvent
Returns:
the service for the event

isStopFurtherProcessing

public boolean isStopFurtherProcessing()
Description copied from interface: MuleEvent
Determines whether the default processing for this event will be executed. By default, the Mule server will route events according to a components configuration. The user can override this behaviour by obtaining a reference to the MuleEvent context, either by implementing 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.

Specified by:
isStopFurtherProcessing in interface MuleEvent
Returns:
Returns true is the user has set stopFurtherProcessing.
See Also:
MuleContext, MuleEventContext, Callable

setStopFurtherProcessing

public void setStopFurtherProcessing(boolean stopFurtherProcessing)
Description copied from interface: MuleEvent
Determines whether the default processing for this event will be executed. By default, the Mule server will route events according to a components configuration. The user can override this behaviour by obtaining a reference to the MuleEvent context, either by implementing 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.

Specified by:
setStopFurtherProcessing in interface MuleEvent
Parameters:
stopFurtherProcessing - the value to set.

getTimeout

public int getTimeout()
Description copied from interface: MuleEvent
The number of milliseconds to wait for a return event when running synchronously. 0 wait forever -1 try and receive, but do not wait or a positive millisecond value

Specified by:
getTimeout in interface MuleEvent
Returns:
the event timeout in milliseconds

setTimeout

public void setTimeout(int timeout)
Description copied from interface: MuleEvent
The number of milliseconds to wait for a return event when running synchronously. 0 wait forever -1 try and receive, but do not wait or a positive millisecod value

Specified by:
setTimeout in interface MuleEvent
Parameters:
timeout - the event timeout in milliseconds

getOutputStream

public OutputStream getOutputStream()
Description copied from interface: MuleEvent
An outputstream the can optionally be used write response data to an incoming message.

Specified by:
getOutputStream in interface MuleEvent
Returns:
an output strem if one has been made available by the message receiver that received the message

getEncoding

public String getEncoding()
Description copied from interface: MuleEvent
Gets the encoding for this message.

Specified by:
getEncoding in interface MuleEvent
Returns:
the encoding for the event. This must never return null.

getMuleContext

public MuleContext getMuleContext()
Description copied from interface: MuleEvent
Returns the muleContext for the Mule node that this event was received in

Specified by:
getMuleContext in interface MuleEvent
Returns:
the muleContext for the Mule node that this event was received in

getProcessingTime

public ProcessingTime getProcessingTime()
Description copied from interface: MuleEvent
Returns the times spent processing this event (so far)

Specified by:
getProcessingTime in interface MuleEvent

getExchangePattern

public MessageExchangePattern getExchangePattern()
Description copied from interface: MuleEvent
Returns the message exchange pattern for this event

Specified by:
getExchangePattern in interface MuleEvent

isTransacted

public boolean isTransacted()
Description copied from interface: MuleEvent
Returns true is this event is being processed in a transaction

Specified by:
isTransacted in interface MuleEvent

getMessageSourceURI

public URI getMessageSourceURI()
Description copied from interface: MuleEvent
Returns the URI of the MessageSource that recieved or generated the message being processed.

Specified by:
getMessageSourceURI in interface MuleEvent

getMessageSourceName

public String getMessageSourceName()
Description copied from interface: MuleEvent
Returns the message source name if it has one, otherwise returns toString() of the URI returned be getMessageSourceURI()

Specified by:
getMessageSourceName in interface MuleEvent

getReplyToHandler

public ReplyToHandler getReplyToHandler()
Description copied from interface: MuleEvent
Return the replyToHandler (if any) that will be used to perform async reply

Specified by:
getReplyToHandler in interface MuleEvent

getReplyToDestination

public Object getReplyToDestination()
Description copied from interface: MuleEvent
Return the destination (if any) that will be passed to the reply-to handler.

Specified by:
getReplyToDestination in interface MuleEvent

captureReplyToDestination

public void captureReplyToDestination()
Description copied from interface: MuleEvent
Set the reply-to destination from the current message, and remove it from the message, to prevent any further propagation.

Specified by:
captureReplyToDestination in interface MuleEvent

isSynchronous

public boolean isSynchronous()
Specified by:
isSynchronous in interface MuleEvent

setMessage

public void setMessage(MuleMessage message)
Specified by:
setMessage in interface MuleEvent

getFlowVariable

public <T> T getFlowVariable(String key)
Specified by:
getFlowVariable in interface MuleEvent

setFlowVariable

public void setFlowVariable(String key,
                            Object value)
Specified by:
setFlowVariable in interface MuleEvent

removeFlowVariable

public void removeFlowVariable(String key)
Specified by:
removeFlowVariable in interface MuleEvent

getFlowVariableNames

public Set<String> getFlowVariableNames()
Specified by:
getFlowVariableNames in interface MuleEvent

clearFlowVariables

public void clearFlowVariables()
Specified by:
clearFlowVariables in interface MuleEvent

getSessionVariable

public <T> T getSessionVariable(String key)
Specified by:
getSessionVariable in interface MuleEvent

setSessionVariable

public void setSessionVariable(String key,
                               Object value)
Specified by:
setSessionVariable in interface MuleEvent

removeSessionVariable

public void removeSessionVariable(String key)
Specified by:
removeSessionVariable in interface MuleEvent

getSessionVariableNames

public Set<String> getSessionVariableNames()
Specified by:
getSessionVariableNames in interface MuleEvent

clearSessionVariables

public void clearSessionVariables()
Specified by:
clearSessionVariables in interface MuleEvent

isNotificationsEnabled

public boolean isNotificationsEnabled()
Description copied from interface: MuleEvent
Indicates if notifications should be fired when processing this message.

Specified by:
isNotificationsEnabled in interface MuleEvent
Returns:
true if notifications are enabled, false otherwise

setEnableNotifications

public void setEnableNotifications(boolean enabled)
Description copied from interface: MuleEvent
Enables the firing of notifications when processing the message.

Specified by:
setEnableNotifications in interface MuleEvent


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.