Class JerseyPhaseEvent

Direct Known Subclasses:
ApplicationShutdownEvent, ApplicationStartedEvent, ApplicationStartingEvent, ApplicationStoppedEvent, JerseyConfigurationEvent, JerseyExtensionsInstalledByEvent, JerseyExtensionsInstalledEvent

public abstract class JerseyPhaseEvent extends InjectorPhaseEvent
Base class for events, started after jersey context initialization start. Appears after jetty start, during jersey initialization.
Since:
19.04.2018
  • Constructor Details

    • JerseyPhaseEvent

      public JerseyPhaseEvent(GuiceyLifecycle type, EventsContext context)
      Create event.
      Parameters:
      type - event type
      context - event context
  • Method Details

    • getInjectionManager

      public org.glassfish.jersey.internal.inject.InjectionManager getInjectionManager()
      Note: all guicey events are happen before jersey application initialization finish and so manager can't be used for extensions access, but it could be stored somewhere and used later (with help of jersey lifecycle listener).

      Note: HK2 ServiceLocator could be obtained as bean from manager as getInjectionManager().getInstance(ServiceLocator.class).

      Returns:
      root service locator
    • isJerseyStarted

      public boolean isJerseyStarted()
      Jersey (rest) could start without jetty (web) only in lightweight guicey tests (rest stubs).
      Returns:
      true if jersey started, false otherwise