@WebListener public class ExceptionMonitor extends JmxMonitor implements ExceptionMonitorMXBean
To replace the statically created and stored pseudo-singleton with a custom implementation simply use the
setInstance(ExceptionMonitor)
method. All newly recorded exceptions are then delegated to the given instance.
Constructor and Description |
---|
ExceptionMonitor() |
Modifier and Type | Method and Description |
---|---|
List<String> |
aggregateTypesOrderedByFrequency() |
void |
clear()
Clears all recorded exceptions.
|
void |
contextDestroyed(javax.servlet.ServletContextEvent servletContextEvent) |
void |
contextInitialized(javax.servlet.ServletContextEvent servletContextEvent) |
List<String> |
dump() |
ExceptionTimeVault |
getExceptionTimeVault() |
static ExceptionMonitor |
getInstance() |
long |
getTotalNumberOfExceptionsLast01h() |
long |
getTotalNumberOfExceptionsLast05h() |
long |
getTotalNumberOfExceptionsLast24h() |
boolean |
recordException(Throwable throwable)
Stores the given
Throwable and updates the statistic methods like
getTotalNumberOfExceptionsLast01h() . |
static void |
setInstance(ExceptionMonitor instance) |
registerJmxBean, unregisterJmxBean
public boolean recordException(Throwable throwable)
Throwable
and updates the statistic methods like
getTotalNumberOfExceptionsLast01h()
.throwable
- The exception to record.public void clear()
public long getTotalNumberOfExceptionsLast01h()
getTotalNumberOfExceptionsLast01h
in interface ExceptionMonitorMXBean
public long getTotalNumberOfExceptionsLast05h()
getTotalNumberOfExceptionsLast05h
in interface ExceptionMonitorMXBean
public long getTotalNumberOfExceptionsLast24h()
getTotalNumberOfExceptionsLast24h
in interface ExceptionMonitorMXBean
public List<String> aggregateTypesOrderedByFrequency()
aggregateTypesOrderedByFrequency
in interface ExceptionMonitorMXBean
public List<String> dump()
dump
in interface ExceptionMonitorMXBean
public void contextInitialized(javax.servlet.ServletContextEvent servletContextEvent)
contextInitialized
in interface javax.servlet.ServletContextListener
public void contextDestroyed(javax.servlet.ServletContextEvent servletContextEvent)
contextDestroyed
in interface javax.servlet.ServletContextListener
public static ExceptionMonitor getInstance()
public static void setInstance(ExceptionMonitor instance)
public ExceptionTimeVault getExceptionTimeVault()
Copyright © 2018 SAP SE. All rights reserved.