/** * Fire this value monitor. Delegates to AbstractMonitor.process(). */ public void fire() { process(); } }
/** * Optionally allows for inheritable attributes. * * @param name the name of the monitor * @param value the value * @param includeInheritables set to true if this monitor should support inheritables * @param monitoringLevel monitoring level */ public ValueMonitor(String name, double value, boolean includeInheritables, MonitoringLevel monitoringLevel) { // note we are calling this specific constructor on AbstractMonitor to avoid // the call to init() on AbstractMonitor super(); this.monitoringLevel = monitoringLevel; // perform standard monitor initialization optionally ommitting inheritable // attributes - this is a performance optimization targeted towards a potentially // costly step in monitor construction (inheritable attributes) MonitoringEngine.getInstance().initMonitor(this, includeInheritables); // also intentionally skip the created lifecycle step as this is not a // meaningful event/unnecessary overhead for ValueMonitor //MonitoringEngine.getInstance().monitorCreated(this); set(Attribute.NAME, name).lock(); set(Attribute.VALUE, value).lock(); }