Class CdiVaadinServletService.CdiVaadinServiceDelegate

java.lang.Object
com.vaadin.cdi.CdiVaadinServletService.CdiVaadinServiceDelegate
All Implemented Interfaces:
Serializable
Enclosing class:
CdiVaadinServletService

public static class CdiVaadinServletService.CdiVaadinServiceDelegate extends Object implements Serializable
This class implements the actual instantiation and event brokering functionality of CdiVaadinServletService.
Since:
11.2
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    CdiVaadinServiceDelegate(jakarta.enterprise.inject.spi.BeanManager beanManager)
    Creates a new delegate using the given bean manager.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addUIListeners(com.vaadin.flow.component.UI ui)
    Adds listeners to the given UI that fire navigation, poll and detach events as CDI events.
    jakarta.enterprise.inject.spi.BeanManager
    Gets the bean manager, resolving it with BeanManagerProvider if it is not available, for example after deserialization.
    void
    init(com.vaadin.flow.server.VaadinService vaadinService)
    Initializes the given service: sets the CDI provided SystemMessagesProvider if available and registers the listeners that fire the corresponding CDI events.
    <T> Optional<T>
    lookup(Class<T> type)
    Looks up a VaadinServiceEnabled CDI bean of the given type.

    Methods inherited from class java.lang.Object

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

    • CdiVaadinServiceDelegate

      public CdiVaadinServiceDelegate(jakarta.enterprise.inject.spi.BeanManager beanManager)
      Creates a new delegate using the given bean manager.
      Parameters:
      beanManager - the bean manager used for looking up CDI beans
      Since:
      15.0.1
  • Method Details

    • init

      public void init(com.vaadin.flow.server.VaadinService vaadinService) throws com.vaadin.flow.server.ServiceException
      Initializes the given service: sets the CDI provided SystemMessagesProvider if available and registers the listeners that fire the corresponding CDI events.
      Parameters:
      vaadinService - the service to initialize
      Throws:
      com.vaadin.flow.server.ServiceException - if multiple eligible SystemMessagesProvider beans are found
      Since:
      15.0.1
    • addUIListeners

      public void addUIListeners(com.vaadin.flow.component.UI ui)
      Adds listeners to the given UI that fire navigation, poll and detach events as CDI events.
      Parameters:
      ui - the UI to add the listeners to
    • lookup

      public <T> Optional<T> lookup(Class<T> type) throws com.vaadin.flow.server.ServiceException
      Looks up a VaadinServiceEnabled CDI bean of the given type.
      Type Parameters:
      T - the bean type
      Parameters:
      type - the bean type to look up
      Returns:
      an optional containing the bean, or an empty optional if no such bean exists
      Throws:
      com.vaadin.flow.server.ServiceException - if multiple eligible beans are found
    • getBeanManager

      public jakarta.enterprise.inject.spi.BeanManager getBeanManager()
      Gets the bean manager, resolving it with BeanManagerProvider if it is not available, for example after deserialization.
      Returns:
      the bean manager