Class BatchServiceTask

java.lang.Object
uk.ac.ebi.utils.threading.BatchServiceTask
All Implemented Interfaces:
Comparable<Runnable>, Runnable

public abstract class BatchServiceTask extends Object implements Runnable, Comparable<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
  • Field Details

    • name

      protected String name
    • exitCode

      protected int exitCode
    • log

      protected org.slf4j.Logger log
  • Constructor Details

    • BatchServiceTask

      protected BatchServiceTask(String name)
  • Method Details

    • getExitCode

      public int getExitCode()
    • getName

      public String 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 override BatchService.newThreadPoolExecutor(int).
    • setPriority

      public void setPriority(int priority)
    • compareTo

      public int compareTo(Runnable o)
      Orders according to getPriority() (in descending order, the first is the one with the bigger priority).
      Specified by:
      compareTo in interface Comparable<Runnable>