public Monitor stop() { if (monData.enabled) { synchronized (monData) { // moved into stop section to support skip. i.e. shouldn't affect avgactive or maxactive if skip is called. // before this was done in start which occurred before skip. if (active >= monData.maxActive) { monData.maxActive = active; if (monData.hasListener(Listeners.MAXACTIVE_LISTENER_INDEX) && active>1) monData.getListener(Listeners.MAXACTIVE_LISTENER_INDEX).processEvent(this); } // being as avgactive needs hits to calculate we don't calculate totalActive till stop is called // hits are tallied in add as it is common behavior to all monitors. monData.stop(active); } } return this; }
if (monData.hasListener(Listeners.MIN_LISTENER_INDEX)) monData.getListener(Listeners.MIN_LISTENER_INDEX).processEvent(this); if (monData.hasListener(Listeners.MAX_LISTENER_INDEX)) monData.getListener(Listeners.MAX_LISTENER_INDEX).processEvent(this); if (monData.hasListener(Listeners.VALUE_LISTENER_INDEX)) monData.getListener(Listeners.VALUE_LISTENER_INDEX).processEvent(this);