summaryrefslogtreecommitdiff
path: root/sources/core
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-05-18 20:20:53 +0000
committerPaul Buetow <paul@buetow.org>2008-05-18 20:20:53 +0000
commitace76b508e2f6c1bc420112306ebee52f478de13 (patch)
treeafaba5e0bbaf5a8e063e168ae478eae7f8056407 /sources/core
parent5d50dcd635b9f17eb89688650860730b8e3e859f (diff)
Process Crash and Process Recover Events work with the new Task maanger.
Diffstat (limited to 'sources/core')
-rw-r--r--sources/core/VSTask.java7
-rw-r--r--sources/core/VSTaskManager.java16
2 files changed, 18 insertions, 5 deletions
diff --git a/sources/core/VSTask.java b/sources/core/VSTask.java
index eef2642..503d57e 100644
--- a/sources/core/VSTask.java
+++ b/sources/core/VSTask.java
@@ -47,6 +47,13 @@ public class VSTask implements Comparable {
return false;
}
+ public boolean equals(VSTask task) {
+ return event.equals(task.getEvent())
+ && taskTime == task.getTaskTime()
+ && isGlobalTimed == task.isGlobalTimed()
+ && isProgrammed == task.isProgrammed;
+ }
+
public boolean isProcess(VSProcess process) {
return this.process.equals(process);
}
diff --git a/sources/core/VSTaskManager.java b/sources/core/VSTaskManager.java
index 04cff9d..6683e71 100644
--- a/sources/core/VSTaskManager.java
+++ b/sources/core/VSTaskManager.java
@@ -197,11 +197,17 @@ public class VSTaskManager {
insert(task);
}
- public synchronized void removeTask(VSTask task) {
- if (task.isGlobalTimed())
- globalTasks.remove(task);
- else
- tasks.remove(task);
+ public synchronized boolean removeTask(VSTask task) {
+ if (fullfilledProgrammedTasks.remove(task))
+ return true;
+
+ else if (task.isGlobalTimed() && globalTasks.remove(task))
+ return true;
+
+ else if (!task.isGlobalTimed() && tasks.remove(task))
+ return true;
+
+ return false;
}
public synchronized LinkedList<VSTask> getProtocolTasks(VSProtocol protocol) {