Class ApplicationEventImpl
- java.lang.Object
-
- org.glassfish.jersey.server.internal.monitoring.ApplicationEventImpl
-
- All Implemented Interfaces:
ApplicationEvent
public class ApplicationEventImpl extends java.lang.Object implements ApplicationEvent
Implementation ofapplication event
. Instances are immutable.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.glassfish.jersey.server.monitoring.ApplicationEvent
ApplicationEvent.Type
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<java.lang.Class<?>>
providers
private java.util.Set<java.lang.Class<?>>
registeredClasses
private java.util.Set<java.lang.Object>
registeredInstances
private ResourceConfig
resourceConfig
private ResourceModel
resourceModel
private ApplicationEvent.Type
type
-
Constructor Summary
Constructors Constructor Description ApplicationEventImpl(ApplicationEvent.Type type, ResourceConfig resourceConfig, java.util.Set<java.lang.Class<?>> providers, java.util.Set<java.lang.Class<?>> registeredClasses, java.util.Set<java.lang.Object> registeredInstances, ResourceModel resourceModel)
Create a new application event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<java.lang.Class<?>>
getProviders()
Get registered providers available in the runtime.java.util.Set<java.lang.Class<?>>
getRegisteredClasses()
Get resource classes registered by the user in the current application.java.util.Set<java.lang.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.
-
-
-
Field Detail
-
type
private final ApplicationEvent.Type type
-
resourceConfig
private final ResourceConfig resourceConfig
-
providers
private final java.util.Set<java.lang.Class<?>> providers
-
registeredClasses
private final java.util.Set<java.lang.Class<?>> registeredClasses
-
registeredInstances
private final java.util.Set<java.lang.Object> registeredInstances
-
resourceModel
private final ResourceModel resourceModel
-
-
Constructor Detail
-
ApplicationEventImpl
public ApplicationEventImpl(ApplicationEvent.Type type, ResourceConfig resourceConfig, java.util.Set<java.lang.Class<?>> providers, java.util.Set<java.lang.Class<?>> registeredClasses, java.util.Set<java.lang.Object> registeredInstances, ResourceModel resourceModel)
Create a new application event.- Parameters:
type
- Type of the event.resourceConfig
- Resource config of the application.registeredClasses
- Registered resource classes.registeredInstances
- Registered resource instances.resourceModel
- Resource model of the application (enhanced bymodel processors
).providers
- Registered providers.
-
-
Method Detail
-
getResourceConfig
public ResourceConfig getResourceConfig()
Description copied from interface:ApplicationEvent
Get resource config associated with the application. The resource config is set for all event types.- Specified by:
getResourceConfig
in interfaceApplicationEvent
- Returns:
- Resource config on which this application is based on.
-
getType
public ApplicationEvent.Type getType()
Description copied from interface:ApplicationEvent
Return the type of the event.- Specified by:
getType
in interfaceApplicationEvent
- Returns:
- Event type.
-
getRegisteredClasses
public java.util.Set<java.lang.Class<?>> getRegisteredClasses()
Description copied from interface:ApplicationEvent
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
.- Specified by:
getRegisteredClasses
in interfaceApplicationEvent
- Returns:
- Resource user registered classes.
-
getRegisteredInstances
public java.util.Set<java.lang.Object> getRegisteredInstances()
Description copied from interface:ApplicationEvent
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
.- Specified by:
getRegisteredInstances
in interfaceApplicationEvent
- Returns:
- Resource instances registered by user.
-
getProviders
public java.util.Set<java.lang.Class<?>> getProviders()
Description copied from interface:ApplicationEvent
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.- Specified by:
getProviders
in interfaceApplicationEvent
- Returns:
- Set of provider classes.
-
getResourceModel
public ResourceModel getResourceModel()
Description copied from interface:ApplicationEvent
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
.- Specified by:
getResourceModel
in interfaceApplicationEvent
- Returns:
- Resource model of the deployed application.
-
-