22 |
} |
} |
23 |
|
|
24 |
protected volatile boolean abort = false;//mark volatile to make sure value isn't cached by threads |
protected volatile boolean abort = false;//mark volatile to make sure value isn't cached by threads |
25 |
protected TaskState state = TaskState.STATE_QUEUED; |
protected volatile TaskState state = TaskState.STATE_QUEUED; |
26 |
protected TaskManager manager; |
protected TaskManager manager; |
27 |
private String errorMsg; |
private String errorMsg; |
28 |
|
|
49 |
|
|
50 |
try { |
try { |
51 |
taskRun(); |
taskRun(); |
52 |
this.state = TaskState.STATE_DONE; |
|
53 |
|
if (this.state != TaskState.STATE_ABORTED) { //just to make sure we wasn't aborted |
54 |
|
this.state = TaskState.STATE_DONE; |
55 |
|
} |
56 |
|
|
57 |
|
|
58 |
} catch (Exception e) { |
} catch (Exception e) { |
59 |
this.errorMsg = e.getMessage(); |
this.errorMsg = e.getMessage(); |
60 |
e.printStackTrace(); |
e.printStackTrace(); |