org.mule.impl
Class OptimizedRequestContext

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

public final class OptimizedRequestContext
extends Object

NOT FOR POUBLIC USE - please use the interface provided by RequestContext. This is a temporary interface that helps provide an (optimized) fix for message scribbling.

Mutating methods have three versions: default (RequestContext; makes and returns a new copy); unsafe (doesn't make a copy, use only where certain no threading); critical (as safe, but documents that threading a known issue).


Method Summary
static UMOMessage criticalRewriteEvent(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 criticalSetEvent(UMOEvent event)
          Set an event for out-of-scope thread access.
static UMOMessage criticalWriteResponse(UMOMessage message)
           
static UMOMessage unsafeRewriteEvent(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 unsafeSetEvent(UMOEvent event)
          Set an event for out-of-scope thread access.
static UMOMessage unsafeWriteResponse(UMOMessage message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

unsafeSetEvent

public static UMOEvent unsafeSetEvent(UMOEvent event)
Set an event for out-of-scope thread access. Unsafe: use only when known to be single threaded.

Parameters:
event - - the event to set
Returns:
The event set

criticalSetEvent

public static UMOEvent criticalSetEvent(UMOEvent event)
Set an event for out-of-scope thread access. Critical: thread safety known to be required

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

unsafeRewriteEvent

public static UMOMessage unsafeRewriteEvent(UMOMessage message)
Sets a new message payload in the RequestContext but maintains all other properties (session, endpoint, synchronous, etc.) from the previous event. Unsafe: use only when known to be single threaded

Parameters:
message - - the new message payload
Returns:
The message set

criticalRewriteEvent

public static UMOMessage criticalRewriteEvent(UMOMessage message)
Sets a new message payload in the RequestContext but maintains all other properties (session, endpoint, synchronous, etc.) from the previous event. Critical: thread safety known to be required

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

unsafeWriteResponse

public static UMOMessage unsafeWriteResponse(UMOMessage message)

criticalWriteResponse

public static UMOMessage criticalWriteResponse(UMOMessage message)


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