KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > management > timer > TimerNotification


1 /*
2  * @(#)TimerNotification.java 1.26 04/02/10
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.management.timer;
9
10 /**
11  * This class provides definitions of the notifications sent by timer MBeans.
12  * <BR>It defines a timer notification identifier which allows to retrieve a timer notification
13  * from the list of notifications of a timer MBean.
14  * <P>
15  * The timer notifications are created and handled by the timer MBean.
16  *
17  * @version 1.26 02/10/04
18  * @author Sun Microsystems, Inc
19  *
20  * @since 1.5
21  */

22 public class TimerNotification extends javax.management.Notification JavaDoc {
23
24
25     /* Serial version */
26     private static final long serialVersionUID = 1798492029603825750L;
27
28     /*
29      * ------------------------------------------
30      * PRIVATE VARIABLES
31      * ------------------------------------------
32      */

33     
34     /**
35      * @serial Timer notification identifier.
36      * This identifier is used to retrieve a timer notification from the timer list of notifications.
37      */

38     private Integer JavaDoc notificationID;
39
40     
41     /*
42      * ------------------------------------------
43      * CONSTRUCTORS
44      * ------------------------------------------
45      */

46     
47     /**
48      * Creates a timer notification object.
49      *
50      * @param type The notification type.
51      * @param source The notification producer.
52      * @param sequenceNumber The notification sequence number within the source object.
53      * @param timeStamp The notification emission date.
54      * @param msg The notification message.
55      * @param id The notification identifier.
56      *
57      * @since.unbundled JMX 1.2
58      */

59     public TimerNotification(String JavaDoc type, Object JavaDoc source, long sequenceNumber, long timeStamp, String JavaDoc msg, Integer JavaDoc id) {
60         
61         super(type, source, sequenceNumber, timeStamp, msg);
62         this.notificationID = id;
63     }
64     
65     /*
66      * ------------------------------------------
67      * PUBLIC METHODS
68      * ------------------------------------------
69      */

70     
71     // GETTERS AND SETTERS
72
//--------------------
73

74     /**
75      * Gets the identifier of this timer notification.
76      *
77      * @return The identifier.
78      */

79     public Integer JavaDoc getNotificationID() {
80         return notificationID;
81     }
82
83     /*
84      * ------------------------------------------
85      * PACKAGE METHODS
86      * ------------------------------------------
87      */

88     
89     /**
90      * Creates and returns a copy of this object.
91      *
92      */

93     Object JavaDoc cloneTimerNotification() {
94         
95         TimerNotification JavaDoc clone = new TimerNotification JavaDoc(this.getType(), this.getSource(), this.getSequenceNumber(),
96                                                         this.getTimeStamp(), this.getMessage(), notificationID);
97         clone.setUserData(this.getUserData());
98         return clone;
99     }
100 }
101
Popular Tags