01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08:
09: package javax.management.monitor;
10:
11: import javax.management.Notification;
12: import javax.management.ObjectName;
13:
14: /**
15: * @version $Revision: 1.8 $
16: */
17: public class MonitorNotification extends Notification {
18: private static final long serialVersionUID = -4608189663661929204L;
19:
20: public static final String OBSERVED_ATTRIBUTE_ERROR = "jmx.monitor.error.attribute";
21: public static final String OBSERVED_ATTRIBUTE_TYPE_ERROR = "jmx.monitor.error.type";
22: public static final String OBSERVED_OBJECT_ERROR = "jmx.monitor.error.mbean";
23: public static final String RUNTIME_ERROR = "jmx.monitor.error.runtime";
24: public static final String STRING_TO_COMPARE_VALUE_DIFFERED = "jmx.monitor.string.differs";
25: public static final String STRING_TO_COMPARE_VALUE_MATCHED = "jmx.monitor.string.matches";
26: public static final String THRESHOLD_ERROR = "jmx.monitor.error.threshold";
27: public static final String THRESHOLD_HIGH_VALUE_EXCEEDED = "jmx.monitor.gauge.high";
28: public static final String THRESHOLD_LOW_VALUE_EXCEEDED = "jmx.monitor.gauge.low";
29: public static final String THRESHOLD_VALUE_EXCEEDED = "jmx.monitor.counter.threshold";
30:
31: private final ObjectName observedObject;
32: private final String observedAttribute;
33: private final Object derivedGauge;
34: private final Object trigger;
35:
36: MonitorNotification(String type, Object source,
37: long sequenceNumber, long timeStamp, String message,
38: ObjectName monitoredName, String attribute, Object gauge,
39: Object trigger) {
40: super (type, source, sequenceNumber, timeStamp, message);
41: this .observedObject = monitoredName;
42: this .observedAttribute = attribute;
43: this .derivedGauge = gauge;
44: this .trigger = trigger;
45: }
46:
47: public ObjectName getObservedObject() {
48: return observedObject;
49: }
50:
51: public Object getDerivedGauge() {
52: return derivedGauge;
53: }
54:
55: public String getObservedAttribute() {
56: return observedAttribute;
57: }
58:
59: public Object getTrigger() {
60: return trigger;
61: }
62:
63: public String toString() {
64: StringBuffer buffer = new StringBuffer("[");
65: buffer.append(super .toString()).append(", ");
66: buffer.append("observed=").append(getObservedObject()).append(
67: ", ");
68: buffer.append("gauge=").append(getDerivedGauge()).append(", ");
69: buffer.append("attribute=").append(getObservedAttribute())
70: .append(", ");
71: buffer.append("trigger=").append(getTrigger()).append("]");
72: return buffer.toString();
73: }
74: }
|