Fields Summary |
---|
private static final long | oldSerialVersionUID |
private static final long | newSerialVersionUID |
private static final ObjectStreamField[] | oldSerialPersistentFields |
private static final ObjectStreamField[] | newSerialPersistentFields |
private static final long | serialVersionUID |
private static final ObjectStreamField[] | serialPersistentFields |
private static boolean | compat |
private String | type |
private long | sequenceNumber |
private long | timeStamp |
private Object | userData |
private String | message |
protected Object | source This field hides the {@link EventObject#source} field in the
parent class to make it non-transient and therefore part of the
serialized form. |
Constructors Summary |
---|
public Notification(String type, Object source, long sequenceNumber)Creates a Notification object.
The notification timeStamp is set to the current date.
super (source) ;
this.source = source;
this.type = type;
this.sequenceNumber = sequenceNumber ;
this.timeStamp = (new java.util.Date()).getTime() ;
|
public Notification(String type, Object source, long sequenceNumber, String message)Creates a Notification object.
The notification timeStamp is set to the current date.
super (source) ;
this.source = source;
this.type = type;
this.sequenceNumber = sequenceNumber ;
this.timeStamp = (new java.util.Date()).getTime() ;
this.message = message ;
|
public Notification(String type, Object source, long sequenceNumber, long timeStamp)Creates a Notification object.
super (source) ;
this.source = source;
this.type = type ;
this.sequenceNumber = sequenceNumber ;
this.timeStamp = timeStamp ;
|
public Notification(String type, Object source, long sequenceNumber, long timeStamp, String message)Creates a Notification object.
super (source) ;
this.source = source;
this.type = type ;
this.sequenceNumber = sequenceNumber ;
this.timeStamp = timeStamp ;
this.message = message ;
|
Methods Summary |
---|
public java.lang.String | getMessage()Get the notification message.
return message ;
|
public long | getSequenceNumber()Get the notification sequence number.
return sequenceNumber ;
|
public long | getTimeStamp()Get the notification timestamp.
return timeStamp ;
|
public java.lang.String | getType()Get the notification type.
return type ;
|
public java.lang.Object | getUserData()Get the user data.
return userData ;
|
private void | readObject(java.io.ObjectInputStream in)Deserializes a {@link Notification} from an {@link ObjectInputStream}.
// New serial form ignores extra field "sourceObjectName"
in.defaultReadObject();
super.source = source;
|
public void | setSequenceNumber(long sequenceNumber)Set the notification sequence number.
this.sequenceNumber = sequenceNumber;
|
public void | setSource(java.lang.Object source)Sets the source.
super.source = source;
this.source = source;
|
public void | setTimeStamp(long timeStamp)Set the notification timestamp.
this.timeStamp = timeStamp;
|
public void | setUserData(java.lang.Object userData)Set the user data.
this.userData = userData ;
|
public java.lang.String | toString()Returns a String representation of this notification.
return super.toString()+"[type="+type+"][message="+message+"]";
|
private void | writeObject(java.io.ObjectOutputStream out)Serializes a {@link Notification} to an {@link ObjectOutputStream}.
if (compat) {
// Serializes this instance in the old serial form
//
ObjectOutputStream.PutField fields = out.putFields();
fields.put("type", type);
fields.put("sequenceNumber", sequenceNumber);
fields.put("timeStamp", timeStamp);
fields.put("userData", userData);
fields.put("message", message);
fields.put("source", source);
out.writeFields();
} else {
// Serializes this instance in the new serial form
//
out.defaultWriteObject();
}
|