Interface ApplicationEvent


public interface ApplicationEvent
An event informing about application lifecycle changes. The event is created by Jersey runtime and handled by user registered application event listener.

The event contains the ApplicationEvent.Type which distinguishes between types of event. There are various properties in the event (accessible by getters) and some of them might be relevant only to specific event types.

Note that internal state of the event must be modified. Even the event is immutable it exposes objects which might be mutable and the code of event listener must not change state of these objects.

Author:
Miroslav Fuksa
  • Method Details

    • getType

      Return the type of the event.
      Returns:
      Event type.
    • getResourceConfig

      ResourceConfig getResourceConfig()
      Get resource config associated with the application. The resource config is set for all event types.
      Returns:
      Resource config on which this application is based on.
    • getRegisteredClasses

      Set<Class<?>> getRegisteredClasses()
      Get resource classes registered by the user in the current application. The set contains only user resource classes and not resource classes added by Jersey or by ModelProcessor.

      User resources are resources that were explicitly registered by the configuration, discovered by the class path scanning or that constructs explicitly registered programmatic resource.

      Returns:
      Resource user registered classes.
    • getRegisteredInstances

      Set<Object> getRegisteredInstances()
      Get resource instances registered by the user in the current application. The set contains only user resources and not resources added by Jersey or by ModelProcessor.

      User resources are resources that were explicitly registered by the configuration, discovered by the class path scanning or that constructs explicitly registered programmatic resource.

      Returns:
      Resource instances registered by user.
    • getProviders

      Set<Class<?>> getProviders()
      Get registered providers available in the runtime. The registered providers are providers like filters, reader and writer interceptors which are explicitly registered by configuration, or annotated by @Provider or registered in META-INF/services. The set does not include providers that are by default built in Jersey.
      Returns:
      Set of provider classes.
    • getResourceModel

      ResourceModel getResourceModel()
      Get the resource model of the application. The method returns null for ApplicationEvent.Type.INITIALIZATION_START event type as the resource model is not initialized yet. The returned resource model is the final deployed model including resources enhanced by model processors.
      Returns:
      Resource model of the deployed application.