|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.synapse.mediators.AbstractMediator
org.apache.synapse.mediators.filters.SwitchMediator
public class SwitchMediator
The switch mediator implements the functionality of the "switch" construct. It first evaluates the given XPath expression into a String value, and performs a match against the given list of cases. This is actually a list of sequences, and depending on the selected case, the selected sequence gets executed.
| Field Summary |
|---|
| Fields inherited from class org.apache.synapse.mediators.AbstractMediator |
|---|
log, trace, traceState |
| Constructor Summary | |
|---|---|
SwitchMediator()
|
|
| Method Summary | |
|---|---|
void |
addCase(SwitchCase m)
Adds the given mediator (Should be a SwitchCaseMediator) to the list of cases of this Switch mediator |
void |
destroy()
This method should implement the destroying of the implemented parts of the configuration. |
List<SwitchCase> |
getCases()
Get the list of cases |
SwitchCase |
getDefaultCase()
Get default case |
SynapseXPath |
getSource()
Return the source XPath expression set |
void |
init(SynapseEnvironment se)
This method should implement the initialization of the implemented parts of the configuration. |
boolean |
mediate(MessageContext synCtx)
Iterate over switch cases and find match and execute selected sequence |
void |
setDefaultCase(SwitchCase defaultCase)
setting the default case ...which contains mediators to invoke when no case condition satisfy |
void |
setSource(SynapseXPath source)
Sets the source XPath expression |
| Methods inherited from class org.apache.synapse.mediators.AbstractMediator |
|---|
auditLog, auditWarn, configure, disableStatistics, enableStatistics, getAspectConfiguration, getDescription, getLog, getTraceState, getType, handleException, handleException, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, setDescription, setEffectiveTraceState, setTraceState, shouldTrace, traceOrDebug, traceOrDebugWarn |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SwitchMediator()
| Method Detail |
|---|
public void init(SynapseEnvironment se)
ManagedLifecycle
init in interface ManagedLifecyclese - SynapseEnvironment to be used for initializationpublic void destroy()
ManagedLifecycle
destroy in interface ManagedLifecyclepublic boolean mediate(MessageContext synCtx)
mediate in interface MediatorsynCtx - current context
public void addCase(SwitchCase m)
m - the SwitchCaseMediator instance to be addedpublic List<SwitchCase> getCases()
public SynapseXPath getSource()
public void setSource(SynapseXPath source)
source - the XPath expression to be used as the sourcepublic SwitchCase getDefaultCase()
public void setDefaultCase(SwitchCase defaultCase)
defaultCase - A SwitchCase instance representing default case
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||