/** * @return human readable string. */ public String toString() { StringBuffer buffer = new StringBuffer(100); buffer.append(getClass().getName()).append("@").append(System.identityHashCode(this)).append("{"); buffer.append(" objectName=").append(getObjectName()); buffer.append(" alreadyNotified=").append(getAlreadyNotified()); buffer.append(" threshold=").append(getThreshold()); buffer.append(" derivedGauge=").append(getDerivedGauge()); buffer.append(" derivedGaugeTS=").append(getDerivedGaugeTimeStamp()); buffer.append(" lastValue=").append(getLastValue()); return buffer.append("}").toString(); }
/** * Send an attribute error notification. * * @param object the observedObject. * @param message the human readable message to send. */ void sendAttributeErrorNotification(ObservedObject object, String message) { if (object.notAlreadyNotified(ObservedObject.OBSERVED_ATTRIBUTE_ERROR_NOTIFIED)) sendNotification(object, MonitorNotification.OBSERVED_ATTRIBUTE_ERROR, 0, message, monitor.getObservedAttribute(), null, null); }
/** * Sends the notification * * @param object the observedObject. * @param type the notification type. * @param timestamp the time of the notification. * @param message the human readable message to send. * @param attribute the attribute name. * @param gauge the derived gauge. * @param trigger the trigger value. */ void sendNotification(ObservedObject object, String type, long timestamp, String message, String attribute, Object gauge, Object trigger) { MonitorNotification n = callback.createNotification(type, monitorName, timestamp, message, gauge, attribute, object.getObjectName(), trigger); monitor.sendNotification(n); }
try mbeanInfo = server.getMBeanInfo(object.getObjectName()); try value = server.getAttribute(object.getObjectName(), monitor.getObservedAttribute());
/** * Send a runtime error notification. * * @param object the observedObject. * @param message the human readable message to send. */ void sendRuntimeErrorNotification(ObservedObject object, String message) { if (object.notAlreadyNotified(ObservedObject.RUNTIME_ERROR_NOTIFIED)) sendNotification(object, MonitorNotification.RUNTIME_ERROR, 0, message, monitor.getObservedAttribute(), null, null); }
/** * Send an object error notification. * * @param object the observedObject. * @param message the human readable message to send. */ void sendObjectErrorNotification(ObservedObject object, String message) { if (object.notAlreadyNotified(ObservedObject.OBSERVED_OBJECT_ERROR_NOTIFIED)) sendNotification(object, MonitorNotification.OBSERVED_OBJECT_ERROR, 0, message, monitor.getObservedAttribute(), null, null); }
/** * Send an attribute type error notification. * * @param object the observedObject. * @param message the human readable message to send. */ void sendAttributeTypeErrorNotification(ObservedObject object, String message) { if (object.notAlreadyNotified(ObservedObject.OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED)) sendNotification(object, MonitorNotification.OBSERVED_ATTRIBUTE_TYPE_ERROR, 0, message, monitor.getObservedAttribute(), null, null); }