Class AbstractCdiInstantiator

java.lang.Object
com.vaadin.cdi.AbstractCdiInstantiator
All Implemented Interfaces:
com.vaadin.flow.di.Instantiator, Serializable
Direct Known Subclasses:
CdiInstantiator

public abstract class AbstractCdiInstantiator extends Object implements com.vaadin.flow.di.Instantiator
Base class for CDI-aware instantiators. Looks up instances as CDI beans through the BeanManager, and falls back to a DefaultInstantiator delegate when no suitable bean is found.
Since:
11.2
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new CDI instantiator.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract jakarta.enterprise.inject.spi.BeanManager
    Gets the bean manager used for looking up CDI beans.
    protected abstract com.vaadin.flow.di.DefaultInstantiator
    Gets the instantiator used when an instance cannot be provided as a CDI bean.
    com.vaadin.flow.i18n.I18NProvider
     
    com.vaadin.flow.server.auth.MenuAccessControl
     
    <T> T
    getOrCreate(Class<T> type)
     
    com.vaadin.flow.router.PageTitleGenerator
     
    Stream<com.vaadin.flow.server.VaadinServiceInitListener>
     

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface com.vaadin.flow.di.Instantiator

    createComponent, createRouteTarget, getApplicationClass, getApplicationClass, getDependencyFilters, getIndexHtmlRequestListeners
  • Constructor Details

    • AbstractCdiInstantiator

      public AbstractCdiInstantiator()
      Creates a new CDI instantiator.
  • Method Details

    • getDelegate

      protected abstract com.vaadin.flow.di.DefaultInstantiator getDelegate()
      Gets the instantiator used when an instance cannot be provided as a CDI bean.
      Returns:
      the fallback instantiator
      Since:
      15.0
    • getBeanManager

      public abstract jakarta.enterprise.inject.spi.BeanManager getBeanManager()
      Gets the bean manager used for looking up CDI beans.
      Returns:
      the bean manager
    • getOrCreate

      public <T> T getOrCreate(Class<T> type)
      Specified by:
      getOrCreate in interface com.vaadin.flow.di.Instantiator
    • getI18NProvider

      public com.vaadin.flow.i18n.I18NProvider getI18NProvider()
      Specified by:
      getI18NProvider in interface com.vaadin.flow.di.Instantiator
    • getMenuAccessControl

      public com.vaadin.flow.server.auth.MenuAccessControl getMenuAccessControl()
      Specified by:
      getMenuAccessControl in interface com.vaadin.flow.di.Instantiator
    • getPageTitleGenerator

      public com.vaadin.flow.router.PageTitleGenerator getPageTitleGenerator()
      Specified by:
      getPageTitleGenerator in interface com.vaadin.flow.di.Instantiator
    • getServiceInitListeners

      public Stream<com.vaadin.flow.server.VaadinServiceInitListener> getServiceInitListeners()
      Specified by:
      getServiceInitListeners in interface com.vaadin.flow.di.Instantiator