org.apache.synapse.mediators
Class AbstractMediator

java.lang.Object
  extended by org.apache.synapse.mediators.AbstractMediator
All Implemented Interfaces:
Mediator
Direct Known Subclasses:
AbstractListMediator, AttachmentMediator, ClassMediator, DropMediator, FaultMediator, HeaderMediator, LogMediator, PropertyMediator, RMSequenceMediator, ScriptMediator, SendMediator, SpringMediator, SwitchMediator, ThrottleMediator, XSLTMediator

public abstract class AbstractMediator
extends java.lang.Object
implements Mediator

This class is an abstract Mediator, that defines the logging and debugging elements of a mediator class.


Field Summary
protected  int parentTraceState
          The parent tracing state
protected  int traceState
          State of tracing for the current mediator
 
Constructor Summary
AbstractMediator()
           
 
Method Summary
 int getTraceState()
          Returns the tracing state
 java.lang.String getType()
          Returns the class name of the mediator
 void restoreTracingState(MessageContext synCtx)
          This method is used to restore parent tracing state back
 void saveAndSetTraceState(MessageContext synCtx)
          This method is used to save previous tracing state and set next the tracing state for a child mediator
 void setTraceState(int traceState)
          Set the tracing state variable
 boolean shouldTrace(int parentTraceState)
          Should this mediator perform tracing? True if its explicitly asked to trace, or its parent has been asked to trace and it does not reject it
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.synapse.Mediator
mediate
 

Field Detail

parentTraceState

protected int parentTraceState
The parent tracing state


traceState

protected int traceState
State of tracing for the current mediator

Constructor Detail

AbstractMediator

public AbstractMediator()
Method Detail

getType

public java.lang.String getType()
Returns the class name of the mediator

Specified by:
getType in interface Mediator
Returns:
the class name of the mediator

getTraceState

public int getTraceState()
Returns the tracing state

Specified by:
getTraceState in interface Mediator
Returns:
int

setTraceState

public void setTraceState(int traceState)
Set the tracing state variable

Specified by:
setTraceState in interface Mediator
Parameters:
traceState -

saveAndSetTraceState

public void saveAndSetTraceState(MessageContext synCtx)
This method is used to save previous tracing state and set next the tracing state for a child mediator

Parameters:
synCtx - current message

restoreTracingState

public void restoreTracingState(MessageContext synCtx)
This method is used to restore parent tracing state back

Parameters:
synCtx - the current message

shouldTrace

public boolean shouldTrace(int parentTraceState)
Should this mediator perform tracing? True if its explicitly asked to trace, or its parent has been asked to trace and it does not reject it

Parameters:
parentTraceState - parents trace state
Returns:
true if tracing should be performed


Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.