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. package javax.management.timer;
  8. /**
  9. * This class provides definitions of the notifications sent by timer MBeans.
  10. * <BR>It defines a timer notification identifier which allows to retrieve a timer notification
  11. * from the list of notifications of a timer MBean.
  12. * <P>
  13. * The timer notifications are created and handled by the timer MBean.
  14. *
  15. * @version 1.26 02/10/04
  16. * @author Sun Microsystems, Inc
  17. *
  18. * @since 1.5
  19. */
  20. public class TimerNotification extends javax.management.Notification {
  21. /* Serial version */
  22. private static final long serialVersionUID = 1798492029603825750L;
  23. /*
  24. * ------------------------------------------
  25. * PRIVATE VARIABLES
  26. * ------------------------------------------
  27. */
  28. /**
  29. * @serial Timer notification identifier.
  30. * This identifier is used to retrieve a timer notification from the timer list of notifications.
  31. */
  32. private Integer notificationID;
  33. /*
  34. * ------------------------------------------
  35. * CONSTRUCTORS
  36. * ------------------------------------------
  37. */
  38. /**
  39. * Creates a timer notification object.
  40. *
  41. * @param type The notification type.
  42. * @param source The notification producer.
  43. * @param sequenceNumber The notification sequence number within the source object.
  44. * @param timeStamp The notification emission date.
  45. * @param msg The notification message.
  46. * @param id The notification identifier.
  47. *
  48. * @since.unbundled JMX 1.2
  49. */
  50. public TimerNotification(String type, Object source, long sequenceNumber, long timeStamp, String msg, Integer id) {
  51. super(type, source, sequenceNumber, timeStamp, msg);
  52. this.notificationID = id;
  53. }
  54. /*
  55. * ------------------------------------------
  56. * PUBLIC METHODS
  57. * ------------------------------------------
  58. */
  59. // GETTERS AND SETTERS
  60. //--------------------
  61. /**
  62. * Gets the identifier of this timer notification.
  63. *
  64. * @return The identifier.
  65. */
  66. public Integer getNotificationID() {
  67. return notificationID;
  68. }
  69. /*
  70. * ------------------------------------------
  71. * PACKAGE METHODS
  72. * ------------------------------------------
  73. */
  74. /**
  75. * Creates and returns a copy of this object.
  76. *
  77. */
  78. Object cloneTimerNotification() {
  79. TimerNotification clone = new TimerNotification(this.getType(), this.getSource(), this.getSequenceNumber(),
  80. this.getTimeStamp(), this.getMessage(), notificationID);
  81. clone.setUserData(this.getUserData());
  82. return clone;
  83. }
  84. }