Source Code Cross Referenced for Notification.java in  » JMX » mx4j » javax » management » 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 » mx4j » javax.management 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (C) The MX4J Contributors.
003:         * All rights reserved.
004:         *
005:         * This software is distributed under the terms of the MX4J License version 1.0.
006:         * See the terms of the MX4J License in the documentation provided with this software.
007:         */
008:
009:        package javax.management;
010:
011:        import java.io.IOException;
012:        import java.io.ObjectInputStream;
013:        import java.util.EventObject;
014:
015:        /**
016:         * Notifications are events emitted by {@link NotificationEmitter}s
017:         *
018:         * @version $Revision: 1.8 $
019:         */
020:        public class Notification extends EventObject {
021:            private static final long serialVersionUID = -7516092053498031989L;
022:
023:            /**
024:             * @serial The notification type
025:             */
026:            private String type;
027:            /**
028:             * @serial The notification sequence number
029:             */
030:            private long sequenceNumber;
031:            /**
032:             * @serial The notification timestamp
033:             */
034:            private long timeStamp;
035:            /**
036:             * @serial The notification message
037:             */
038:            private String message;
039:            /**
040:             * @serial The notification user data
041:             */
042:            private Object userData;
043:            /**
044:             * A duplicate for the existing data member in EventObject: this one is not transient and should hold only
045:             * ObjectNames (so they are Serializable and can be sent along the wire for remote notifications), and it's
046:             * protected and not private for a mistake in JMX 1.0, but for binary compatibility we leave it protected.
047:             *
048:             * @serial The ObjectName of the emitter MBean
049:             */
050:            protected Object source;
051:
052:            /**
053:             * Convenience constructor for <code>Notification(type, source, sequenceNumber, System.currentTimeMillis(), null)</code>
054:             *
055:             * @see #Notification(String, Object, long, long, String)
056:             */
057:            public Notification(String type, Object source, long sequenceNumber) {
058:                this (type, source, sequenceNumber, System.currentTimeMillis(),
059:                        null);
060:            }
061:
062:            /**
063:             * Convenience constructor for <code>Notification(type, source, sequenceNumber, timestamp, null)</code>
064:             *
065:             * @see #Notification(String, Object, long, long, String)
066:             */
067:            public Notification(String type, Object source,
068:                    long sequenceNumber, long timeStamp) {
069:                this (type, source, sequenceNumber, timeStamp, null);
070:            }
071:
072:            /**
073:             * Convenience constructor for <code>Notification(type, source, sequenceNumber, System.currentTimeMillis(), message)</code>
074:             *
075:             * @see #Notification(String, Object, long, long, String)
076:             */
077:            public Notification(String type, Object source,
078:                    long sequenceNumber, String message) {
079:                this (type, source, sequenceNumber, System.currentTimeMillis(),
080:                        message);
081:            }
082:
083:            /**
084:             * Creates a new Notification
085:             *
086:             * @param type           The notification type
087:             * @param source         The ObjectName of the emitter MBean
088:             * @param sequenceNumber The Notification sequence number
089:             * @param timeStamp      The notification timestamp
090:             * @param message        The Notification message
091:             */
092:            public Notification(String type, Object source,
093:                    long sequenceNumber, long timeStamp, String message) {
094:                // Data member source of EventObject is transient
095:                super (source);
096:                this .source = source;
097:                this .type = type;
098:                this .sequenceNumber = sequenceNumber;
099:                this .timeStamp = timeStamp;
100:                this .message = message;
101:            }
102:
103:            /**
104:             * Returns the notification message
105:             */
106:            public String getMessage() {
107:                return message;
108:            }
109:
110:            /**
111:             * Returns the notification type
112:             */
113:            public String getType() {
114:                return type;
115:            }
116:
117:            /**
118:             * Returns the notification source
119:             *
120:             * @see #setSource
121:             */
122:            public Object getSource() {
123:                return this .source;
124:            }
125:
126:            /**
127:             * Sets the notification source
128:             *
129:             * @see #getSource
130:             */
131:            public void setSource(Object source) {
132:                this .source = source;
133:            }
134:
135:            /**
136:             * Returns the notification sequence number
137:             *
138:             * @see #setSequenceNumber
139:             */
140:            public long getSequenceNumber() {
141:                return sequenceNumber;
142:            }
143:
144:            /**
145:             * Sets the notification sequence number
146:             *
147:             * @see #getSequenceNumber
148:             */
149:            public void setSequenceNumber(long sequenceNumber) {
150:                this .sequenceNumber = sequenceNumber;
151:            }
152:
153:            /**
154:             * Returns the notification timestamp
155:             *
156:             * @see #setTimeStamp
157:             */
158:            public long getTimeStamp() {
159:                return timeStamp;
160:            }
161:
162:            /**
163:             * Sets the notification timestamp
164:             *
165:             * @see #getTimeStamp
166:             */
167:            public void setTimeStamp(long timeStamp) {
168:                this .timeStamp = timeStamp;
169:            }
170:
171:            /**
172:             * Returns the notification user data
173:             *
174:             * @see #setUserData
175:             */
176:            public Object getUserData() {
177:                return userData;
178:            }
179:
180:            /**
181:             * Sets the notification user data
182:             *
183:             * @see #getUserData
184:             */
185:            public void setUserData(Object userData) {
186:                this .userData = userData;
187:            }
188:
189:            public String toString() {
190:                StringBuffer b = new StringBuffer("[");
191:                b.append("source=").append(getSource()).append(", ");
192:                b.append("message=").append(getMessage()).append(", ");
193:                b.append("sequence=").append(getSequenceNumber()).append(", ");
194:                b.append("type=").append(getType()).append(", ");
195:                b.append("time=").append(getTimeStamp()).append(", ");
196:                b.append("data=").append(getUserData());
197:                b.append("]");
198:                return b.toString();
199:            }
200:
201:            private void readObject(ObjectInputStream in) throws IOException,
202:                    ClassNotFoundException {
203:                in.defaultReadObject();
204:                // EventObject data member is transient
205:                super.source = source;
206:            }
207:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.