001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package javax.management.timer;
023:
024: import javax.management.Notification;
025:
026: /**
027: * A notification from the timer service.
028: *
029: * @author <a href="mailto:Adrian.Brock@HappeningTimes.com">Adrian Brock</a>
030: * @version $Revision: 57200 $
031: *
032: * <p><b>Revisions:</b>
033: * <p><b>20020816 Adrian Brock:</b>
034: * <ul>
035: * <li> Serialization </li>
036: * </ul>
037: */
038: public class TimerNotification extends Notification {
039: // Constants -----------------------------------------------------
040:
041: // Attributes ----------------------------------------------------
042:
043: /**
044: * The notification id of this timer notification.
045: */
046: private Integer notificationID;
047:
048: // Static --------------------------------------------------------
049:
050: private static final long serialVersionUID = 1798492029603825750L;
051:
052: // Constructors --------------------------------------------------
053:
054: /**
055: * Construct a new timer notification.
056: *
057: * @param type the notification type.
058: * @param source the notification source.
059: * @param sequenceNumber the notification sequence within the source object.
060: * @param timeStamp the time the notification was sent.
061: * @param message the detailed message.
062: * @param id the timer notification id.
063: * @param userData additional notification user data
064: */
065: public TimerNotification(String type, Object source,
066: long sequenceNumber, long timeStamp, String message,
067: Integer id) {
068: super (type, source, sequenceNumber, timeStamp, message);
069: this .notificationID = id;
070: }
071:
072: // Public --------------------------------------------------------
073:
074: /**
075: * Retrieves the notification id of this timer notification.
076: *
077: * @return the notification id.
078: */
079: public Integer getNotificationID() {
080: return notificationID;
081: }
082:
083: // X implementation ----------------------------------------------
084:
085: // Notification overrides ----------------------------------------
086:
087: /**
088: * @return human readable string.
089: */
090: public String toString() {
091: StringBuffer buffer = new StringBuffer(100);
092: buffer.append(getClass().getName()).append(":");
093: buffer.append(" type=").append(getType());
094: buffer.append(" source=").append(getSource());
095: buffer.append(" sequence=").append(getSequenceNumber());
096: buffer.append(" time=").append(getTimeStamp());
097: buffer.append(" message=").append(getMessage());
098: buffer.append(" id=").append(getNotificationID());
099: buffer.append(" userData=").append(getUserData());
100: return buffer.toString();
101: }
102:
103: // Package protected ---------------------------------------------
104:
105: // Protected -----------------------------------------------------
106:
107: // Private -------------------------------------------------------
108:
109: // Inner classes -------------------------------------------------
110: }
|