Class AbstractCdiBeanSupplier<T>

java.lang.Object
org.glassfish.jersey.ext.cdi1x.internal.AbstractCdiBeanSupplier<T>
All Implemented Interfaces:
Supplier<T>, DisposableSupplier<T>
Direct Known Subclasses:
GenericCdiBeanSupplier, RequestScopedCdiBeanSupplier

public abstract class AbstractCdiBeanSupplier<T> extends Object implements DisposableSupplier<T>
Abstract supplier to provide CDI components obtained from CDI bean manager. The factory handles CDI managed components as well as non-contextual managed beans. To specify scope of provided CDI beans, an extension of this supplier should implement properly annotated Supplier.get() method that could just delegate to the existing _provide() method.
Author:
Jakub Podlesak
  • Constructor Details

    • AbstractCdiBeanSupplier

      public AbstractCdiBeanSupplier(Class<T> rawType, InjectionManager injectionManager, jakarta.enterprise.inject.spi.BeanManager beanManager, boolean cdiManaged)
      Create new factory instance for given type and bean manager.
      Parameters:
      rawType - type of the components to provide.
      injectionManager - actual injection manager instance.
      beanManager - current bean manager to get references from.
      cdiManaged - set to true if the component should be managed by CDI.
  • Method Details

    • dispose

      public void dispose(T instance)
      Description copied from interface: DisposableSupplier
      This method will dispose the provided object created by this Supplier.
      Specified by:
      dispose in interface DisposableSupplier<T>
      Parameters:
      instance - the instance to be disposed.