Class AbstractCdiBeanSupplier<T>

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

public abstract class AbstractCdiBeanSupplier<T> extends Object implements org.glassfish.jersey.internal.inject.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 Summary

    Constructors
    Constructor
    Description
    AbstractCdiBeanSupplier(Class<T> rawType, org.glassfish.jersey.internal.inject.InjectionManager injectionManager, jakarta.enterprise.inject.spi.BeanManager beanManager, boolean cdiManaged)
    Create new factory instance for given type and bean manager.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    dispose(T instance)
    This method will dispose the provided object created by this Supplier.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.function.Supplier

    get
  • Constructor Details

    • AbstractCdiBeanSupplier

      public AbstractCdiBeanSupplier(Class<T> rawType, org.glassfish.jersey.internal.inject.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: org.glassfish.jersey.internal.inject.DisposableSupplier
      This method will dispose the provided object created by this Supplier.
      Specified by:
      dispose in interface org.glassfish.jersey.internal.inject.DisposableSupplier<T>
      Parameters:
      instance - the instance to be disposed.