home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-tomcat-addon-1.4.9-installer.exe / jmx.jar / javax / management / Notification.class (.txt) < prev    next >
Encoding:
Java Class File  |  2002-10-28  |  3.1 KB  |  94 lines

  1. package javax.management;
  2.  
  3. import java.io.IOException;
  4. import java.io.ObjectInputStream;
  5. import java.util.EventObject;
  6.  
  7. public class Notification extends EventObject {
  8.    private static final long serialVersionUID = -7516092053498031989L;
  9.    private String type;
  10.    private long sequenceNumber;
  11.    private long timeStamp;
  12.    private String message;
  13.    private Object userData;
  14.    protected Object source;
  15.  
  16.    public Notification(String type, Object source, long sequenceNumber) {
  17.       this(type, source, sequenceNumber, System.currentTimeMillis(), (String)null);
  18.    }
  19.  
  20.    public Notification(String type, Object source, long sequenceNumber, long timeStamp) {
  21.       this(type, source, sequenceNumber, timeStamp, (String)null);
  22.    }
  23.  
  24.    public Notification(String type, Object source, long sequenceNumber, String message) {
  25.       this(type, source, sequenceNumber, System.currentTimeMillis(), message);
  26.    }
  27.  
  28.    public Notification(String type, Object source, long sequenceNumber, long timeStamp, String message) {
  29.       super(source);
  30.       this.source = source;
  31.       this.type = type;
  32.       this.sequenceNumber = sequenceNumber;
  33.       this.timeStamp = timeStamp;
  34.       this.message = message;
  35.    }
  36.  
  37.    public String getMessage() {
  38.       return this.message;
  39.    }
  40.  
  41.    public long getSequenceNumber() {
  42.       return this.sequenceNumber;
  43.    }
  44.  
  45.    public long getTimeStamp() {
  46.       return this.timeStamp;
  47.    }
  48.  
  49.    public String getType() {
  50.       return this.type;
  51.    }
  52.  
  53.    public Object getUserData() {
  54.       return this.userData;
  55.    }
  56.  
  57.    public void setUserData(Object userData) {
  58.       this.userData = userData;
  59.    }
  60.  
  61.    public void setSequenceNumber(long sequenceNumber) {
  62.       this.sequenceNumber = sequenceNumber;
  63.    }
  64.  
  65.    public void setSource(Object source) {
  66.       this.source = source;
  67.    }
  68.  
  69.    public void setTimeStamp(long timeStamp) {
  70.       this.timeStamp = timeStamp;
  71.    }
  72.  
  73.    public Object getSource() {
  74.       return this.source;
  75.    }
  76.  
  77.    public String toString() {
  78.       StringBuffer b = new StringBuffer("[");
  79.       b.append("source=").append(this.getSource()).append(", ");
  80.       b.append("message=").append(this.getMessage()).append(", ");
  81.       b.append("sequence=").append(this.getSequenceNumber()).append(", ");
  82.       b.append("type=").append(this.getType()).append(", ");
  83.       b.append("time=").append(this.getTimeStamp()).append(", ");
  84.       b.append("data=").append(this.getUserData());
  85.       b.append("]");
  86.       return b.toString();
  87.    }
  88.  
  89.    private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
  90.       in.defaultReadObject();
  91.       super.source = this.source;
  92.    }
  93. }
  94.