Class ApplicationInfoImpl

  • All Implemented Interfaces:
    ApplicationInfo

    final class ApplicationInfoImpl
    extends java.lang.Object
    implements ApplicationInfo
    Application statistics.
    • Constructor Summary

      Constructors 
      Constructor Description
      ApplicationInfoImpl​(ResourceConfig resourceConfig, java.util.Date startTime, java.util.Set<java.lang.Class<?>> registeredClasses, java.util.Set<java.lang.Object> registeredInstances, java.util.Set<java.lang.Class<?>> providers)
      Create a new application statistics instance.
    • 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 the resource config.
      java.util.Date getStartTime()
      Get the start time of the application.
      ApplicationInfo snapshot()
      Get the immutable consistent snapshot of the application info.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • startTime

        private final java.util.Date startTime
      • registeredClasses

        private final java.util.Set<java.lang.Class<?>> registeredClasses
      • registeredInstances

        private final java.util.Set<java.lang.Object> registeredInstances
      • providers

        private final java.util.Set<java.lang.Class<?>> providers
    • Constructor Detail

      • ApplicationInfoImpl

        ApplicationInfoImpl​(ResourceConfig resourceConfig,
                            java.util.Date startTime,
                            java.util.Set<java.lang.Class<?>> registeredClasses,
                            java.util.Set<java.lang.Object> registeredInstances,
                            java.util.Set<java.lang.Class<?>> providers)
        Create a new application statistics instance.
        Parameters:
        resourceConfig - Resource config of the application being monitored.
        startTime - Start time of the application (when initialization was finished).
        registeredClasses - Registered resource classes.
        registeredInstances - Registered resource instances.
        providers - Registered providers.
    • Method Detail

      • getStartTime

        public java.util.Date getStartTime()
        Description copied from interface: ApplicationInfo
        Get the start time of the application.
        Specified by:
        getStartTime in interface ApplicationInfo
        Returns:
        Time when an application initialization has been finished.
      • getRegisteredClasses

        public java.util.Set<java.lang.Class<?>> getRegisteredClasses()
        Description copied from interface: ApplicationInfo
        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.

        Specified by:
        getRegisteredClasses in interface ApplicationInfo
        Returns:
        Resource user registered classes.
      • getRegisteredInstances

        public java.util.Set<java.lang.Object> getRegisteredInstances()
        Description copied from interface: ApplicationInfo
        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.

        Specified by:
        getRegisteredInstances in interface ApplicationInfo
        Returns:
        Resource instances registered by user.
      • getProviders

        public java.util.Set<java.lang.Class<?>> getProviders()
        Description copied from interface: ApplicationInfo
        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.
        Specified by:
        getProviders in interface ApplicationInfo
        Returns:
        Set of provider classes.
      • snapshot

        public ApplicationInfo snapshot()
        Description copied from interface: ApplicationInfo
        Get the immutable consistent snapshot of the application info. 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 attributes must be updated in the same time on mutable version of info.
        Specified by:
        snapshot in interface ApplicationInfo
        Returns:
        Snapshot of application info.