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
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
The type of the event that identifies on which lifecycle change the event is triggered. -
Method Summary
Modifier and TypeMethodDescriptionGet registered providers available in the runtime.Get resource classes registered by the user in the current application.Get resource instances registered by the user in the current application.Get resource config associated with the application.Get the resource model of the application.getType()
Return the type of the event.
-
Method Details
-
getType
ApplicationEvent.Type 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
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 byModelProcessor
. User resources are resources that were explicitly registered by the configuration, discovered by the class path scanning or that constructs explicitly registeredprogrammatic resource
.- Returns:
- Resource user registered classes.
-
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 byModelProcessor
. User resources are resources that were explicitly registered by the configuration, discovered by the class path scanning or that constructs explicitly registeredprogrammatic resource
.- Returns:
- Resource instances registered by user.
-
getProviders
Get registered providers available in the runtime. The registered providers are providers likefilters
,reader
andwriter
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 forApplicationEvent.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 bymodel processors
.- Returns:
- Resource model of the deployed application.
-