public class CompositeOperationPolicy extends AbstractCompositePolicy<OperationPolicyParametersTransformer,OperationParametersProcessor> implements OperationPolicy
OperationPolicy created from a list of Policy.
Implements the template methods from AbstractCompositePolicy required to work with operation policies.
AbstractCompositePolicy.NextOperationCall| Constructor and Description |
|---|
CompositeOperationPolicy(List<Policy> parameterizedPolicies,
Optional<OperationPolicyParametersTransformer> operationPolicyParametersTransformer,
OperationPolicyProcessorFactory operationPolicyProcessorFactory,
OperationParametersProcessor operationParametersProcessor,
OperationExecutionFunction operationExecutionFunction)
Creates a new composite policy.
|
| Modifier and Type | Method and Description |
|---|---|
Event |
process(Event operationEvent)
Process the policy chain of processors.
|
protected Event |
processNextOperation(Event event)
Stores the operation result so all the chains after the operation execution are executed with the actual operation result and
not a modified version from another policy.
|
protected Event |
processPolicy(Policy policy,
Processor nextProcessor,
Event event)
Always uses the stored result of
processNextOperation so all the chains after the operation execution are executed
with the actual operation result and not a modified version from another policy. |
getParametersProcessor, getParametersTransformer, processPoliciespublic CompositeOperationPolicy(List<Policy> parameterizedPolicies, Optional<OperationPolicyParametersTransformer> operationPolicyParametersTransformer, OperationPolicyProcessorFactory operationPolicyProcessorFactory, OperationParametersProcessor operationParametersProcessor, OperationExecutionFunction operationExecutionFunction)
operationPolicyParametersTransformer is passed to this class, then it will be used to convert the
flow execution response parameters to a message with the content of such parameters in order to allow the pipeline after
the next-operation to modify the response. If an empty operationPolicyParametersTransformer is provided then
the policy won't be able to change the response parameters of the source and the original response parameters generated
from the source will be usd.parameterizedPolicies - list of Policy to chain together.operationPolicyParametersTransformer - transformer from the operation parameters to a message and vice versa.operationPolicyProcessorFactory - factory for creating each OperationPolicy from a PolicyoperationExecutionFunction - the function that executes the operation.protected Event processNextOperation(Event event) throws org.mule.runtime.api.exception.MuleException
processNextOperation in class AbstractCompositePolicy<OperationPolicyParametersTransformer,OperationParametersProcessor>event - the event to execute the operation.org.mule.runtime.api.exception.MuleException - if there's an error executing processing the next operation.protected Event processPolicy(Policy policy, Processor nextProcessor, Event event) throws Exception
processNextOperation so all the chains after the operation execution are executed
with the actual operation result and not a modified version from another policy.processPolicy in class AbstractCompositePolicy<OperationPolicyParametersTransformer,OperationParametersProcessor>policy - the policy to execute.nextProcessor - the processor to execute when the policy next-processor gets executedevent - the event to use to execute the policy chain.Exception - if the execution of the policy fails.public Event process(Event operationEvent) throws Exception
OperationPolicynextOperation function has the behaviour to be executed by the
next-operation of the chain.process in interface OperationPolicyoperationEvent - the event with the data to execute the operationevent through the policy chain.ExceptionCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.