org.mule.impl
Class RequestContext

java.lang.Object
  extended byorg.mule.impl.RequestContext

public final class RequestContext
extends Object

RequestContext is a thread context where components can get the current event or set response properties that will be sent on the outgoing message.

RequestContext seems to be used to allow thread local mutation of events that are not otherwise available in the scope. so this is a good place to create a new thread local copy - it will be read because supporting code is expecting mutation.


Constructor Summary
protected RequestContext()
          Do not instanciate.
 
Method Summary
static void clear()
          Resets the current request context (clears all information).
protected static void combineProperties(UMOEvent event, UMOMessage message)
           
static UMOEvent getEvent()
           
static UMOEventContext getEventContext()
           
static UMOExceptionPayload getExceptionPayload()
           
protected static UMOMessage internalRewriteEvent(UMOMessage message, boolean safe, boolean required)
           
protected static UMOEvent internalSetEvent(UMOEvent event)
           
protected static UMOMessage internalWriteResponse(UMOMessage message, boolean safe, boolean required)
           
protected static UMOEvent newEvent(UMOEvent event, boolean safe, boolean required)
           
protected static UMOMessage newMessage(UMOMessage message, boolean safe, boolean required)
           
protected static void noteUse(String type)
           
protected static void resetAccessControl(Object object)
           
static UMOMessage rewriteEvent(UMOMessage message)
          Sets a new message payload in the RequestContext but maintains all other properties (session, endpoint, synchronous, etc.) from the previous event.
static UMOEvent setEvent(UMOEvent event)
          Set an event for out-of-scope thread access.
static void setExceptionPayload(UMOExceptionPayload exceptionPayload)
           
static UMOMessage writeResponse(UMOMessage message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestContext

protected RequestContext()
Do not instanciate.

Method Detail

getEventContext

public static UMOEventContext getEventContext()

getEvent

public static UMOEvent getEvent()

setEvent

public static UMOEvent setEvent(UMOEvent event)
Set an event for out-of-scope thread access. Safe: use by default

Parameters:
event - - the event to set
Returns:
A new mutable copy of the event set

internalSetEvent

protected static UMOEvent internalSetEvent(UMOEvent event)

rewriteEvent

public static UMOMessage rewriteEvent(UMOMessage message)
Sets a new message payload in the RequestContext but maintains all other properties (session, endpoint, synchronous, etc.) from the previous event. Safe: use by default

Parameters:
message - - the new message payload
Returns:
A new copy of the message set

internalRewriteEvent

protected static UMOMessage internalRewriteEvent(UMOMessage message,
                                                 boolean safe,
                                                 boolean required)

writeResponse

public static UMOMessage writeResponse(UMOMessage message)

internalWriteResponse

protected static UMOMessage internalWriteResponse(UMOMessage message,
                                                  boolean safe,
                                                  boolean required)

combineProperties

protected static void combineProperties(UMOEvent event,
                                        UMOMessage message)

clear

public static void clear()
Resets the current request context (clears all information).


setExceptionPayload

public static void setExceptionPayload(UMOExceptionPayload exceptionPayload)

getExceptionPayload

public static UMOExceptionPayload getExceptionPayload()

noteUse

protected static void noteUse(String type)

newEvent

protected static UMOEvent newEvent(UMOEvent event,
                                   boolean safe,
                                   boolean required)

newMessage

protected static UMOMessage newMessage(UMOMessage message,
                                       boolean safe,
                                       boolean required)

resetAccessControl

protected static void resetAccessControl(Object object)


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.