Package org.apache.synapse.mediators
Class AbstractListMediator
- java.lang.Object
-
- org.apache.synapse.mediators.AbstractMediator
-
- org.apache.synapse.mediators.AbstractListMediator
-
- All Implemented Interfaces:
AspectConfigurable
,ManagedLifecycle
,Mediator
,ListMediator
,SynapseArtifact
- Direct Known Subclasses:
AnonymousListMediator
,FilterMediator
,InMediator
,OutMediator
,SequenceMediator
,SynapseMediator
,TemplateMediator
,ValidateMediator
public abstract class AbstractListMediator extends AbstractMediator implements ListMediator
This is the base class for all List mediators- See Also:
ListMediator
-
-
Field Summary
Fields Modifier and Type Field Description protected List<Mediator>
mediators
the list of child mediators held.protected Pattern
msgBuildFailureExpattern
-
Fields inherited from class org.apache.synapse.mediators.AbstractMediator
log, trace, traceState
-
-
Constructor Summary
Constructors Constructor Description AbstractListMediator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAll(List<Mediator> c)
Appends all of the mediators in the specified collection to the end of this mediator's (children) list, in the order that they are returned by the specified collection's iteratorvoid
addChild(int index, Mediator m)
boolean
addChild(Mediator m)
Appends the specified mediator to the end of this mediator's (children) listvoid
destroy()
Destroy child mediators recursivelyMediator
getChild(int pos)
Returns the mediator at the specified positionList<Mediator>
getList()
Return the list of mediators of this List mediator instancevoid
init(SynapseEnvironment se)
Initialize child mediators recursivelyboolean
isContentAware()
boolean
mediate(MessageContext synCtx)
Invokes the mediator passing the current message for mediation.boolean
mediate(MessageContext synCtx, int mediatorPosition)
Mediator
removeChild(int pos)
Removes the mediator at the specified position in this listboolean
removeChild(Mediator m)
Removes the first occurrence in this list of the specified mediatorvoid
setStatisticIdForMediators(ArtifactHolder holder)
-
Methods inherited from class org.apache.synapse.mediators.AbstractMediator
auditLog, auditWarn, configure, disableStatistics, disableTracing, divertMediationRoute, enableStatistics, enableTracing, getAspectConfiguration, getCommentsList, getDescription, getInputType, getLastSequenceFaultHandler, getLog, getMediatorName, getMediatorPosition, getOutputType, getRegisteredMediationFlowPoint, getShortDescription, getTraceState, getType, handleException, handleException, isBreakPoint, isContentAltering, isSkipEnabled, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, isTracingEnabled, registerMediationFlowPoint, reportCloseStatistics, reportOpenStatistics, setBreakPoint, setCommentsList, setComponentStatisticsId, setDescription, setEffectiveTraceState, setMediatorPosition, setShortDescription, setSkipEnabled, setTraceState, shouldCaptureTracing, shouldTrace, shouldTrace, traceOrDebug, traceOrDebugWarn, unregisterMediationFlowPoint
-
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
getMediatorName, getMediatorPosition, getShortDescription, getTraceState, getType, isContentAltering, reportCloseStatistics, reportOpenStatistics, setComponentStatisticsId, setMediatorPosition, setShortDescription, setTraceState
-
Methods inherited from interface org.apache.synapse.SynapseArtifact
getDescription, setDescription
-
-
-
-
Method Detail
-
mediate
public boolean mediate(MessageContext synCtx)
Description copied from interface:Mediator
Invokes the mediator passing the current message for mediation. Each mediator performs its mediation action, and returns true if mediation should continue, or false if further mediation should be aborted.
-
mediate
public boolean mediate(MessageContext synCtx, int mediatorPosition)
-
getList
public List<Mediator> getList()
Description copied from interface:ListMediator
Return the list of mediators of this List mediator instance- Specified by:
getList
in interfaceListMediator
- Returns:
- the child/sub mediator list
-
addChild
public boolean addChild(Mediator m)
Description copied from interface:ListMediator
Appends the specified mediator to the end of this mediator's (children) list- Specified by:
addChild
in interfaceListMediator
- Parameters:
m
- the mediator to be added- Returns:
- true (as per the general contract of the Collection.add method)
-
addChild
public void addChild(int index, Mediator m)
-
addAll
public boolean addAll(List<Mediator> c)
Description copied from interface:ListMediator
Appends all of the mediators in the specified collection to the end of this mediator's (children) list, in the order that they are returned by the specified collection's iterator- Specified by:
addAll
in interfaceListMediator
- Parameters:
c
- the list of mediators to be added- Returns:
- true if this list changed as a result of the call
-
getChild
public Mediator getChild(int pos)
Description copied from interface:ListMediator
Returns the mediator at the specified position- Specified by:
getChild
in interfaceListMediator
- Parameters:
pos
- index of mediator to return- Returns:
- the mediator at the specified position in this list
-
removeChild
public boolean removeChild(Mediator m)
Description copied from interface:ListMediator
Removes the first occurrence in this list of the specified mediator- Specified by:
removeChild
in interfaceListMediator
- Parameters:
m
- mediator to be removed from this list, if present- Returns:
- true if this list contained the specified mediator
-
removeChild
public Mediator removeChild(int pos)
Description copied from interface:ListMediator
Removes the mediator at the specified position in this list- Specified by:
removeChild
in interfaceListMediator
- Parameters:
pos
- the index of the mediator to remove- Returns:
- the mediator previously at the specified position
-
init
public void init(SynapseEnvironment se)
Initialize child mediators recursively- Specified by:
init
in interfaceManagedLifecycle
- Parameters:
se
- synapse environment
-
destroy
public void destroy()
Destroy child mediators recursively- Specified by:
destroy
in interfaceManagedLifecycle
-
isContentAware
public boolean isContentAware()
- Specified by:
isContentAware
in interfaceMediator
- Overrides:
isContentAware
in classAbstractMediator
-
setStatisticIdForMediators
public void setStatisticIdForMediators(ArtifactHolder holder)
-
-