Interface AsyncInvocationInterceptorFactory
public interface AsyncInvocationInterceptorFactory
This is a provider interface intended for intercepting asynchronous method invocations. Registered implementations of
this interface will be invoked to build a new
AsyncInvocationInterceptor
. This interceptor would then be
invoked before and after swapping threads for an asynchronous client invocation.
The priority of this provider determines when the factory's newInterceptor
method will be invoked - but
also the AsyncInvocationInterceptor
's lifecycle methods as well. Like other providers, the priority is
ascending (where a provider with priority 1 will execute before a provider of priority 2), however, the interceptors'
applyContext
methods will be invoked in descending order. The priority of the provider can be specified
using the jakarta.annotation.Priority
annotation or when registering the provider using the
RestClientBuilder
.
The timing of when providers of this interface is invoked relative to other providers (such as filters, entity
interceptors, etc.) is undefined. Implementations of this or the AsyncInvocationInterceptor
interface
should not rely on the order of other providers, as this could change between different implementations of the MP
Rest Client.- Since:
- 1.1
-
Method Summary
Modifier and TypeMethodDescriptionImplementations of this method should return an implementation of theAsyncInvocationInterceptor
interface.
-
Method Details
-
newInterceptor
AsyncInvocationInterceptor newInterceptor()Implementations of this method should return an implementation of theAsyncInvocationInterceptor
interface. The MP Rest Client implementation runtime will invoke this method, and then invoke theprepareContext
andapplyContext
methods of the returned interceptor when performing an asynchronous method invocation. Null return values will be ignored.- Returns:
- Non-null instance of
AsyncInvocationInterceptor
-