org.mule
Class DefaultMuleEvent

java.lang.Object
  extended by org.mule.DefaultMuleEvent
All Implemented Interfaces:
Serializable, MuleEvent, ThreadSafeAccess, DeserializationPostInitialisable

public class DefaultMuleEvent
extends Object
implements MuleEvent, ThreadSafeAccess, DeserializationPostInitialisable

DefaultMuleEvent represents any data event occurring in the Mule environment. All data sent or received within the Mule environment will be passed between components as an MuleEvent.

The MuleEvent holds some data and provides helper methods for obtaining the data in a format that the receiving Mule component understands. The event can also maintain any number of flowVariables that can be set and retrieved by Mule components.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.mule.api.ThreadSafeAccess
ThreadSafeAccess.AccessControl
 
Nested classes/interfaces inherited from interface org.mule.util.store.DeserializationPostInitialisable
DeserializationPostInitialisable.Implementation
 
Field Summary
protected  String[] ignoredPropertyOverrides
           
 
Fields inherited from interface org.mule.api.MuleEvent
TIMEOUT_DO_NOT_WAIT, TIMEOUT_NOT_SET_VALUE, TIMEOUT_WAIT_FOREVER
 
Fields inherited from interface org.mule.api.ThreadSafeAccess
READ, WRITE
 
Constructor Summary
  DefaultMuleEvent(MuleEvent rewriteEvent, FlowConstruct flowConstruct)
           
  DefaultMuleEvent(MuleMessage message, InboundEndpoint endpoint, FlowConstruct flowConstruct)
           
  DefaultMuleEvent(MuleMessage message, InboundEndpoint endpoint, FlowConstruct flowConstruct, MuleSession session)
           
  DefaultMuleEvent(MuleMessage message, InboundEndpoint endpoint, FlowConstruct flowConstruct, MuleSession session, ReplyToHandler replyToHandler, ResponseOutputStream outputStream)
           
  DefaultMuleEvent(MuleMessage message, InboundEndpoint endpoint, MuleSession session)
          Deprecated. 
  DefaultMuleEvent(MuleMessage message, InboundEndpoint endpoint, MuleSession session, ReplyToHandler replyToHandler, ResponseOutputStream outputStream)
          Deprecated. 
  DefaultMuleEvent(MuleMessage message, MessageExchangePattern exchangePattern, FlowConstruct flowConstruct)
           
  DefaultMuleEvent(MuleMessage message, MessageExchangePattern exchangePattern, FlowConstruct flowConstruct, MuleSession session)
          Constructor used to create a message with no message source with minimal arguments
  DefaultMuleEvent(MuleMessage message, MessageExchangePattern exchangePattern, FlowConstruct flowConstruct, MuleSession session, int timeout, Credentials credentials, ResponseOutputStream outputStream)
          Constructor used to create a message with no message source with all additional arguments
  DefaultMuleEvent(MuleMessage message, MessageExchangePattern exchangePattern, FlowConstruct flowConstruct, MuleSession session, ResponseOutputStream outputStream)
          Constructor used to create a message with no message source with minimal arguments and ResponseOutputStream
  DefaultMuleEvent(MuleMessage message, MessageExchangePattern exchangePattern, MuleSession session)
          Deprecated. 
  DefaultMuleEvent(MuleMessage message, MessageExchangePattern exchangePattern, MuleSession session, int timeout, Credentials credentials, ResponseOutputStream outputStream)
          Deprecated. 
  DefaultMuleEvent(MuleMessage message, MessageExchangePattern exchangePattern, MuleSession session, ResponseOutputStream outputStream)
          Deprecated. 
  DefaultMuleEvent(MuleMessage message, MuleEvent rewriteEvent)
          A helper constructor used to rewrite an event payload
  DefaultMuleEvent(MuleMessage message, MuleEvent rewriteEvent, boolean synchronus)
           
