Source Code Cross Referenced for MonitorNotification.java in  » JMX » jfoxmx » javax » management » monitor » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » JMX » jfoxmx » javax.management.monitor 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* JFox, the OpenSource J2EE Application Server
002:         *
003:         * Copyright (C) 2002 huihoo.org
004:         * Distributable under GNU LGPL license
005:         * See the GNU Lesser General Public License for more details.
006:         */
007:
008:        package javax.management.monitor;
009:
010:        import javax.management.ObjectName;
011:        import javax.management.Notification;
012:
013:        /**
014:         * Provides definitions of the notifications sent by monitor MBeans.
015:         * <P>
016:         * The notification source and a set of parameters concerning the monitor MBean's state
017:         * need to be specified when creating a new object of this class.
018:         *
019:         * The list of notifications fired by the monitor MBeans is the following:
020:         *
021:         * <UL>
022:         * <LI>Common to all kind of monitors:
023:         *     <UL>
024:         *     <LI>The observed object is not registered in the MBean server.
025:         *     <LI>The observed attribute is not contained in the observed object.
026:         *     <LI>The type of the observed attribute is not correct.
027:         *     <LI>Any exception (except the cases described above) occurs when trying to get the value of the observed attribute.
028:         *     </UL>
029:         * <LI>Common to the counter and the gauge monitors:
030:         *     <UL>
031:         *     <LI>The threshold high or threshold low are not of the same type as the gauge (gauge monitors).
032:         *     <LI>The threshold or the offset or the modulus are not of the same type as the counter (counter monitors).
033:         *     </UL>
034:         * <LI>Counter monitors only:
035:         *     <UL>
036:         *     <LI>The observed attribute has reached the threshold value.
037:         *     </UL>
038:         * <LI>Gauge monitors only:
039:         *     <UL>
040:         *     <LI>The observed attribute has exceeded the threshold high value.
041:         *     <LI>The observed attribute has exceeded the threshold low value.
042:         *     </UL>
043:         * <LI>String monitors only:
044:         *     <UL>
045:         *     <LI>The observed attribute has matched the "string to compare" value.
046:         *     <LI>The observed attribute has differed from the "string to compare" value.
047:         *     </UL>
048:         * </UL>
049:         *
050:         * @author <a href="mailto:young_yy@hotmail.org">Young Yang</a>
051:         */
052:
053:        public class MonitorNotification extends Notification {
054:
055:            /**
056:             * Notification type denoting that the observed object is not registered in the MBean server.
057:             * This notification is fired by all kinds of monitors.
058:             * <BR>The value of this notification type is <CODE>jmx.monitor.error.mbean</CODE>.
059:             */
060:            public static final String OBSERVED_OBJECT_ERROR = "jmx.monitor.error.mbean";
061:
062:            /**
063:             * Notification type denoting that the observed attribute is not contained in the observed object.
064:             * This notification is fired by all kinds of monitors.
065:             * <BR>The value of this notification type is <CODE>jmx.monitor.error.attribute</CODE>.
066:             */
067:            public static final String OBSERVED_ATTRIBUTE_ERROR = "jmx.monitor.error.attribute";
068:
069:            /**
070:             * Notification type denoting that the type of the observed attribute is not correct.
071:             * This notification is fired by all kinds of monitors.
072:             * <BR>The value of this notification type is <CODE>jmx.monitor.error.type</CODE>.
073:             */
074:            public static final String OBSERVED_ATTRIBUTE_TYPE_ERROR = "jmx.monitor.error.type";
075:
076:            /**
077:             * Notification type denoting that the type of the thresholds, offset or modulus is not correct.
078:             * This notification is fired by counter and gauge monitors.
079:             * <BR>The value of this notification type is <CODE>jmx.monitor.error.threshold</CODE>.
080:             */
081:            public static final String THRESHOLD_ERROR = "jmx.monitor.error.threshold";
082:
083:            /**
084:             * Notification type denoting that a non-predefined error type has occurred when trying to get the value of the observed attribute.
085:             * This notification is fired by all kinds of monitors.
086:             * <BR>The value of this notification type is <CODE>jmx.monitor.error.runtime</CODE>.
087:             */
088:            public static final String RUNTIME_ERROR = "jmx.monitor.error.runtime";
089:
090:            /**
091:             * Notification type denoting that the observed attribute has reached the threshold value.
092:             * This notification is only fired by counter monitors.
093:             * <BR>The value of this notification type is <CODE>jmx.monitor.counter.threshold</CODE>.
094:             */
095:            public static final String THRESHOLD_VALUE_EXCEEDED = "jmx.monitor.counter.threshold";
096:
097:            /**
098:             * Notification type denoting that the observed attribute has exceeded the threshold high value.
099:             * This notification is only fired by gauge monitors.
100:             * <BR>The value of this notification type is <CODE>jmx.monitor.gauge.high</CODE>.
101:             */
102:            public static final String THRESHOLD_HIGH_VALUE_EXCEEDED = "jmx.monitor.gauge.high";
103:
104:            /**
105:             * Notification type denoting that the observed attribute has exceeded the threshold low value.
106:             * This notification is only fired by gauge monitors.
107:             * <BR>The value of this notification type is <CODE>jmx.monitor.gauge.low</CODE>.
108:             */
109:            public static final String THRESHOLD_LOW_VALUE_EXCEEDED = "jmx.monitor.gauge.low";
110:
111:            /**
112:             * Notification type denoting that the observed attribute has matched the "string to compare" value.
113:             * This notification is only fired by string monitors.
114:             * <BR>The value of this notification type is <CODE>jmx.monitor.string.matches</CODE>.
115:             */
116:            public static final String STRING_TO_COMPARE_VALUE_MATCHED = "jmx.monitor.string.matches";
117:
118:            /**
119:             * Notification type denoting that the observed attribute has differed from the "string to compare" value.
120:             * This notification is only fired by string monitors.
121:             * <BR>The value of this notification type is <CODE>jmx.monitor.string.differs</CODE>.
122:             */
123:            public static final String STRING_TO_COMPARE_VALUE_DIFFERED = "jmx.monitor.string.differs";
124:
125:            private ObjectName observedObject = null;
126:            private String observedAttribute = null;
127:            private Object derivedGauge = null;
128:            private Object trigger = null;
129:
130:            /**
131:             * Creates a monitor notification object.
132:             *
133:             * @param type The notification type.
134:             * @param source The notification producer.
135:             * @param sequenceNumber The notification sequence number within the source object.
136:             * @param timeStamp The notification emission date.
137:             * @param message The notification message.
138:             * @param observedObjectName The object observed by the producer of this notification.
139:             * @param observedAttribute The attribute observed by the producer of this notification.
140:             * @param derivedValue The derived gauge.
141:             * @param trigger The threshold/string (depending on the monitor type) that triggered the notification.
142:             */
143:            MonitorNotification(String type, Object source,
144:                    long sequenceNumber, long timeStamp, String message,
145:                    ObjectName observedObjectName, String observedAttribute,
146:                    Object derivedValue, Object trigger) {
147:                super (type, source, sequenceNumber, timeStamp, message);
148:                observedObject = observedObjectName;
149:                this .observedAttribute = observedAttribute;
150:                derivedGauge = derivedValue;
151:                this .trigger = trigger;
152:            }
153:
154:            /**
155:             * Gets the observed object of this monitor notification.
156:             *
157:             * @return The observed object.
158:             */
159:            public ObjectName getObservedObject() {
160:                return observedObject;
161:            }
162:
163:            /**
164:             * Gets the observed attribute of this monitor notification.
165:             *
166:             * @return The observed attribute.
167:             */
168:            public String getObservedAttribute() {
169:                return observedAttribute;
170:            }
171:
172:            /**
173:             * Gets the derived gauge of this monitor notification.
174:             *
175:             * @return The derived gauge.
176:             */
177:            public Object getDerivedGauge() {
178:                return derivedGauge;
179:            }
180:
181:            /**
182:             * Gets the threshold/string (depending on the monitor type) that triggered off this monitor notification.
183:             *
184:             * @return The trigger.
185:             */
186:            public Object getTrigger() {
187:                return trigger;
188:            }
189:
190:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.