Interface ApplicationEvent
-
public interface ApplicationEvent
An event informing about application lifecycle changes. The event is created by Jersey runtime and handled by user registeredapplication event listener
. The event contains theApplicationEvent.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
Nested Classes Modifier and Type Interface Description static class
ApplicationEvent.Type
The type of the event that identifies on which lifecycle change the event is triggered.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<Class<?>>
getProviders()
Get registered providers available in the runtime.Set<Class<?>>
getRegisteredClasses()
Get resource classes registered by the user in the current application.Set<Object>
getRegisteredInstances()
Get resource instances registered by the user in the current application.ResourceConfig
getResourceConfig()
Get resource config associated with the application.ResourceModel
getResourceModel()
Get the resource model of the application.ApplicationEvent.Type
getType()
Return the type of the event.
-
-
-
Method Detail
-
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
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 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
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 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
Set<Class<?>> 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.
-
-