protected DefaultMuleEvent(MuleMessage message, MuleEvent rewriteEvent, FlowConstruct flowConstruct, MuleSession session, boolean synchronous)
           
  DefaultMuleEvent(MuleMessage message, MuleEvent rewriteEvent, MuleSession session)
          A helper constructor used to rewrite an event payload
  DefaultMuleEvent(MuleMessage message, URI messageSourceURI, MessageExchangePattern exchangePattern, FlowConstruct flowConstruct, MuleSession session)
          Constructor used to create a message with a uri that idendifies the message source with minimal arguments
  DefaultMuleEvent(MuleMessage message, URI messageSourceURI, MessageExchangePattern exchangePattern, FlowConstruct flowConstruct, MuleSession session, int timeout, Credentials credentials, ResponseOutputStream outputStream)
          Constructor used to create a message with a identifiable message source with all additional arguments
  DefaultMuleEvent(MuleMessage message, URI messageSourceURI, MessageExchangePattern exchangePattern, FlowConstruct flowConstruct, MuleSession session, ResponseOutputStream outputStream)
          Constructor used to create a message with a uri that idendifies the message source with minimal arguments and ResponseOutputStream
  DefaultMuleEvent(MuleMessage message, URI messageSourceURI, MessageExchangePattern exchangePattern, MuleSession session)
          Deprecated. 
  DefaultMuleEvent(MuleMessage message, URI messageSourceURI, MessageExchangePattern exchangePattern, MuleSession session, int timeout, Credentials credentials, ResponseOutputStream outputStream)
          Deprecated. 
  DefaultMuleEvent(MuleMessage message, URI messageSourceURI, MessageExchangePattern exchangePattern, MuleSession session, ResponseOutputStream outputStream)
          Deprecated. 
  DefaultMuleEvent(MuleMessage message, URI messageSourceURI, String messageSourceName, MessageExchangePattern exchangePattern, FlowConstruct flowConstruct, MuleSession session, int timeout, Credentials credentials, ResponseOutputStream outputStream, String encoding, boolean transacted, boolean synchronous, Object replyToDestination, ReplyToHandler replyToHandler)
           
  DefaultMuleEvent(MuleMessage message, URI messageSourceURI, String messageSourceName, MessageExchangePattern exchangePattern, MuleSession session, int timeout, Credentials credentials, ResponseOutputStream outputStream, String encoding, boolean transacted, boolean synchronous, Object replyToDestination, ReplyToHandler replyToHandler)
          Deprecated. 
 
Method Summary
 void assertAccess(boolean write)
          This method may be called before data in the object are accessed.
 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()
           
static MuleEvent copy(MuleEvent event)
           
 boolean equals(Object o)
           
protected  Credentials extractCredentials(InboundEndpoint endpoint)
           
protected  void fillProperties(InboundEndpoint endpoint)
           
protected  String generateEventId(MuleContext context)
           
 Credentials getCredentials()
           
 String getEncoding()
          Gets the encoding for this message.
 MessageExchangePattern getExchangePattern()
          Returns the message exchange pattern for this event
 FlowConstruct getFlowConstruct()
          Gets the recipient service of this event
<T> T
getFlowVariable(String key)
           
 Set<String> getFlowVariableNames()
           
 String getId()
          Every event in the system is assigned a universally unique id (UUID).
 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 for logging
 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 output stream can optionally be used to write response data to an incoming message.
 ProcessingTime getProcessingTime()
          Returns the times spent processing this event (so far)
 Object getProperty(String name)
          Deprecated. use appropriate scope-aware calls on the MuleMessage (via event.getMessage())
 Object getProperty(String name, Object defaultValue)
          Deprecated. use appropriate scope-aware calls on the MuleMessage (via event.getMessage())
 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.
 int hashCode()
           
protected  boolean ignoreProperty(String key)
          This method is used to determine if a property on the previous event should be ignored for the next event.
 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
 ThreadSafeAccess newThreadCopy()
           
 void removeFlowVariable(String key)
           
 void removeSessionVariable(String key)
           
 void resetAccessControl()
          This method should ONLY be used in the construction of composite ThreadSafeAccess instances.
protected  boolean resolveEventSynchronicity()
           
 void setFlowVariable(String key, Object value)
           
 void setMessage(MuleMessage message)
           
 void setSessionVariable(String key, Object value)
           
 void setStopFurtherProcessing(boolean stopFurtherProcessing)
          Setting this parameter will stop the Mule framework from processing this event in the standard way.
 void setTimeout(int timeout)
          The number of milliseconds to wait for a return event when running synchronously.
 String toString()
           
 Object transformMessage()
          Deprecated. 
