Class DependentProvider<T>

java.lang.Object
com.vaadin.cdi.util.DependentProvider<T>
All Implemented Interfaces:
jakarta.inject.Provider<T>, Serializable

public class DependentProvider<T> extends Object implements jakarta.inject.Provider<T>, Serializable
A Provider for @Dependent scoped contextual instances. We need this to be able to properly clean them up when they are not needed anymore via the destroy() method. Instances of this class can be retrieved using the BeanProvider. Instances of this class are Serializable if the wrapped contextual instance is Serializable.
See Also:
  • Method Details

    • get

      public T get()
      Specified by:
      get in interface jakarta.inject.Provider<T>
    • destroy

      public void destroy()
      This method will properly destroy the @Dependent scoped instance. It will have no effect if the bean is NormalScoped as those have their own lifecycle which we must not disrupt.