org.apache.synapse.config.xml
Class SwitchCase

java.lang.Object
  extended by 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
SwitchCase()
           
 
Method Summary
 void destroy()
          This method should implement the destroying of the implemented parts of the configuration.
 AnonymousListMediator getCaseMediator()
          To get list mediator of this case element
 Pattern getRegex()
          To get the regular expression pattern
 void 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 case
 boolean mediate(MessageContext synCtx)
          To delegate message mediation to list mediator
 void setCaseMediator(AnonymousListMediator caseMediator)
          To set the set of case mediators
 void setRegex(Pattern regex)
          To set the regular expression pattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwitchCase

public SwitchCase()
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 interface ManagedLifecycle
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 interface ManagedLifecycle

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


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