<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()
          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.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ignoredPropertyOverrides

protected String[] ignoredPropertyOverrides
Constructor Detail

DefaultMuleEvent

public DefaultMuleEvent(MuleMessage message,
                        MessageExchangePattern exchangePattern,
                        FlowConstruct flowConstruct,
                        MuleSession session)
Constructor used to create a message with no message source with minimal arguments


DefaultMuleEvent

public DefaultMuleEvent(MuleMessage message,
                        MessageExchangePattern exchangePattern,
                        FlowConstruct flowConstruct)

DefaultMuleEvent

public DefaultMuleEvent(MuleMessage message,
                        MessageExchangePattern exchangePattern,
                        FlowConstruct flowConstruct,
                        MuleSession session,
                        ResponseOutputStream outputStream)
Constructor used to create a message with no message source with minimal arguments and ResponseOutputStream


DefaultMuleEvent

public DefaultMuleEvent(MuleMessage message,
                        MessageExchangePattern exchangePattern,
                        FlowConstruct flowConstruct,
                        MuleSession session,
                        int timeout,
                        Credentials credentials,
                        ResponseOutputStream outputStream)
Constructor used to create a message with no message source with all additional arguments


DefaultMuleEvent

public DefaultMuleEvent(MuleMessage message,
                        URI messageSourceURI,
                        MessageExchangePattern exchangePattern,
                        FlowConstruct flowConstruct,
                        MuleSession session)
Constructor used to create a message with a uri that idendifies the message source with minimal arguments


DefaultMuleEvent

public DefaultMuleEvent(MuleMessage message,
                        URI messageSourceURI,
                        MessageExchangePattern exchangePattern,
                        FlowConstruct flowConstruct,
                        MuleSession session,
                        ResponseOutputStream outputStream)
Constructor used to create a message with a uri that idendifies the message source with minimal arguments and ResponseOutputStream


DefaultMuleEvent

public DefaultMuleEvent(MuleMessage message,
                        URI messageSourceURI,
                        MessageExchangePattern exchangePattern,
                        FlowConstruct flowConstruct,
                        MuleSession session,
                        int timeout,
                        Credentials credentials,
                        ResponseOutputStream outputStream)
Constructor used to create a message with a identifiable message source with all additional arguments


DefaultMuleEvent

public DefaultMuleEvent(MuleMessage message,
                        InboundEndpoint endpoint,
                        FlowConstruct flowConstruct,
                        MuleSession session)

DefaultMuleEvent

public DefaultMuleEvent(MuleMessage message,
                        InboundEndpoint endpoint,
                        FlowConstruct flowConstruct)

DefaultMuleEvent

public DefaultMuleEvent(MuleMessage message,
                        InboundEndpoint endpoint,
                        FlowConstruct flowConstruct,
                        MuleSession session,
                        ReplyToHandler replyToHandler,
                        ResponseOutputStream outputStream)

DefaultMuleEvent

public DefaultMuleEvent(MuleMessage message,
                        MuleEvent rewriteEvent)
A helper constructor used to rewrite an event payload

Parameters:
message - The message to use as the current payload of the event
rewriteEvent - the previous event that will be used as a template for this event

DefaultMuleEvent

public DefaultMuleEvent(MuleEvent rewriteEvent,
                        FlowConstruct flowConstruct)

DefaultMuleEvent

public DefaultMuleEvent(MuleMessage message,
                        MuleEvent rewriteEvent,
                        boolean synchronus)

DefaultMuleEvent

public DefaultMuleEvent(MuleMessage message,
                        MuleEvent rewriteEvent,
                        MuleSession session)
A helper constructor used to rewrite an event payload

Parameters:
message - The message to use as the current payload of the event
rewriteEvent - the previous event that will be used as a template for this event

DefaultMuleEvent

protected DefaultMuleEvent(MuleMessage message,
                           MuleEvent rewriteEvent,
                           FlowConstruct flowConstruct,
                           MuleSession session,
                           boolean synchronous)

DefaultMuleEvent

public DefaultMuleEvent(MuleMessage message,
                        URI messageSourceURI,
                        String messageSourceName,
                        MessageExchangePattern exchangePattern,
                        FlowConstruct flowConstruct,
                        MuleSession session,
                        int timeout,
                        Credentials credentials,
                        ResponseOutputStream outputStream,
                        String encoding,
                        boolean transacted,
                        boolean synchronous,
                        Object replyToDestination,
                        ReplyToHandler replyToHandler)

