org.mule
Class OptimizedRequestContext

java.lang.Object
  extended by org.mule.OptimizedRequestContext

public final class OptimizedRequestContext
extends Object

NOT FOR PUBLIC 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; safe, makes and returns a new copy - although this can be changed via RequestContext.DEFAULT_ACTION); unsafe (doesn't make a copy, use only where certain no threading); critical (safe, documents that threading a known issue).


Method Summary
static MuleEvent criticalSetEvent(MuleEvent event)
          Set an event for out-of-scope thread access.
static MuleMessage unsafeRewriteEvent(MuleMessage message)
          Sets a new message payload in the RequestContext but maintains all other properties (session, endpoint, synchronous, etc.) from the previous event.
static MuleEvent unsafeSetEvent(MuleEvent event)
          Set an event for out-of-scope thread access.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

unsafeSetEvent

public static MuleEvent unsafeSetEvent(MuleEvent 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 MuleEvent criticalSetEvent(MuleEvent 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 MuleMessage unsafeRewriteEvent(MuleMessage 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


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