Class ExceptionMapperMXBeanImpl
- java.lang.Object
-
- org.glassfish.jersey.server.internal.monitoring.jmx.ExceptionMapperMXBeanImpl
-
- All Implemented Interfaces:
ExceptionMapperMXBean
public class ExceptionMapperMXBeanImpl extends Object implements ExceptionMapperMXBean
MXBean implementing aExceptionMapperMXBeanmxbean interface.- Author:
- Miroslav Fuksa
-
-
Constructor Summary
Constructors Constructor Description ExceptionMapperMXBeanImpl(ExceptionMapperStatistics mapperStatistics, MBeanExposer mBeanExposer, String parentName)Create a new MXBean and register it into mbean server usingmBeanExposer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Long>getExceptionMapperCount()Get the statistics of execution of exception mappers.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.voidupdateExceptionMapperStatistics(ExceptionMapperStatistics mapperStatistics)Update the MXBean with new statistics.
-
-
-
Constructor Detail
-
ExceptionMapperMXBeanImpl
public ExceptionMapperMXBeanImpl(ExceptionMapperStatistics mapperStatistics, MBeanExposer mBeanExposer, String parentName)
Create a new MXBean and register it into mbean server usingmBeanExposer.- Parameters:
mapperStatistics- Exception mapper statistics that should be exposed.mBeanExposer- Mbean exposer.parentName- Object name prefix of the parent mbeans.
-
-
Method Detail
-
updateExceptionMapperStatistics
public void updateExceptionMapperStatistics(ExceptionMapperStatistics mapperStatistics)
Update the MXBean with new statistics.- Parameters:
mapperStatistics- New exception mapper statistics.
-
getExceptionMapperCount
public Map<String,Long> getExceptionMapperCount()
Description copied from interface:ExceptionMapperMXBeanGet the statistics of execution of exception mappers.- Specified by:
getExceptionMapperCountin interfaceExceptionMapperMXBean- Returns:
- Map where keys are string class names of
exception mappersand values are counts of execution of these mappers.
-
getSuccessfulMappings
public long getSuccessfulMappings()
Description copied from interface:ExceptionMapperMXBeanGet 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 interfaceExceptionMapperMXBean- Returns:
- Count of successfully mapped exception.
-
getUnsuccessfulMappings
public long getUnsuccessfulMappings()
Description copied from interface:ExceptionMapperMXBeanGet 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 interfaceExceptionMapperMXBean- Returns:
- Count of unmapped exception.
-
getTotalMappings
public long getTotalMappings()
Description copied from interface:ExceptionMapperMXBeanGet count of exception mappings that were performed on exceptions.- Specified by:
getTotalMappingsin interfaceExceptionMapperMXBean- Returns:
- Count of all exception being mapped in the runtime.
-
-