Class RestClientExtension

java.lang.Object
org.glassfish.jersey.microprofile.restclient.RestClientExtension
All Implemented Interfaces:
jakarta.enterprise.inject.spi.Extension

public class RestClientExtension extends Object implements 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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    collectClientRegistrations(jakarta.enterprise.inject.spi.ProcessAnnotatedType<?> processAnnotatedType)
    Filters out all interfaces annotated with RegisterRestClient 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RestClientExtension

      public RestClientExtension()
  • Method Details

    • collectClientRegistrations

      public void collectClientRegistrations(@Observes jakarta.enterprise.inject.spi.ProcessAnnotatedType<?> processAnnotatedType)
      Filters out all interfaces annotated with RegisterRestClient 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 instance
      bm - bean manager instance