KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > soto > state > helpers > CompositeStep


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

19 public abstract class CompositeStep extends ExecContainer
20   implements ObjectHandlerIF, Step {
21   public CompositeStep() {
22   }
23
24   /**
25    * @see org.sapia.soto.state.ExecContainer#execute(Result)
26    */

27   public void execute(Result res) {
28     if (doExecute(res)) {
29       if (res.isError()) {
30         return;
31       } else if (res.getNextStateId() != null) {
32         return;
33       } else {
34         super.execute(res);
35       }
36     }
37   }
38
39   protected abstract boolean doExecute(Result res);
40
41   /**
42    * @see org.sapia.util.xml.confix.ObjectHandlerIF#handleObject(java.lang.String, java.lang.Object)
43    */

44   public void handleObject(String JavaDoc name, Object JavaDoc obj)
45     throws ConfigurationException {
46     if (obj instanceof Step) {
47       super.addExecutable((Step) obj);
48     }
49   }
50 }
51
Popular Tags