Class ExceptionMapperStatisticsImpl

java.lang.Object
org.glassfish.jersey.server.internal.monitoring.ExceptionMapperStatisticsImpl
All Implemented Interfaces:
ExceptionMapperStatistics

final class ExceptionMapperStatisticsImpl extends Object implements ExceptionMapperStatistics
Exception mapper statistics.
  • Field Details

    • exceptionMapperExecutionCount

      private final Map<Class<?>,Long> exceptionMapperExecutionCount
    • successfulMappings

      private final long successfulMappings
    • unsuccessfulMappings

      private final long unsuccessfulMappings
    • totalMappings

      private final long totalMappings
  • Constructor Details

    • ExceptionMapperStatisticsImpl

      private ExceptionMapperStatisticsImpl(Map<Class<?>,Long> exceptionMapperExecutionCount, long successfulMappings, long unsuccessfulMappings, long totalMappings)
  • Method Details

    • getExceptionMapperExecutions

      public Map<Class<?>,Long> getExceptionMapperExecutions()
      Description copied from interface: ExceptionMapperStatistics
      Get the count of exception mapper executions. The returned map contains classes of exception mappers and corresponding execution count as values. One execution of exception mapper is one call of ExceptionMapper.toResponse(Throwable) method.
      Specified by:
      getExceptionMapperExecutions in interface ExceptionMapperStatistics
      Returns:
      Map with exception mappers as keys and execution count as values.
    • getSuccessfulMappings

      public long getSuccessfulMappings()
      Description copied from interface: ExceptionMapperStatistics
      Get count of all successful exception mappings. Successful exception mapping occurs when any exception mapper returns an valid response (even if response contains non-successful response status code).
      Specified by:
      getSuccessfulMappings in interface ExceptionMapperStatistics
      Returns:
      Count of successfully mapped exception.
    • getUnsuccessfulMappings

      public long getUnsuccessfulMappings()
      Description copied from interface: ExceptionMapperStatistics
      Get count of all unsuccessful exception mappings. Unsuccessful exception mapping occurs when any exception mapping process does not produce an valid response. The reason can be that the exception mapper is not found, or is found but throws exception.
      Specified by:
      getUnsuccessfulMappings in interface ExceptionMapperStatistics
      Returns:
      Count of unmapped exception.
    • getTotalMappings

      public long getTotalMappings()
      Description copied from interface: ExceptionMapperStatistics
      Get count of exception mappings that were performed on exceptions.
      Specified by:
      getTotalMappings in interface ExceptionMapperStatistics
      Returns:
      Count of all exception being mapped in the runtime.
    • snapshot

      public ExceptionMapperStatistics snapshot()
      Description copied from interface: ExceptionMapperStatistics
      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.
      Specified by:
      snapshot in interface ExceptionMapperStatistics
      Returns:
      Snapshot of exception mapper statistics.