|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.EventObject
org.mule.DefaultMuleEvent
public class DefaultMuleEvent
DefaultMuleEvent represents any data event occuring in the Mule
environment. All data sent or received within the Mule environment will be passed
between components as an MuleEvent.
| 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
|
protected Log |
logger
logger used by this class |
| Fields inherited from class java.util.EventObject |
|---|
source |
| 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(MuleMessage message,
ImmutableEndpoint endpoint,
MuleSession session,
boolean synchronous)
|
|
DefaultMuleEvent(MuleMessage message,
ImmutableEndpoint endpoint,
MuleSession session,
boolean synchronous,
ResponseOutputStream outputStream)
Contructor. |
|
DefaultMuleEvent(MuleMessage message,
ImmutableEndpoint endpoint,
MuleSession session,
String eventId,
boolean synchronous)
Contructor. |
|
DefaultMuleEvent(MuleMessage message,
ImmutableEndpoint endpoint,
Service service,
MuleEvent previousEvent)
Properties cache that only reads properties once from the inbound message and merges them with any properties on the endpoint. |
|
DefaultMuleEvent(MuleMessage message,
MuleEvent rewriteEvent)
A helper constructor used to rewrite an event payload |
|
| Method Summary | |
|---|---|
void |
assertAccess(boolean write)
This method may be called before data in the object are accessed. |
boolean |
equals(Object o)
|
protected void |
fillProperties(MuleEvent previousEvent)
|
protected String |
generateEventId()
|
Credentials |
getCredentials()
|
String |
getEncoding()
Gets the encoding for this message. |
ImmutableEndpoint |
getEndpoint()
Gets the endpoint associated with this event |
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()
Reterns the conents 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 |
MuleContext |
getMuleContext()
Returns the muleContext for the Mule node that this event was received in |
OutputStream |
getOutputStream()
An outputstream can optionally be used to write response data to an incoming message. |
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. |
Service |
getService()
Gets the recipient service of this event |
MuleSession |
getSession()
Retrieves the service session for the current event |
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 ignorred for the next event. |
boolean |
isStopFurtherProcessing()
Determines whether the default processing for this event will be executed |
boolean |
isSynchronous()
Determines whether the was sent synchrounously or not |
ThreadSafeAccess |
newThreadCopy()
|
void |
resetAccessControl()
This method should ONLY be used in the construction of composite ThreadSafeAccess instances. |
protected void |
setCredentials()
|
void |
setStopFurtherProcessing(boolean stopFurtherProcessing)
Setting this parameter will stop the Mule framework from processing this event in the standard way. |
void |
setSynchronous(boolean value)
Determines whether the was sent synchrounously or not |
void |
setTimeout(int timeout)
The number of milliseconds to wait for a return event when running synchronously. |
String |
toString()
|
Object |
transformMessage()
Transforms the message into it's recognised or expected format. |
Object |
transformMessage(Class outputType)
Transforms the message into the requested format. |
byte[] |
transformMessageToBytes()
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. |
String |
transformMessageToString()
Returns the message transformed into it's recognised or expected format and then into a String. |
| Methods inherited from class java.util.EventObject |
|---|
getSource |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected transient Log logger
protected String[] ignoredPropertyOverrides
| Constructor Detail |
|---|
public DefaultMuleEvent(MuleMessage message,
ImmutableEndpoint endpoint,
Service service,
MuleEvent previousEvent)
public DefaultMuleEvent(MuleMessage message,
ImmutableEndpoint endpoint,
MuleSession session,
boolean synchronous)
public DefaultMuleEvent(MuleMessage message,
ImmutableEndpoint endpoint,
MuleSession session,
boolean synchronous,
ResponseOutputStream outputStream)
message - the event payloadendpoint - the endpoint to associate with the eventsession - the previous event if anyMessageAdapter
public DefaultMuleEvent(MuleMessage message,
ImmutableEndpoint endpoint,
MuleSession session,
String eventId,
boolean synchronous)
message - the event payloadendpoint - the endpoint to associate with the eventsession - the previous event if anyMessageAdapter
public DefaultMuleEvent(MuleMessage message,
MuleEvent rewriteEvent)
message - rewriteEvent - | Method Detail |
|---|
protected void fillProperties(MuleEvent previousEvent)
protected boolean ignoreProperty(String key)
key - protected void setCredentials()
public Credentials getCredentials()
getCredentials in interface MuleEventpublic MuleMessage getMessage()
MuleEvent
getMessage in interface MuleEvent
public byte[] getMessageAsBytes()
throws DefaultMuleException
MuleEvent
getMessageAsBytes in interface MuleEventDefaultMuleException
public Object transformMessage()
throws TransformerException
MuleEvent
transformMessage in interface MuleEventTransformerException - if a failure occurs in the transformerTransformer
public Object transformMessage(Class outputType)
throws TransformerException
MuleEvent
transformMessage in interface MuleEventoutputType - The requested output type.
TransformerException - if a failure occurs in the transformerTransformer
public byte[] transformMessageToBytes()
throws TransformerException
transformMessageToBytes in interface MuleEventTransformerException - if an unsupported encoding is being used or if
the result message is not a String byte[] or Seializable objectTransformer
public String transformMessageToString()
throws TransformerException
transformMessageToString in interface MuleEventTransformerException - if a failure occurs in
the transformerTransformer
public String getMessageAsString()
throws MuleException
MuleEvent
getMessageAsString in interface MuleEventMuleException - if the message cannot be converted into a string
public String getMessageAsString(String encoding)
throws MuleException
getMessageAsString in interface MuleEventencoding - the encoding to use when converting the message to string
MuleException - if the message cannot be converted into a
stringpublic String getId()
MuleEvent
getId in interface MuleEventpublic Object getProperty(String name)
MuleEvent
getProperty in interface MuleEventname - the property name
MuleEvent.getProperty(java.lang.String)
public Object getProperty(String name,
Object defaultValue)
MuleEvent
getProperty in interface MuleEventname - the property namedefaultValue - a default value if the property doesn't exist in the event
public ImmutableEndpoint getEndpoint()
MuleEvent
getEndpoint in interface MuleEventpublic String toString()
toString in class EventObjectprotected String generateEventId()
public MuleSession getSession()
MuleEvent
getSession in interface MuleEventpublic Service getService()
getService in interface MuleEventpublic boolean isStopFurtherProcessing()
isStopFurtherProcessing in interface MuleEventMuleContext,
MuleEventContext,
Callablepublic void setStopFurtherProcessing(boolean stopFurtherProcessing)
setStopFurtherProcessing in interface MuleEventstopFurtherProcessing - The stopFurtherProcessing to set.public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean isSynchronous()
MuleEvent
isSynchronous in interface MuleEventpublic void setSynchronous(boolean value)
MuleEvent
setSynchronous in interface MuleEventvalue - true if the event is synchronouspublic int getTimeout()
MuleEvent
getTimeout in interface MuleEventpublic void setTimeout(int timeout)
MuleEvent
setTimeout in interface MuleEventtimeout - the event timeout in millisecondspublic OutputStream getOutputStream()
getOutputStream in interface MuleEventpublic String getEncoding()
getEncoding in interface MuleEventpublic MuleContext getMuleContext()
MuleEvent
getMuleContext in interface MuleEventpublic ThreadSafeAccess newThreadCopy()
newThreadCopy in interface ThreadSafeAccesspublic void resetAccessControl()
ThreadSafeAccess
resetAccessControl in interface ThreadSafeAccesspublic void assertAccess(boolean write)
ThreadSafeAccess
assertAccess in interface ThreadSafeAccesswrite - True if the access will mutate values.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||