diff options
| author | Paul Buetow <paul@buetow.org> | 2008-06-03 16:41:37 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-06-03 16:41:37 +0000 |
| commit | 11af1c9fa7fe66e10de0a92878311b4e22befb0f (patch) | |
| tree | 8dfc7af2ec18eb5889327426bc6fdb7379a3feba /sources/events/internal/VSMessageReceiveEvent.java | |
| parent | f7bdf8a7f6ebd43bfacc22eeeda3eb52bf50efd7 (diff) | |
made future serialized class versions backwards compatible.
Diffstat (limited to 'sources/events/internal/VSMessageReceiveEvent.java')
| -rw-r--r-- | sources/events/internal/VSMessageReceiveEvent.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/sources/events/internal/VSMessageReceiveEvent.java b/sources/events/internal/VSMessageReceiveEvent.java index 0cffa86..8972ce5 100644 --- a/sources/events/internal/VSMessageReceiveEvent.java +++ b/sources/events/internal/VSMessageReceiveEvent.java @@ -23,9 +23,12 @@ package events.internal; +import java.io.*; + import core.VSMessage; import events.VSAbstractEvent; import protocols.VSAbstractProtocol; +import serialize.VSSerialize; /** * The class VSMessageReceiveEvent. This event is used if a process receives @@ -106,4 +109,41 @@ public class VSMessageReceiveEvent extends VSAbstractEvent { return true; } + + /* (non-Javadoc) + * @see serialize.VSSerializable#serialize(serialize.VSSerialize, + * java.io.ObjectOutputStream) + */ + public synchronized void serialize(VSSerialize serialize, + ObjectOutputStream objectOutputStream) + throws IOException { + super.serialize(serialize, objectOutputStream); + + /** For later backwards compatibility, to add more stuff */ + objectOutputStream.writeObject(new Boolean(false)); + + /** For later backwards compatibility, to add more stuff */ + objectOutputStream.writeObject(new Boolean(false)); + } + + /* (non-Javadoc) + * @see serialize.VSSerializable#deserialize(serialize.VSSerialize, + * java.io.ObjectInputStream) + */ + @SuppressWarnings("unchecked") + public synchronized void deserialize(VSSerialize serialize, + ObjectInputStream objectInputStream) + throws IOException, ClassNotFoundException { + super.deserialize(serialize, objectInputStream); + + if (VSSerialize.DEBUG) + System.out.println("Deserializing: VSProtocolEvent"); + + /** For later backwards compatibility, to add more stuff */ + objectInputStream.readObject(); + + /** For later backwards compatibility, to add more stuff */ + objectInputStream.readObject(); + + } } |
