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
Nested ClassesModifier and TypeClassDescriptionstatic classProvides a task comparison based ongetPriority()(higher priorities comes first). -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintOrders according togetPriority()(in descending order, the first is the one with the bigger priority).intgetName()intProvides a task priority, where 0 is the default and tasks having higher values are supposed to be run before the others.voidsetPriority(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:
compareToin interfaceComparable<Runnable>
-