DefaultMuleEvent

@Deprecated
public DefaultMuleEvent(MuleMessage message,
                                   MessageExchangePattern exchangePattern,
                                   MuleSession session)
Deprecated. 

WARNING: Only use this constructor if the instance of MuleSession has a flowConstruct set. This constructor is only here for backwards compatibility.


DefaultMuleEvent

@Deprecated
public DefaultMuleEvent(MuleMessage message,
                                   MessageExchangePattern exchangePattern,
                                   MuleSession session,
                                   ResponseOutputStream outputStream)
Deprecated. 

WARNING: Only use this constructor if the instance of MuleSession has a flowConstruct set. This constructor is only here for backwards compatibility.


DefaultMuleEvent

@Deprecated
public DefaultMuleEvent(MuleMessage message,
                                   MessageExchangePattern exchangePattern,
                                   MuleSession session,
                                   int timeout,
                                   Credentials credentials,
                                   ResponseOutputStream outputStream)
Deprecated. 

WARNING: Only use this constructor if the instance of MuleSession has a flowConstruct set. This constructor is only here for backwards compatibility.


DefaultMuleEvent

@Deprecated
public DefaultMuleEvent(MuleMessage message,
                                   URI messageSourceURI,
                                   MessageExchangePattern exchangePattern,
                                   MuleSession session)
Deprecated. 

WARNING: Only use this constructor if the instance of MuleSession has a flowConstruct set. This constructor is only here for backwards compatibility.


DefaultMuleEvent

@Deprecated
public DefaultMuleEvent(MuleMessage message,
                                   URI messageSourceURI,
                                   MessageExchangePattern exchangePattern,
                                   MuleSession session,
                                   ResponseOutputStream outputStream)
Deprecated. 

WARNING: Only use this constructor if the instance of MuleSession has a flowConstruct set. This constructor is only here for backwards compatibility.


DefaultMuleEvent

@Deprecated
public DefaultMuleEvent(MuleMessage message,
                                   URI messageSourceURI,
                                   MessageExchangePattern exchangePattern,
                                   MuleSession session,
                                   int timeout,
                                   Credentials credentials,
                                   ResponseOutputStream outputStream)
Deprecated. 

WARNING: Only use this constructor if the instance of MuleSession has a flowConstruct set. This constructor is only here for backwards compatibility.


DefaultMuleEvent

@Deprecated
public DefaultMuleEvent(MuleMessage message,
                                   InboundEndpoint endpoint,
                                   MuleSession session)
Deprecated. 

WARNING: Only use this constructor if the instance of MuleSession has a flowConstruct set. This constructor is only here for backwards compatibility.


DefaultMuleEvent

@Deprecated
public DefaultMuleEvent(MuleMessage message,
                                   InboundEndpoint endpoint,
                                   MuleSession session,
                                   ReplyToHandler replyToHandler,
                                   ResponseOutputStream outputStream)
Deprecated. 

WARNING: Only use this constructor if the instance of MuleSession has a flowConstruct set. This constructor is only here for backwards compatibility.


DefaultMuleEvent

@Deprecated
public DefaultMuleEvent(MuleMessage message,
                                   URI messageSourceURI,
                                   String messageSourceName,
                                   MessageExchangePattern exchangePattern,
                                   MuleSession session,
                                   int timeout,
                                   Credentials credentials,
                                   ResponseOutputStream outputStream,
                                   String encoding,
                                   boolean transacted,
                                   boolean synchronous,
                                   Object replyToDestination,
                                   ReplyToHandler replyToHandler)
Deprecated. 

WARNING: Only use this constructor if the instance of MuleSession has a flowConstruct set. This constructor is only here for backwards compatibility.

Method Detail

resolveEventSynchronicity

protected boolean resolveEventSynchronicity()

fillProperties

protected void fillProperties(InboundEndpoint endpoint)

ignoreProperty

protected boolean ignoreProperty(String key)
This method is used to determine if a property on the previous event should be ignored for the next event. This method is here because we don't have proper scoped handling of meta data yet The rules are
  1. If a property is already set on the current event don't overwrite with the previous event value
  2. If the property name appears in the ignoredPropertyOverrides list, then we always set it on the new event

