KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > graph > log > NodeLog


1 package org.jbpm.graph.log;
2
3 import java.util.Date JavaDoc;
4
5 import org.jbpm.graph.def.Node;
6 import org.jbpm.logging.log.ProcessLog;
7
8 public class NodeLog extends ProcessLog {
9   
10   private static final long serialVersionUID = 1L;
11   
12   protected Node node = null;
13   protected Date JavaDoc enter = null;
14   protected Date JavaDoc leave = null;
15   protected long duration = -1;
16
17   // constructors /////////////////////////////////////////////////////////////
18

19   public NodeLog() {
20   }
21   
22   public NodeLog(Node node, Date JavaDoc enter, Date JavaDoc leave) {
23     this.node = node;
24     this.enter = enter;
25     this.leave = leave;
26     this.duration = leave.getTime()-enter.getTime();
27   }
28   
29   // getters and setters //////////////////////////////////////////////////////
30

31   public String JavaDoc toString() {
32     return "node["+node.getName()+"]";
33   }
34   public long getDuration() {
35     return duration;
36   }
37   public Date JavaDoc getEnter() {
38     return enter;
39   }
40   public Date JavaDoc getLeave() {
41     return leave;
42   }
43   public Node getNode() {
44     return node;
45   }
46 }
47
Popular Tags