1 23 24 package javax.resource.spi.work; 25 26 import java.lang.Object ; 27 import java.lang.Runnable ; 28 import java.lang.Exception ; 29 import java.lang.Throwable ; 30 import java.util.EventObject ; 31 32 39 public class WorkEvent extends EventObject { 40 41 44 public static final int WORK_ACCEPTED = 1; 45 46 49 public static final int WORK_REJECTED = 2; 50 51 54 public static final int WORK_STARTED = 3; 55 56 59 public static final int WORK_COMPLETED = 4; 60 61 64 private int type; 65 66 69 private Work work; 70 71 74 private WorkException exc; 75 76 79 private long startDuration = WorkManager.UNKNOWN; 80 81 96 public WorkEvent(Object source, int type, Work work, WorkException exc) { 97 super(source); 98 this.type = type; 99 this.work = work; 100 this.exc = exc; 101 } 102 103 120 public WorkEvent(Object source, int type, Work work, WorkException exc, 121 long startDuration) { 122 this(source, type, work, exc); 123 this.startDuration = startDuration; 124 } 125 126 131 public int getType() { return this.type; } 132 133 138 public Work getWork() { return this.work; } 139 140 148 public long getStartDuration() { return this.startDuration; } 149 150 158 public WorkException getException() { return this.exc; } 159 } 160 | Popular Tags |