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 javax.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.
  • Method Summary

    Modifier and Type
    Method
    Description
    Implementations of this method should return an implementation of the AsyncInvocationInterceptor interface.
  • Method Details

    • newInterceptor

      AsyncInvocationInterceptor newInterceptor()
      Implementations of this method should return an implementation of the AsyncInvocationInterceptor interface. The MP Rest Client implementation runtime will invoke this method, and then invoke the prepareContext and applyContext methods of the returned interceptor when performing an asynchronous method invocation. Null return values will be ignored.