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>mediatorsthe list of child mediators held.protected PatternmsgBuildFailureExpattern-
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 booleanaddAll(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 iteratorvoidaddChild(int index, Mediator m)booleanaddChild(Mediator m)Appends the specified mediator to the end of this mediator's (children) listvoiddestroy()Destroy child mediators recursivelyMediatorgetChild(int pos)Returns the mediator at the specified positionList<Mediator>getList()Return the list of mediators of this List mediator instancevoidinit(SynapseEnvironment se)Initialize child mediators recursivelybooleanisContentAware()booleanmediate(MessageContext synCtx)Invokes the mediator passing the current message for mediation.booleanmediate(MessageContext synCtx, int mediatorPosition)MediatorremoveChild(int pos)Removes the mediator at the specified position in this listbooleanremoveChild(Mediator m)Removes the first occurrence in this list of the specified mediatorvoidsetStatisticIdForMediators(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:MediatorInvokes 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:ListMediatorReturn the list of mediators of this List mediator instance- Specified by:
getListin interfaceListMediator- Returns:
- the child/sub mediator list
-
addChild
public boolean addChild(Mediator m)
Description copied from interface:ListMediatorAppends the specified mediator to the end of this mediator's (children) list- Specified by:
addChildin 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:ListMediatorAppends 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:
addAllin 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:ListMediatorReturns the mediator at the specified position- Specified by:
getChildin 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:ListMediatorRemoves the first occurrence in this list of the specified mediator- Specified by:
removeChildin 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:ListMediatorRemoves the mediator at the specified position in this list- Specified by:
removeChildin 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:
initin interfaceManagedLifecycle- Parameters:
se- synapse environment
-
destroy
public void destroy()
Destroy child mediators recursively- Specified by:
destroyin interfaceManagedLifecycle
-
isContentAware
public boolean isContentAware()
- Specified by:
isContentAwarein interfaceMediator- Overrides:
isContentAwarein classAbstractMediator
-
setStatisticIdForMediators
public void setStatisticIdForMediators(ArtifactHolder holder)
-
-