Package org.glassfish.jersey.client.spi
Interface PreInvocationInterceptor
-
@Beta @Contract @ConstrainedTo(CLIENT) public interface PreInvocationInterceptor
The interceptor of a client request invocation that is executed before the invocation itself, i.e. before theClientRequestFilteris invoked. It is ensured that allPreInvocationInterceptorsare executed before the request, in the order given by thePriority, the higher the priority the sooner the execution. AnyRuntimeExceptionthrown when thebeforeRequest(ClientRequestContext)is being processed is accumulated and a multi RuntimeException with otherexceptions supressedis being thrown. For asynchronous invocation, thePreInvocationInterceptoris invoked in the main thread, i.e. not in the thread provided byExecutorService. For reactive invocations, this depends on the providedRxInvoker. For the default Jersey asynchronousJerseyCompletionStageRxInvoker,PreInvocationInterceptoris invoked in the main thread, too. Should theClientRequestContext.abortWith(Response)be utilized, the request abort is performed after every registeredPreInvocationInterceptoris processed. If multiplePreInvocationInterceptors PreInvocationInterceptortries to utilizeClientRequestContext.abortWith(Response)method, the second and every next throwsIllegalStateException.- Since:
- 2.30
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbeforeRequest(ClientRequestContext requestContext)The method invoked before the request starts.
-
-
-
Method Detail
-
beforeRequest
void beforeRequest(ClientRequestContext requestContext)
The method invoked before the request starts.- Parameters:
requestContext- the request context shared withClientRequestFilter.
-
-