BrightSide Workbench Full Report + Source Code
elephant/src/main/java/org/turro/queue/AbstractTask.java
Go to the documentation of this file.
1
/*
2
* TurrĂ³ i Cutiller Foundation. License notice.
3
* Copyright (C) 2015 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU Affero General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Affero General Public License for more details.
14
*
15
* You should have received a copy of the GNU Affero General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
package
org.turro.queue;
20
21
import
java.util.Date;
22
27
public
abstract
class
AbstractTask
implements
Task
{
28
29
protected
String
label
, image, message;
30
protected
boolean
reintent
=
false
;
31
protected
Date
call
, execution;
32
protected
TaskStatus
status
=
TaskStatus
.
TASK_PENDING
;
33
34
@Override
35
public
String
getLabel
() {
36
return
label
;
37
}
38
39
public
void
setLabel
(String
label
) {
40
this.label =
label
;
41
}
42
43
@Override
44
public
String
getImage
() {
45
return
image;
46
}
47
48
public
void
setImage
(String image) {
49
this.image = image;
50
}
51
52
@Override
53
public
String
getMessage
() {
54
return
message;
55
}
56
57
public
void
setMessage
(String message) {
58
this.message = message;
59
}
60
61
@Override
62
public
boolean
isReintent
() {
63
return
reintent
;
64
}
65
66
public
void
setReintent
(
boolean
reintent
) {
67
this.reintent =
reintent
;
68
}
69
70
@Override
71
public
Date
getCall
() {
72
return
call
;
73
}
74
75
@Override
76
public
Date
getExecution
() {
77
return
execution;
78
}
79
80
@Override
81
public
TaskStatus
getStatus
() {
82
return
status
;
83
}
84
85
public
void
setStatus
(
TaskStatus
status
) {
86
this.status =
status
;
87
}
88
89
@Override
90
public
boolean
isInterrupted
() {
91
return
Tasks
.
isInterrupted
();
92
}
93
94
public
abstract
boolean
doExecute
();
95
96
@Override
97
public
void
execute
() {
98
status
=
TaskStatus
.
TASK_EXECUTING
;
99
if
(
doExecute
()) {
100
execution =
new
Date();
101
status
=
TaskStatus
.
TASK_SUCCEDED
;
102
}
else
{
103
execution =
new
Date();
104
status
=
TaskStatus
.
TASK_FAILED
;
105
}
106
Tasks
.
execute
();
107
}
108
109
}
org.turro.queue.AbstractTask
Definition:
elephant/src/main/java/org/turro/queue/AbstractTask.java:27
org.turro.queue.AbstractTask.status
TaskStatus status
Definition:
elephant/src/main/java/org/turro/queue/AbstractTask.java:32
org.turro.queue.AbstractTask.getImage
String getImage()
Definition:
elephant/src/main/java/org/turro/queue/AbstractTask.java:44
org.turro.queue.AbstractTask.setLabel
void setLabel(String label)
Definition:
elephant/src/main/java/org/turro/queue/AbstractTask.java:39
org.turro.queue.AbstractTask.isInterrupted
boolean isInterrupted()
Definition:
elephant/src/main/java/org/turro/queue/AbstractTask.java:90
org.turro.queue.AbstractTask.label
String label
Definition:
elephant/src/main/java/org/turro/queue/AbstractTask.java:29
org.turro.queue.AbstractTask.isReintent
boolean isReintent()
Definition:
elephant/src/main/java/org/turro/queue/AbstractTask.java:62
org.turro.queue.AbstractTask.doExecute
abstract boolean doExecute()
org.turro.queue.AbstractTask.setMessage
void setMessage(String message)
Definition:
elephant/src/main/java/org/turro/queue/AbstractTask.java:57
org.turro.queue.AbstractTask.call
Date call
Definition:
elephant/src/main/java/org/turro/queue/AbstractTask.java:31
org.turro.queue.AbstractTask.getMessage
String getMessage()
Definition:
elephant/src/main/java/org/turro/queue/AbstractTask.java:53
org.turro.queue.AbstractTask.reintent
boolean reintent
Definition:
elephant/src/main/java/org/turro/queue/AbstractTask.java:30
org.turro.queue.AbstractTask.setStatus
void setStatus(TaskStatus status)
Definition:
elephant/src/main/java/org/turro/queue/AbstractTask.java:85
org.turro.queue.AbstractTask.execute
void execute()
Definition:
elephant/src/main/java/org/turro/queue/AbstractTask.java:97
org.turro.queue.AbstractTask.getLabel
String getLabel()
Definition:
elephant/src/main/java/org/turro/queue/AbstractTask.java:35
org.turro.queue.AbstractTask.setImage
void setImage(String image)
Definition:
elephant/src/main/java/org/turro/queue/AbstractTask.java:48
org.turro.queue.AbstractTask.setReintent
void setReintent(boolean reintent)
Definition:
elephant/src/main/java/org/turro/queue/AbstractTask.java:66
org.turro.queue.AbstractTask.getStatus
TaskStatus getStatus()
Definition:
elephant/src/main/java/org/turro/queue/AbstractTask.java:81
org.turro.queue.AbstractTask.getExecution
Date getExecution()
Definition:
elephant/src/main/java/org/turro/queue/AbstractTask.java:76
org.turro.queue.AbstractTask.getCall
Date getCall()
Definition:
elephant/src/main/java/org/turro/queue/AbstractTask.java:71
org.turro.queue.Tasks
Definition:
Elephant/elephant/src/main/java/org/turro/queue/Tasks.java:29
org.turro.queue.Tasks.isInterrupted
static boolean isInterrupted()
Definition:
Elephant/elephant/src/main/java/org/turro/queue/Tasks.java:52
org.turro.queue.Tasks.execute
static void execute()
Definition:
Elephant/elephant/src/main/java/org/turro/queue/Tasks.java:38
org.turro.queue.TaskStatus
Definition:
Elephant/elephant/src/main/java/org/turro/queue/TaskStatus.java:25
org.turro.queue.TaskStatus.TASK_FAILED
TASK_FAILED
Definition:
Elephant/elephant/src/main/java/org/turro/queue/TaskStatus.java:30
org.turro.queue.TaskStatus.TASK_PENDING
TASK_PENDING
Definition:
Elephant/elephant/src/main/java/org/turro/queue/TaskStatus.java:27
org.turro.queue.TaskStatus.TASK_EXECUTING
TASK_EXECUTING
Definition:
Elephant/elephant/src/main/java/org/turro/queue/TaskStatus.java:28
org.turro.queue.TaskStatus.TASK_SUCCEDED
TASK_SUCCEDED
Definition:
Elephant/elephant/src/main/java/org/turro/queue/TaskStatus.java:29
org.turro.queue.Task
Definition:
Elephant/elephant/src/main/java/org/turro/queue/Task.java:27
TurroProjects
Public
Elephant
elephant
src
main
java
org
turro
queue
AbstractTask.java
Generated on Tue Mar 12 2024 07:01:17 for BrightSide by
1.9.1