@Beta @Contract @ConstrainedTo(value=CLIENT) public interface PreInvocationInterceptor
ClientRequestFilter is invoked.
It is ensured that all PreInvocationInterceptors are executed before the request, in the order given by the
Priority, the higher the priority the sooner the execution. Any RuntimeException thrown when
the beforeRequest(ClientRequestContext) is being processed is accumulated and
a multi RuntimeException with other exceptions supressed is being thrown.
For asynchronous invocation, the PreInvocationInterceptor is invoked in the main thread, i.e. not in the thread
provided by ExecutorService. For reactive
invocations, this depends on the provided RxInvoker. For the default Jersey asynchronous
JerseyCompletionStageRxInvoker, PreInvocationInterceptor is invoked in the
main thread, too.
Should the ClientRequestContext.abortWith(Response) be utilized, the request abort is performed after every
registered PreInvocationInterceptor is processed. If multiple
PreInvocationInterceptors PreInvocationInterceptor tries to utilize ClientRequestContext.abortWith(Response)
method, the second and every next throws IllegalStateException.| Modifier and Type | Method and Description |
|---|---|
void |
beforeRequest(ClientRequestContext requestContext)
The method invoked before the request starts.
|
void beforeRequest(ClientRequestContext requestContext)
requestContext - the request context shared with ClientRequestFilter.Copyright © 2007-2023, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.