Class CloneMediator
- java.lang.Object
-
- org.apache.synapse.mediators.AbstractMediator
-
- org.apache.synapse.mediators.eip.splitter.CloneMediator
-
- All Implemented Interfaces:
AspectConfigurable
,ManagedLifecycle
,Mediator
,FlowContinuableMediator
,SynapseArtifact
public class CloneMediator extends AbstractMediator implements ManagedLifecycle, FlowContinuableMediator
This mediator will clone the message into multiple messages and mediate as specified in the target elements. A target specifies or refers to a sequence or an endpoint, and optionally specifies an Action and/or To address to be set to the cloned message. The number of cloned messages created is the number of targets specified
-
-
Field Summary
-
Fields inherited from class org.apache.synapse.mediators.AbstractMediator
log, trace, traceState
-
-
Constructor Summary
Constructors Constructor Description CloneMediator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTarget(Target target)
void
destroy()
This method should implement the destroying of the implemented parts of the configuration.Value
getDynamicIterationsValue()
String
getId()
String
getIterations()
List<Target>
getTargets()
void
init(SynapseEnvironment se)
This method should implement the initialization of the implemented parts of the configuration.boolean
isContentAltering()
This is used to indicate whether message payload get modified during mediationboolean
isContinueParent()
boolean
isSequential()
boolean
mediate(MessageContext synCtx)
This will implement the mediate method of the Mediator interface and will provide the functionality of cloning message into the specified targets and mediationboolean
mediate(MessageContext synCtx, ContinuationState continuationState)
Mediate the message using a ContinuationState.Integer
reportOpenStatistics(MessageContext messageContext, boolean isContentAltering)
Report Open Statistic Event for the Mediatorvoid
setComponentStatisticsId(ArtifactHolder holder)
void
setContinueParent(boolean continueParent)
void
setDynamicIterationsValue(Value dynamicIterationsValue)
void
setId(String id)
void
setIterations(String iterations)
void
setSequential(boolean sequential)
void
setTargets(List<Target> targets)
-
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, isContentAware, isSkipEnabled, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, isTracingEnabled, registerMediationFlowPoint, reportCloseStatistics, setBreakPoint, setCommentsList, setDescription, setEffectiveTraceState, setMediatorPosition, setShortDescription, setSkipEnabled, setTraceState, shouldCaptureTracing, shouldTrace, shouldTrace, traceOrDebug, traceOrDebugWarn, unregisterMediationFlowPoint
-
-
-
-
Method Detail
-
mediate
public boolean mediate(MessageContext synCtx)
This will implement the mediate method of the Mediator interface and will provide the functionality of cloning message into the specified targets and mediation
-
mediate
public boolean mediate(MessageContext synCtx, ContinuationState continuationState)
Description copied from interface:FlowContinuableMediator
Mediate the message using a ContinuationState. This is used when mediating the response message when service is invoked using a Call Mediator.- Specified by:
mediate
in interfaceFlowContinuableMediator
- Parameters:
synCtx
- MessageContextcontinuationState
- ContinuationState- Returns:
- whether mediation flow is completed
-
isContinueParent
public boolean isContinueParent()
-
setContinueParent
public void setContinueParent(boolean continueParent)
-
getIterations
public String getIterations()
-
setIterations
public void setIterations(String iterations)
-
getDynamicIterationsValue
public Value getDynamicIterationsValue()
-
setDynamicIterationsValue
public void setDynamicIterationsValue(Value dynamicIterationsValue)
-
addTarget
public void addTarget(Target target)
-
getId
public String getId()
-
setId
public void setId(String id)
-
isSequential
public boolean isSequential()
-
setSequential
public void setSequential(boolean sequential)
-
isContentAltering
public boolean isContentAltering()
Description copied from interface:Mediator
This is used to indicate whether message payload get modified during mediation- Specified by:
isContentAltering
in interfaceMediator
- Overrides:
isContentAltering
in classAbstractMediator
- Returns:
- whether mediator modify the payload
-
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
-
reportOpenStatistics
public Integer reportOpenStatistics(MessageContext messageContext, boolean isContentAltering)
Description copied from interface:Mediator
Report Open Statistic Event for the Mediator- Specified by:
reportOpenStatistics
in interfaceMediator
- Overrides:
reportOpenStatistics
in classAbstractMediator
-
setComponentStatisticsId
public void setComponentStatisticsId(ArtifactHolder holder)
- Specified by:
setComponentStatisticsId
in interfaceMediator
- Overrides:
setComponentStatisticsId
in classAbstractMediator
-
-