ParametersTransformer - the type of the function parameters transformer.ParametersProcessor - the type of the parameters processor that provides access to the initial value of the parameters.public abstract class AbstractCompositePolicy<ParametersTransformer,ParametersProcessor> extends Object
Processor being intercepted.| Modifier and Type | Class and Description |
|---|---|
class |
AbstractCompositePolicy.NextOperationCall
Inner class that implements the actually chaining of policies.
|
| Constructor and Description |
|---|
AbstractCompositePolicy(List<Policy> policies,
Optional<ParametersTransformer> parametersTransformer,
ParametersProcessor parametersProcessor)
Creates a new composite policy.
|
| Modifier and Type | Method and Description |
|---|---|
protected ParametersProcessor |
getParametersProcessor() |
protected Optional<ParametersTransformer> |
getParametersTransformer() |
protected abstract Event |
processNextOperation(Event event)
Template method for executing the final processor of the chain.
|
Event |
processPolicies(Event operationEvent)
When this policy is processed, it will use the
CompositeOperationPolicy.NextOperationCall which will keep track of
the different policies to be applied and the current index of the policy under execution. |
protected abstract Event |
processPolicy(Policy policy,
Processor nextProcessor,
Event event)
Template method for executing a policy.
|
public AbstractCompositePolicy(List<Policy> policies, Optional<ParametersTransformer> parametersTransformer, ParametersProcessor parametersProcessor)
policies - list of Policy to chain together.parametersTransformer - transformer from the operation parameters to a message and vice versa.public final Event processPolicies(Event operationEvent) throws Exception
CompositeOperationPolicy.NextOperationCall which will keep track of
the different policies to be applied and the current index of the policy under execution.
The first time, the first policy in the parameterizedPolicies will be executed, it will receive as it next operation
the same instance of CompositeOperationPolicy.NextOperationCall, and since
CompositeOperationPolicy.NextOperationCall keeps track of the policy executed, it will execute the following policy
in the chain until the finally policy it's executed in which case then next operation of it, it will be the operation
execution.
Exceptionprotected Optional<ParametersTransformer> getParametersTransformer()
protected ParametersProcessor getParametersProcessor()
protected abstract Event processNextOperation(Event event) throws org.mule.runtime.api.exception.MuleException
event - the event to use for executing the next operation.org.mule.runtime.api.exception.MuleException - if there's an error executing processing the next operation.protected abstract Event processPolicy(Policy policy, Processor nextProcessor, Event event) throws Exception
policy - the policy to executenextProcessor - the next processor to use as the PolicyNextActionMessageProcessor. It will invoke the next
policy in the chain.event - the event to use for processing the policy.Exception - if the execution of the policy fails.Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.