java.lang.Object
javax.swing.SwingWorker<Void,Integer>
org.sm.smtools.application.concurrent.ATask
All Implemented Interfaces:
Runnable, Future<Void>, RunnableFuture<Void>

public abstract class ATask extends SwingWorker<Void,Integer>
The ATask class provides the basic functionality for a task.

Derived classes must implement the executeTask() and finishTask() methods.

Note that this is an abstract class.

Version:
17/06/2014
Author:
Sven Maerivoet
See Also:
  • Constructor Details

    • ATask

      public ATask()
      Constructs an ATask object.
  • Method Details

    • installCountDownLatch

      public final void installCountDownLatch(CountDownLatch countDownLatch)
      Installs the CountDownLatch that is used to synchronise this task.
      Parameters:
      countDownLatch - the CountDownLatch to use for synchronisation
    • installProgressUpdateGlassPane

      public final void installProgressUpdateGlassPane(JProgressUpdateGlassPane progressUpdateGlassPane)
      Installs the AJProgressUpdateGlassPane that is used for progress updates of this task.
      Parameters:
      progressUpdateGlassPane - the JProgressUpdateGlassPane to use for progress updates of this task
    • executeTask

      protected abstract void executeTask()
      This method is called when the task is executed.
    • finishTask

      protected abstract void finishTask()
      This method is called when the task has finished.
    • doInBackground

      protected final Void doInBackground() throws Exception
      Specified by:
      doInBackground in class SwingWorker<Void,Integer>
      Returns:
      -
      Throws:
      Exception - -
    • process

      protected final void process(List<Integer> chunks)
      Overrides:
      process in class SwingWorker<Void,Integer>
    • done

      protected final void done()
      Overrides:
      done in class SwingWorker<Void,Integer>