View Javadoc

1   
2   package org.state4j.sm;
3   
4   
5   public class SmActionImpl extends SmActionBaseImpl implements SmAction {
6       private SmExecutor executor;
7   
8       public void execute(SmContext cntx) {
9           if (hasExecutor()) {
10          	getExecutor().execute(cntx);
11          }
12      }
13      public boolean hasExecutor() {
14          return executor != null;
15      }
16  
17      public SmExecutor getExecutor() {
18          if (!hasExecutor()) {
19              throw new RuntimeException("this.executor is null and can't be returned");
20          }
21          return this.executor;
22      }
23  
24      public void setExecutor(SmExecutor executor) {
25          this.executor = executor;
26      }
27  }