Package org.apache.synapse.config.xml
Class SwitchCase
- java.lang.Object
-
- org.apache.synapse.config.xml.SwitchCase
-
- All Implemented Interfaces:
ManagedLifecycle
public class SwitchCase extends Object implements ManagedLifecycle
A SwitchCase define a case element of Switch Mediator and It has a list mediator and a regex that is matched by its owning SwitchMediator for selection. If any SwitchCase has selected ,Then the list mediator of it, will responsible for message mediation
-
-
Constructor Summary
Constructors Constructor Description SwitchCase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
This method should implement the destroying of the implemented parts of the configuration.AnonymousListMediator
getCaseMediator()
To get list mediator of this case elementPattern
getRegex()
To get the regular expression patternvoid
init(SynapseEnvironment se)
This method should implement the initialization of the implemented parts of the configuration.boolean
matches(String value)
To evaluate regular expression pattern to a get switch caseboolean
mediate(MessageContext synCtx)
To delegate message mediation to list mediatorvoid
setCaseMediator(AnonymousListMediator caseMediator)
To set the set of case mediatorsvoid
setRegex(Pattern regex)
To set the regular expression patternvoid
setStatisticIdForMediators(ArtifactHolder holder)
-
-
-
Method Detail
-
init
public void init(SynapseEnvironment se)
Description copied from interface:ManagedLifecycle
This method should implement the initialization of the implemented parts of the configuration.- Specified by:
init
in interfaceManagedLifecycle
- Parameters:
se
- SynapseEnvironment to be used for initialization
-
destroy
public void destroy()
Description copied from interface:ManagedLifecycle
This method should implement the destroying of the implemented parts of the configuration.- Specified by:
destroy
in interfaceManagedLifecycle
-
mediate
public boolean mediate(MessageContext synCtx)
To delegate message mediation to list mediator- Parameters:
synCtx
- message context to be mediated- Returns:
- boolean value
-
getCaseMediator
public AnonymousListMediator getCaseMediator()
To get list mediator of this case element- Returns:
- List mediator of switch case
-
setCaseMediator
public void setCaseMediator(AnonymousListMediator caseMediator)
To set the set of case mediators- Parameters:
caseMediator
- anonymous sequence to be used for the case mediation
-
getRegex
public Pattern getRegex()
To get the regular expression pattern- Returns:
- Pattern
-
setRegex
public void setRegex(Pattern regex)
To set the regular expression pattern- Parameters:
regex
- Regular Expression to be matched
-
matches
public boolean matches(String value)
To evaluate regular expression pattern to a get switch case- Parameters:
value
- value to be tested over the regular expression of match- Returns:
- boolean value
-
setStatisticIdForMediators
public void setStatisticIdForMediators(ArtifactHolder holder)
-
-