Class ExceptionMapperMXBeanImpl
- java.lang.Object
-
- org.glassfish.jersey.server.internal.monitoring.jmx.ExceptionMapperMXBeanImpl
-
- All Implemented Interfaces:
ExceptionMapperMXBean
public class ExceptionMapperMXBeanImpl extends java.lang.Object implements ExceptionMapperMXBean
MXBean implementing aExceptionMapperMXBean
mxbean interface.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.Long>
mapperExcecutions
private ExceptionMapperStatistics
mapperStatistics
-
Constructor Summary
Constructors Constructor Description ExceptionMapperMXBeanImpl(ExceptionMapperStatistics mapperStatistics, MBeanExposer mBeanExposer, java.lang.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 java.util.Map<java.lang.String,java.lang.Long>
getExceptionMapperCount()
Get the statistics of execution of exception mappers.long
getSuccessfulMappings()
Get count of all successful exception mappings.long
getTotalMappings()
Get count of exception mappings that were performed on exceptions.long
getUnsuccessfulMappings()
Get count of all unsuccessful exception mappings.void
updateExceptionMapperStatistics(ExceptionMapperStatistics mapperStatistics)
Update the MXBean with new statistics.
-
-
-
Field Detail
-
mapperStatistics
private volatile ExceptionMapperStatistics mapperStatistics
-
mapperExcecutions
private volatile java.util.Map<java.lang.String,java.lang.Long> mapperExcecutions
-
-
Constructor Detail
-
ExceptionMapperMXBeanImpl
public ExceptionMapperMXBeanImpl(ExceptionMapperStatistics mapperStatistics, MBeanExposer mBeanExposer, java.lang.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 java.util.Map<java.lang.String,java.lang.Long> getExceptionMapperCount()
Description copied from interface:ExceptionMapperMXBean
Get the statistics of execution of exception mappers.- Specified by:
getExceptionMapperCount
in interfaceExceptionMapperMXBean
- Returns:
- Map where keys are string class names of
exception mappers
and values are counts of execution of these mappers.
-
getSuccessfulMappings
public long getSuccessfulMappings()
Description copied from interface:ExceptionMapperMXBean
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 interfaceExceptionMapperMXBean
- Returns:
- Count of successfully mapped exception.
-
getUnsuccessfulMappings
public long getUnsuccessfulMappings()
Description copied from interface:ExceptionMapperMXBean
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 interfaceExceptionMapperMXBean
- Returns:
- Count of unmapped exception.
-
getTotalMappings
public long getTotalMappings()
Description copied from interface:ExceptionMapperMXBean
Get count of exception mappings that were performed on exceptions.- Specified by:
getTotalMappings
in interfaceExceptionMapperMXBean
- Returns:
- Count of all exception being mapped in the runtime.
-
-