org.glassfish.jersey.server.monitoring
Interface ApplicationStatistics


public interface ApplicationStatistics

Monitoring statistics and configuration of an application.

Statistics retrieved from Jersey runtime might be mutable and thanks to it might provide inconsistent data as not all statistics are updated in the same time. To retrieve the immutable and consistent statistics data the method snapshot() should be used.

Author:
Miroslav Fuksa (miroslav.fuksa at oracle.com)
See Also:
See MonitoringStatistics class for general details about statistics.

Method Summary
 Date getDestroyTime()
          Deprecated. deprecated since 2.5 (destroy time will always be null). Use ContainerLifecycleListener.onShutdown(org.glassfish.jersey.server.spi.Container) to listen on the destroy.
 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 the resource config.
 Date getStartTime()
          Get the start time of the application.
 ApplicationStatistics snapshot()
          Get the immutable consistent snapshot of the monitoring statistics.
 

Method Detail

getResourceConfig

ResourceConfig getResourceConfig()
Get the resource config.

Returns:
Resource config.

getStartTime

Date getStartTime()
Get the start time of the application.

Returns:
Time when an application initialization has been finished.

getDestroyTime

Date getDestroyTime()
Deprecated. deprecated since 2.5 (destroy time will always be null). Use ContainerLifecycleListener.onShutdown(org.glassfish.jersey.server.spi.Container) to listen on the destroy.

Get the time when application destroy (stop) has been finished.

Returns:
Destroy time.

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.

snapshot

ApplicationStatistics snapshot()
Get the immutable consistent snapshot of the monitoring statistics. Working with snapshots might have negative performance impact as snapshot must be created but ensures consistency of data over time. However, the usage of snapshot is encouraged to avoid working with inconsistent data. Not all statistics must be updated in the same time on mutable version of statistics.

Returns:
Snapshot of application statistics.


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