reset results in debug monitors breaking...
Monitor Java applications - SQL, HTTP, Methods, Exceptions and more.
Brought to you by:
stevesouza
When you reset monitors via UI or programmatically, the reset method only impacts production (or non-debug) monitors. i.e. if you have debug monitors that are present and you reset the monitors the debug monitors will never show up again. As such i took a quick look at the code, and it looks like the reset method in the MonitorFactory.java class should be something like:
public static void reset() {
if (isEnabled() && isDebugEnabled())
enabledFactory = debugFactory = factory = new FactoryEnabled();
else if (isEnabled())
enabledFactory = factory = new FactoryEnabled();
else {
//do nothing...
}
}
I tried this out and it seemed to work fine...
-Nick
Logged In: YES
user_id=828052
Originator: NO
This method should initialize the object to its default state, so I propose executing the same code in the static initializer....
public static void reset() {
if (isEnabled())
init();
}
private static void init() {
// enable the factory by default.
factory = debugFactory = enabledFactory = new FactoryEnabled();
disabledFactory = new FactoryDisabled(enabledFactory);
}