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 classBuilder of exception mapper statistics. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final longprivate final longprivate final long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateExceptionMapperStatisticsImpl(Map<Class<?>, Long> exceptionMapperExecutionCount, long successfulMappings, long unsuccessfulMappings, long totalMappings) -
Method Summary
Modifier and TypeMethodDescriptionGet the count of exception mapper executions.longGet count of all successful exception mappings.longGet count of exception mappings that were performed on exceptions.longGet 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: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
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.
-