public final class DefaultExecutionMediator extends Object implements ExecutionMediator
ExecutionMediator.
If the given context implements the Interceptable, then its defined Interceptors are properly executed
as well.
It also inspects the ConfigurationStats obtained from the ConfigurationDeclaration in the context. If
the stats class implements the MutableConfigurationStats interface, then
MutableConfigurationStats.addInflightOperation() and MutableConfigurationStats.discountInflightOperation() are
guaranteed to be called, whatever the operation's outcome.
In case of operation failure, it will execute the Interceptor.onError(ExecutionContext, RetryRequest, Throwable) method
of all the available interceptors, even if any of them request for a retry. When a retry request is granted, the entire cycle
of interception (before, onSuccess/onError, after) will be fired again, but no interceptor which required a retry on the first
execution will be allowed to request it again. If an interceptor makes such a requirement after it already did on the first
attempt, an IllegalStateException will be thrown. This is to prevent badly written interceptors
from generating and endless loop by requesting the same retry over and over again.
| Modifier and Type | Field and Description |
|---|---|
static SerialWorkManager |
WORK_MANAGER |
| Constructor and Description |
|---|
DefaultExecutionMediator(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
org.mule.runtime.api.meta.model.operation.OperationModel operationModel,
ConnectionManagerAdapter connectionManager,
ErrorTypeRepository typeRepository) |
| Modifier and Type | Method and Description |
|---|---|
Object |
execute(org.mule.runtime.extension.api.runtime.operation.OperationExecutor executor,
ExecutionContextAdapter context)
Executes the operation per the specification in this classes' javadoc
|
public static final SerialWorkManager WORK_MANAGER
public DefaultExecutionMediator(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
org.mule.runtime.api.meta.model.operation.OperationModel operationModel,
ConnectionManagerAdapter connectionManager,
ErrorTypeRepository typeRepository)
public Object execute(org.mule.runtime.extension.api.runtime.operation.OperationExecutor executor, ExecutionContextAdapter context) throws Throwable
execute in interface ExecutionMediatorexecutor - an OperationExecutorcontext - the ExecutionContextAdapter for the executor to useException - if the operation or a Interceptor.before(ExecutionContext) invokation failsThrowableCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.