KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > scheduler > def > CancelTimerAction


1 package org.jbpm.scheduler.def;
2
3 import org.dom4j.Element;
4 import org.jbpm.graph.def.Action;
5 import org.jbpm.graph.exe.ExecutionContext;
6 import org.jbpm.jpdl.xml.JpdlXmlReader;
7
8 public class CancelTimerAction extends Action {
9
10   private static final long serialVersionUID = 1L;
11   
12   String JavaDoc timerName = null;
13   
14   public void read(Element actionElement, JpdlXmlReader jpdlReader) {
15     timerName = actionElement.attributeValue("name");
16     if (timerName==null) {
17       jpdlReader.addWarning("no 'name' specified in CancelTimerAction '"+actionElement.asXML()+"'");
18     }
19   }
20
21   public void execute(ExecutionContext executionContext) throws Exception JavaDoc {
22     executionContext.getSchedulerInstance().cancel(timerName, executionContext.getToken());
23   }
24   
25   public String JavaDoc getTimerName() {
26     return timerName;
27   }
28   public void setTimerName(String JavaDoc timerName) {
29     this.timerName = timerName;
30   }
31 }
32
Popular Tags