Class ExceptionMapperStatisticsImpl
- java.lang.Object
-
- org.glassfish.jersey.server.internal.monitoring.ExceptionMapperStatisticsImpl
-
- All Implemented Interfaces:
ExceptionMapperStatistics
final class ExceptionMapperStatisticsImpl extends java.lang.Object implements ExceptionMapperStatistics
Exception mapper statistics.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classExceptionMapperStatisticsImpl.BuilderBuilder of exception mapper statistics.
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.Class<?>,java.lang.Long>exceptionMapperExecutionCountprivate longsuccessfulMappingsprivate longtotalMappingsprivate longunsuccessfulMappings
-
Constructor Summary
Constructors Modifier Constructor Description privateExceptionMapperStatisticsImpl(java.util.Map<java.lang.Class<?>,java.lang.Long> exceptionMapperExecutionCount, long successfulMappings, long unsuccessfulMappings, long totalMappings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.Class<?>,java.lang.Long>getExceptionMapperExecutions()Get the count of exception mapper executions.longgetSuccessfulMappings()Get count of all successful exception mappings.longgetTotalMappings()Get count of exception mappings that were performed on exceptions.longgetUnsuccessfulMappings()Get count of all unsuccessful exception mappings.ExceptionMapperStatisticssnapshot()Get the immutable consistent snapshot of the monitoring statistics.
-
-
-
Field Detail
-
exceptionMapperExecutionCount
private final java.util.Map<java.lang.Class<?>,java.lang.Long> exceptionMapperExecutionCount
-
successfulMappings
private final long successfulMappings
-
unsuccessfulMappings
private final long unsuccessfulMappings
-
totalMappings
private final long totalMappings
-
-
Method Detail
-
getExceptionMapperExecutions
public java.util.Map<java.lang.Class<?>,java.lang.Long> getExceptionMapperExecutions()
Description copied from interface:ExceptionMapperStatisticsGet the count of exception mapper executions. The returned map containsclassesofexception mappersand corresponding execution count as values. One execution of exception mapper is one call ofExceptionMapper.toResponse(Throwable)method.- Specified by:
getExceptionMapperExecutionsin interfaceExceptionMapperStatistics- Returns:
- Map with exception mappers as keys and execution count as values.
-
getSuccessfulMappings
public long getSuccessfulMappings()
Description copied from interface:ExceptionMapperStatisticsGet count of all successful exception mappings. Successful exception mapping occurs when anyexception mapperreturns an valid response (even if response contains non-successful response status code).- Specified by:
getSuccessfulMappingsin interfaceExceptionMapperStatistics- Returns:
- Count of successfully mapped exception.
-
getUnsuccessfulMappings
public long getUnsuccessfulMappings()
Description copied from interface:ExceptionMapperStatisticsGet 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 theexception mapperis not found, or is found but throws exception.- Specified by:
getUnsuccessfulMappingsin interfaceExceptionMapperStatistics- Returns:
- Count of unmapped exception.
-
getTotalMappings
public long getTotalMappings()
Description copied from interface:ExceptionMapperStatisticsGet count of exception mappings that were performed on exceptions.- Specified by:
getTotalMappingsin interfaceExceptionMapperStatistics- Returns:
- Count of all exception being mapped in the runtime.
-
snapshot
public ExceptionMapperStatistics snapshot()
Description copied from interface:ExceptionMapperStatisticsGet 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:
snapshotin interfaceExceptionMapperStatistics- Returns:
- Snapshot of exception mapper statistics.
-
-