Class RestClientExtension
java.lang.Object
org.glassfish.jersey.microprofile.restclient.RestClientExtension
- All Implemented Interfaces:
jakarta.enterprise.inject.spi.Extension
Filters out all interfaces annotated with
RegisterRestClient
and creates new Producer from each of these selected interfaces.
Also adds support for injection of rest client instances to fields
without RestClient
annotation.- Author:
- David Kral
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
collectClientRegistrations
(jakarta.enterprise.inject.spi.ProcessAnnotatedType<?> processAnnotatedType) Filters out all interfaces annotated withRegisterRestClient
annotation and adds them to the collection for further processing.void
restClientRegistration
(jakarta.enterprise.inject.spi.AfterBeanDiscovery abd, jakarta.enterprise.inject.spi.BeanManager bm) Creates new producers based on collected interfaces.
-
Constructor Details
-
RestClientExtension
public RestClientExtension()
-
-
Method Details
-
collectClientRegistrations
public void collectClientRegistrations(@Observes jakarta.enterprise.inject.spi.ProcessAnnotatedType<?> processAnnotatedType) Filters out all interfaces annotated withRegisterRestClient
annotation and adds them to the collection for further processing.- Parameters:
processAnnotatedType
- filtered annotated types
-
restClientRegistration
public void restClientRegistration(@Observes jakarta.enterprise.inject.spi.AfterBeanDiscovery abd, jakarta.enterprise.inject.spi.BeanManager bm) Creates new producers based on collected interfaces.- Parameters:
abd
- after bean discovery instancebm
- bean manager instance
-