org.glassfish.jersey.server.monitoring
Interface ApplicationEvent

All Known Implementing Classes:
ApplicationEventImpl

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 (miroslav.fuksa at oracle.com)

Nested Class Summary
static class ApplicationEvent.Type
          The type of the event that identifies on which lifecycle change the event is triggered.
 
Method Summary
 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 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.


Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.