summaryrefslogtreecommitdiff
path: root/sources/core/VSTask.java
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-06-11 09:48:10 +0000
committerPaul Buetow <paul@buetow.org>2008-06-11 09:48:10 +0000
commit0e2e70d5a393024f3ae4a3a3560b4df51075000a (patch)
tree27c659d282bec3508304d5fa80a34a1662185950 /sources/core/VSTask.java
parent412a1ac0e6311fe39452ae41b6eada4ef17cce34 (diff)
More javadoc.
Several bugfixes. New feauture: Boolean: sim.periodic A lot of more which i forgot!
Diffstat (limited to 'sources/core/VSTask.java')
-rw-r--r--sources/core/VSTask.java31
1 files changed, 28 insertions, 3 deletions
diff --git a/sources/core/VSTask.java b/sources/core/VSTask.java
index c1323e8..9ca04e6 100644
--- a/sources/core/VSTask.java
+++ b/sources/core/VSTask.java
@@ -99,7 +99,7 @@ public class VSTask implements Comparable, VSSerializable {
* Instantiates a new task during a deserialization.
*
* @param serialize the serialize object
- * @param process the object input stream
+ * @param objectInputStream The input stream
*/
public VSTask(VSSerialize serialize, ObjectInputStream objectInputStream)
throws IOException, ClassNotFoundException {
@@ -154,11 +154,29 @@ public class VSTask implements Comparable, VSSerializable {
}
/**
+ * Checks if the task is using an "internal event".
+ *
+ * @return true, if the task is using an internal event
+ */
+ public boolean hasInternalEvent() {
+ return event instanceof VSAbstractInternalEvent;
+ }
+
+ /**
+ * Checks if the task should not get serialized.
+ *
+ * @return true, if the task should not get serialized
+ */
+ public boolean hasNotSerializableEvent() {
+ return event instanceof VSNotSerializable;
+ }
+
+ /**
* Checks if the task is a message receive event.
*
* @return true, if it is a message receive event
*/
- public boolean isVSMessageReceiveEvent() {
+ public boolean hasMessageReceiveEvent() {
return event instanceof VSMessageReceiveEvent;
}
@@ -167,7 +185,7 @@ public class VSTask implements Comparable, VSSerializable {
*
* @return true, if it is a process recover event
*/
- public boolean isProcessRecoverEvent() {
+ public boolean hasProcessRecoverEvent() {
return event instanceof VSProcessRecoverEvent;
}
@@ -366,6 +384,13 @@ public class VSTask implements Comparable, VSSerializable {
objectOutputStream.writeObject(new Boolean(false));
objectOutputStream.writeObject(new Integer(process.getProcessNum()));
+
+ if (event.getClassname() == null)
+ event.init(process);
+
+ if (VSSerialize.DEBUG)
+ System.out.println("Serializing: " + event.getClassname());
+
objectOutputStream.writeObject(event.getClassname());
objectOutputStream.writeObject(new Integer(event.getID()));
event.serialize(serialize, objectOutputStream);