Class PushExtension

java.lang.Object
org.omnifaces.cdi.push.PushExtension
All Implemented Interfaces:
Extension

public class PushExtension extends Object implements Extension

This CDI extension detects @Inject @Push PushContext injection points during bean discovery. This enables automatic registration of the SocketEndpoint and/or SseEndpoint without requiring explicit configuration.

Since:
5.2
Author:
Bauke Scholtz
See Also:
  • Constructor Details

    • PushExtension

      public PushExtension()
  • Method Details

    • collect

      public <T> void collect(@Observes ProcessInjectionPoint<T,PushContext> event)
      Collect injection points of type PushContext qualified with Push and detect whether Web Socket and/or SSE push is used.
      Type Parameters:
      T - The generic bean type.
      Parameters:
      event - The process injection point event.
    • activate

      public static void activate(Push.Type type)
      Activate the push transport associated with the given type. This is intended for integrations in environments which do not support CDI portable extensions, such as Quarkus, where the @Push injection points are instead detected at build time. It must be invoked before the servlet context is initialized, because that is when Socket and Sse register their endpoint.
      Parameters:
      type - The push type to activate.
      Since:
      5.4.4