KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > taskman > DummyTask


1 package org.sapia.taskman;
2
3 /**
4  * @author Yanick Duchesne 15-Apr-2003
5  * <dl>
6  * <dt><b>Copyright: </b>
7  * <dd>Copyright &#169; 2002-2004 <a
8  * HREF="http://www.sapia-oss.org">Sapia Open Source Software </a>. All
9  * Rights Reserved.</dd>
10  * </dt>
11  * <dt><b>License: </b>
12  * <dd>Read the license.txt file of the jar or visit the <a
13  * HREF="http://www.sapia-oss.org/license.html">license page </a> at the
14  * Sapia OSS web site</dd>
15  * </dt>
16  * </dl>
17  */

18 public class DummyTask implements Task {
19   private boolean _nested;
20
21   /**
22    * Constructor for DummyTask.
23    */

24   public DummyTask(boolean nested) {
25     super();
26     _nested = nested;
27   }
28
29   /**
30    * @see org.sapia.taskman.Task#exec(TaskContext)
31    */

32   public void exec(TaskContext ctx) {
33     if(!_nested) {
34       ctx.getTaskOutput().info("I am running " + _nested);
35       ctx.execSyncNestedTask("nested", new DummyTask(true));
36     } else {
37       ctx.getTaskOutput().info("I am running " + _nested);
38     }
39   }
40 }
41
Popular Tags