Class ExceptionMapperStatisticsImpl
java.lang.Object
org.glassfish.jersey.server.internal.monitoring.ExceptionMapperStatisticsImpl
- All Implemented Interfaces:
ExceptionMapperStatistics
Exception mapper statistics.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
Builder of exception mapper statistics. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final long
private final long
private final long
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ExceptionMapperStatisticsImpl
(Map<Class<?>, Long> exceptionMapperExecutionCount, long successfulMappings, long unsuccessfulMappings, long totalMappings) -
Method Summary
Modifier and TypeMethodDescriptionGet the count of exception mapper executions.long
Get count of all successful exception mappings.long
Get count of exception mappings that were performed on exceptions.long
Get count of all unsuccessful exception mappings.snapshot()
Get the immutable consistent snapshot of the monitoring statistics.
-
Field Details
-
exceptionMapperExecutionCount
-
successfulMappings
private final long successfulMappings -
unsuccessfulMappings
private final long unsuccessfulMappings -
totalMappings
private final long totalMappings
-
-
Constructor Details
-
ExceptionMapperStatisticsImpl
-
-
Method Details
-
getExceptionMapperExecutions
Description copied from interface:ExceptionMapperStatistics
Get the count of exception mapper executions. The returned map containsclasses
ofexception mappers
and corresponding execution count as values. One execution of exception mapper is one call ofExceptionMapper.toResponse(Throwable)
method.- Specified by:
getExceptionMapperExecutions
in interfaceExceptionMapperStatistics
- 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 anyexception mapper
returns an valid response (even if response contains non-successful response status code).- Specified by:
getSuccessfulMappings
in interfaceExceptionMapperStatistics
- 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 theexception mapper
is not found, or is found but throws exception.- Specified by:
getUnsuccessfulMappings
in interfaceExceptionMapperStatistics
- 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 interfaceExceptionMapperStatistics
- Returns:
- Count of all exception being mapped in the runtime.
-
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 interfaceExceptionMapperStatistics
- Returns:
- Snapshot of exception mapper statistics.
-