public class InterceptorFlowController extends Object
HTTPClientInterceptor, the last interceptor in the main chain,
always returns Outcome.RETURN or Outcome.ABORT, never
Outcome.CONTINUE.
Any chain is followed using Interceptor.handleRequest(Exchange) until
it hits Outcome.RETURN or Outcome.ABORT. As the chain is
followed, every interceptor (except those with Interceptor.Flow.REQUEST) are
added to the exchange's stack.
When Outcome.RETURN is hit, the exchange's interceptor stack is
unwound and Interceptor.handleResponse(Exchange) is called for every
interceptor on it.
When Outcome.ABORT is hit, handling is aborted: An
AbortException is thrown. The stack is unwound calling
Interceptor.handleAbort(Exchange) on each interceptor on it.| Modifier and Type | Field and Description |
|---|---|
static String |
ABORTION_REASON
Key into
AbstractExchange.getProperty(String) to find out the reason why some
interceptor returned ABORT. |
| Constructor and Description |
|---|
InterceptorFlowController() |
| Modifier and Type | Method and Description |
|---|---|
void |
invokeHandlers(Exchange exchange,
List<Interceptor> interceptors)
Runs both the request and response handlers: This executes the main interceptor chain.
|
Outcome |
invokeRequestHandlers(Exchange exchange,
List<Interceptor> interceptors)
Runs the request handlers of the given chain.
|
void |
invokeResponseHandlers(Exchange exchange)
Runs all response handlers for interceptors that have been collected on
the exchange's stack so far.
|
public static final String ABORTION_REASON
AbstractExchange.getProperty(String) to find out the reason why some
interceptor returned ABORT.
This refers to the last interceptor that returned ABORT.
Note that this does not have to be set if ABORT was returned by the interceptor.public void invokeHandlers(Exchange exchange, List<Interceptor> interceptors) throws Exception
Exceptionpublic Outcome invokeRequestHandlers(Exchange exchange, List<Interceptor> interceptors) throws Exception
ExceptionCopyright © 2022. All Rights Reserved.