Package uk.ac.ebi.utils.threading
Class BatchServiceTask
java.lang.Object
uk.ac.ebi.utils.threading.BatchServiceTask
- All Implemented Interfaces:
Comparable<Runnable>
,Runnable
Used by
BatchService
. It's essentially a Runnable
with some utility stuff, such as an exit code and
a task name.
- date
- 8 Oct 2013
- Author:
- Marco Brandizi
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Provides a task comparison based ongetPriority()
(higher priorities comes first). -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Orders according togetPriority()
(in descending order, the first is the one with the bigger priority).int
getName()
int
Provides a task priority, where 0 is the default and tasks having higher values are supposed to be run before the others.void
setPriority
(int priority)
-
Field Details
-
name
-
exitCode
protected int exitCode -
log
protected org.slf4j.Logger log
-
-
Constructor Details
-
BatchServiceTask
-
-
Method Details
-
getExitCode
public int getExitCode() -
getName
-
getPriority
public int getPriority()Provides a task priority, where 0 is the default and tasks having higher values are supposed to be run before the others. This is ignored unless you overrideBatchService.newThreadPoolExecutor(int)
. -
setPriority
public void setPriority(int priority) -
compareTo
Orders according togetPriority()
(in descending order, the first is the one with the bigger priority).- Specified by:
compareTo
in interfaceComparable<Runnable>
-