public interface InterceptorChain
interceptors that will be applied as one.
It also contains based semantics and behaviors about the nuances of how should the Interceptor contract be
consumed.
| Modifier and Type | Interface and Description |
|---|---|
static class |
InterceptorChain.Builder
Builder for creating
InterceptorChain instances |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(org.mule.runtime.extension.api.runtime.operation.ExecutionContext executionContext)
Executes the
Interceptor.after(ExecutionContext, Object) phase on each added interceptor, using null as
the second argument. |
Throwable |
before(org.mule.runtime.extension.api.runtime.operation.ExecutionContext executionContext,
org.mule.runtime.extension.api.runtime.operation.CompletableComponentExecutor.ExecutorCallback callback)
Executes the
Interceptor.before(ExecutionContext) phase on each added interceptor. |
static InterceptorChain.Builder |
builder() |
Throwable |
onError(org.mule.runtime.extension.api.runtime.operation.ExecutionContext executionContext,
Throwable t)
Executes the
Interceptor.onError(ExecutionContext, Throwable) phase on each added interceptor. |
void |
onSuccess(org.mule.runtime.extension.api.runtime.operation.ExecutionContext executionContext,
Object result)
Executes the
Interceptor.onSuccess(ExecutionContext, Object) phase on each added interceptor. |
static InterceptorChain.Builder builder()
InterceptorChain.BuilderThrowable before(org.mule.runtime.extension.api.runtime.operation.ExecutionContext executionContext, org.mule.runtime.extension.api.runtime.operation.CompletableComponentExecutor.ExecutorCallback callback)
Interceptor.before(ExecutionContext) phase on each added interceptor.
Assuming a chain in which 0 < N < M , if interceptor N fails, then the
Interceptor.after(ExecutionContext, Object) method will be executed on N and all prior interceptors.
Additionally, CompletableComponentExecutor.ExecutorCallback.error(Throwable) is invoked on callback if it's not null.
CompletableComponentExecutor.ExecutorCallback.complete(Object) will never be invoked here.
executionContext - the ExecutionContextcallback - nullable callback in which errors are to be notifiednull if all interceptors executed successfully or a Throwable if one of them failsvoid onSuccess(org.mule.runtime.extension.api.runtime.operation.ExecutionContext executionContext,
Object result)
Interceptor.onSuccess(ExecutionContext, Object) phase on each added interceptor.
If case of an interceptor failing, the exception is logged and next interceptors are still executed. This method will never fail
executionContext - the ExecutionContextresult - the operation's resultThrowable onError(org.mule.runtime.extension.api.runtime.operation.ExecutionContext executionContext, Throwable t)
Interceptor.onError(ExecutionContext, Throwable) phase on each added interceptor.
Because each invocation Interceptor.onError(ExecutionContext, Throwable) returns a (potentially) mutated exception,
for each interceptor N in which 0 < N < M, the Throwable passed into it is the one that was returned
by interceptor N -1.
If case of an interceptor failing, the exception is logged and next interceptors are still executed. This method will never fail
This method returns the Throwable returned by the last interceptor.
executionContext - the ExecutionContextt - the exception foundThrowable that this chain's consumer should handle.void abort(org.mule.runtime.extension.api.runtime.operation.ExecutionContext executionContext)
Interceptor.after(ExecutionContext, Object) phase on each added interceptor, using null as
the second argument.
If case of an interceptor failing, the exception is logged and next interceptors are still executed. This method will never fail.
executionContext - the ExecutionContextCopyright © 2003–2020 MuleSoft, Inc.. All rights reserved.