public interface AsyncInvocationInterceptor
newInterceptor
method of all
registered AsyncInvocationInterceptorFactory
providers.
The MP Rest Client implementation runtime will invoke the pre
method on the main thread prior to returning execution back to the calling
method of the client interface. The runtime will invoke the
prepareContext
method on the invocation thread before the client
request is sent. The prepareContext
method should always be
invoked before the applyContext
method is invoked, but due to
the nature of multithreading, it is possible that applyContext
method may be invoked before the prepareContext
method has
completed. Care should be taken when implementing this interface to avoid
race conditions and deadlocks.
Note that the order in which instances of the
AsyncInvocationInterceptor
are invoked are determined by the
priority of the AsyncInvocationInterceptorFactory
provider.
Note that the main and secondary threads handling the request/response may
be the same. It depends on how the implementation chooses to implement the
asynchronous handling.Modifier and Type | Method and Description |
---|---|
void |
applyContext()
This method will be invoked by the MP Rest Client runtime on the "async"
thread (i.e.
|
void |
prepareContext()
This method will be invoked by the MP Rest Client runtime on the "main"
thread (i.e.
|
void |
removeContext()
This method will be invoked by the MP Rest Client runtime on the "async"
thread (i.e.
|
void prepareContext()
void applyContext()
void removeContext()