Author: mmichaud
Date: 2009-08-04 08:06:59 -0700 (Tue, 04 Aug 2009)
New Revision: 17682
Added:
core3/cmdline-parser-impl/trunk/src/main/java/org/cytoscape/cmdline/internal/TaskExecutor.java
Log:
use of SuperTask to launch asynchronously the tasks
Added:
core3/cmdline-parser-impl/trunk/src/main/java/org/cytoscape/cmdline/internal/TaskExecutor.java
===================================================================
---
core3/cmdline-parser-impl/trunk/src/main/java/org/cytoscape/cmdline/internal/TaskExecutor.java
(rev 0)
+++
core3/cmdline-parser-impl/trunk/src/main/java/org/cytoscape/cmdline/internal/TaskExecutor.java
2009-08-04 15:06:59 UTC (rev 17682)
@@ -0,0 +1,37 @@
+package org.cytoscape.cmdline.internal;
+
+import org.cytoscape.work.SuperTask;
+import org.cytoscape.work.Task;
+import org.cytoscape.work.TaskFactory;
+import org.cytoscape.work.TaskManager;
+import org.cytoscape.work.TunableInterceptor;
+
+public class TaskExecutor{
+
+ public TaskExecutor(){};
+
+ Task[] tasks;
+ TaskManager tm;
+ int i=0;
+
+ public void setNumberOfTasks(int val){
+ tasks = new Task[val];
+ }
+
+
+ public void intercept(TaskFactory tf,TunableInterceptor ti, TaskManager
tm){
+ this.tm = tm;
+ Task task = tf.getTask();
+ ti.loadTunables(task);
+ if ( !ti.createUI(task) )
+ return;
+ tasks[i]=task;
+ i++;
+ }
+
+ public void execute(){
+ SuperTask superTask = new SuperTask("SuperTask",tasks);
+ tm.execute(superTask);
+ }
+
+}
\ No newline at end of file
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en
-~----------~----~----~----~------~----~------~--~---