|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.synapse.mediators.AbstractMediator
public abstract class AbstractMediator
This is the superclass of all mediators, and defines common logging, tracing other aspects for all mediators who extend from this. elements of a mediator class.
| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
log
the standard log for mediators, will assign the logger for the actual subclass |
protected static org.apache.commons.logging.Log |
trace
The runtime trace log for mediators |
protected int |
traceState
State of tracing for this mediator |
| Constructor Summary | |
|---|---|
protected |
AbstractMediator()
A constructor that makes subclasses pick up the correct logger |
| Method Summary | |
|---|---|
protected void |
auditLog(String msg,
MessageContext msgContext)
Perform an audit log message to all logs @ INFO. |
protected void |
auditWarn(String msg,
MessageContext msgContext)
Write an audit entry at WARN and trace and standard logs @WARN |
int |
getTraceState()
Returns the tracing state |
String |
getType()
Returns the class name of the mediator |
protected void |
handleException(String msg,
Exception e,
MessageContext msgContext)
Perform an error log message to all logs @ ERROR. |
protected void |
handleException(String msg,
MessageContext msgContext)
Perform an error log message to all logs @ ERROR. |
protected boolean |
isTraceOn(MessageContext msgCtx)
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 |
protected boolean |
isTraceOrDebugOn(boolean isTraceOn)
Is tracing or debug logging on? |
void |
setEffectiveTraceState(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 |
protected void |
traceOrDebug(boolean traceOn,
String msg)
Perform Trace and Debug logging of a message @INFO (trace) and DEBUG (log) |
protected void |
traceOrDebugWarn(boolean traceOn,
String msg)
Perform Trace and Debug logging of a message @WARN |
| 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 |
|---|
protected org.apache.commons.logging.Log log
protected static final org.apache.commons.logging.Log trace
protected int traceState
| Constructor Detail |
|---|
protected AbstractMediator()
| Method Detail |
|---|
public String getType()
getType in interface Mediatorpublic int getTraceState()
getTraceState in interface Mediatorpublic void setTraceState(int traceState)
setTraceState in interface MediatortraceState - the new tracing state for this mediator (see SynapseConstants)public void setEffectiveTraceState(MessageContext synCtx)
synCtx - current messagepublic boolean shouldTrace(int parentTraceState)
parentTraceState - parents trace state
protected boolean isTraceOn(MessageContext msgCtx)
msgCtx - the current message
protected boolean isTraceOrDebugOn(boolean isTraceOn)
isTraceOn - is tracing known to be on?
protected void traceOrDebug(boolean traceOn,
String msg)
traceOn - is runtime trace on for this message?msg - the message to log/trace
protected void traceOrDebugWarn(boolean traceOn,
String msg)
traceOn - is runtime trace on for this message?msg - the message to log/trace
protected void auditLog(String msg,
MessageContext msgContext)
msg - the log messagemsgContext - the message context
protected void handleException(String msg,
MessageContext msgContext)
msg - the log messagemsgContext - the message context
protected void auditWarn(String msg,
MessageContext msgContext)
msg - the message to logmsgContext - message context
protected void handleException(String msg,
Exception e,
MessageContext msgContext)
msg - the log messagee - an Exception encounteredmsgContext - the message context
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||