Parameters:
key - The name of the property to ignore
Returns:
true if the property should be ignored, false otherwise

extractCredentials

protected Credentials extractCredentials(InboundEndpoint endpoint)

getCredentials

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

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

getMessageAsBytes

public byte[] getMessageAsBytes()
                         throws DefaultMuleException
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:
DefaultMuleException

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

@Deprecated
public byte[] transformMessageToBytes()
                               throws TransformerException
Deprecated. use transformMessage(org.mule.api.transformer.DataType) instead

This method will attempt to convert the transformed message into an array of bytes It will first check if the result of the transformation is a byte array and return that. Otherwise if the the result is a string it will serialized the CONTENTS of the string not the String object. finally it will check if the result is a Serializable object and convert that to an array of bytes.

Specified by:
transformMessageToBytes in interface MuleEvent
Returns:
a byte[] representation of the message
Throws:
TransformerException - if an unsupported encoding is being used or if the result message is not a String byte[] or Seializable object
See Also:
Transformer

transformMessageToString

public String transformMessageToString()
                                throws TransformerException
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.

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
Returns the message contents for logging

Specified by:
getMessageAsString in interface MuleEvent
Parameters:
encoding - the encoding to use when converting bytes to a string, if necessary
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

@Deprecated
public Object getProperty(String name)
Deprecated. use appropriate scope-aware calls on the MuleMessage (via event.getMessage())

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
See Also:
getMessage()

getProperty

@Deprecated
public Object getProperty(String name,
                                     Object defaultValue)
Deprecated. use appropriate scope-aware calls on the MuleMessage (via event.getMessage())

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
See Also:
getMessage()

toString

public String toString()
Overrides:
toString in class Object

generateEventId

protected String generateEventId(MuleContext context)

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()
Gets the recipient service of this event

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

isStopFurtherProcessing

public boolean isStopFurtherProcessing()
Determines whether the default processing for this event will be executed

Specified by:
isStopFurtherProcessing in interface MuleEvent
Returns:
Returns the stopFurtherProcessing.
See Also:
MuleContext, MuleEventContext, Callable

setStopFurtherProcessing

public void setStopFurtherProcessing(boolean stopFurtherProcessing)
Setting this parameter will stop the Mule framework from processing this event in the standard way. This allow for client code to override default behaviour. The common reasons for doing this are - 1. The service has more than one send endpoint configured; the service must dispatch to other prviders programmatically by using the service on the current event 2. The service doesn't send the current event out through a endpoint. i.e. the processing of the event stops in the uMO.

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

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

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()
An output stream can optionally be used to 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()
Gets the encoding for this message. First it looks to see if encoding has been set on the endpoint, if not it will check the message itself and finally it will fall back to the Mule global configuration for encoding which cannot be null.

Specified by:
getEncoding in interface MuleEvent
Returns:
the encoding for the event

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

newThreadCopy

public ThreadSafeAccess newThreadCopy()
Specified by:
newThreadCopy in interface ThreadSafeAccess
Returns:
A new instance of the implementing class, unbound to any thread and mutable.

resetAccessControl

public void resetAccessControl()
Description copied from interface: ThreadSafeAccess
This method should ONLY be used in the construction of composite ThreadSafeAccess instances. For example, a ThreadSafeAccess MuleEvent contains a ThreadSafeAccess MuleMessage. During the construction of the event, the message may be bound to the contructing thread. Calling this method releases that binding so that the event as a whole can be passed to a new thread unbound.

Specified by:
resetAccessControl in interface ThreadSafeAccess

assertAccess

public void assertAccess(boolean write)
Description copied from interface: ThreadSafeAccess
This method may be called before data in the object are accessed. It should verify that the access policy is followed correctly (if not, a runtime exception may be thrown).

Specified by:
assertAccess in interface ThreadSafeAccess
Parameters:
write - True if the access will mutate values.

transformMessage

@Deprecated
public Object transformMessage()
                        throws TransformerException
Deprecated. 

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

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

copy

public static MuleEvent copy(MuleEvent event)

getFlowVariableNames

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

clearFlowVariables

public void clearFlowVariables()
Specified by:
clearFlowVariables 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

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


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