org.opensubsystems.patterns.backgroundtask.util
Class BackgroundTask

java.lang.Object
  extended by java.util.TimerTask
      extended by org.opensubsystems.patterns.backgroundtask.util.BackgroundTask
All Implemented Interfaces:
java.lang.Runnable

public abstract class BackgroundTask
extends java.util.TimerTask

Background task is base class for all tasks which should be run in the background, that is without user interaction, to execute its functionality.

Version:
$Id: BackgroundTask.java,v 1.3 2007/01/07 06:15:03 bastafidli Exp $
Author:
Miro Halas
Code reviewer:
Miro Halas
Code reviewed:
Initial revision

Field Summary
protected  java.lang.Integer m_runEvery
          How often to run this task
protected  org.opensubsystems.core.util.SetupReader m_setupReader
          Reader to read configuration for this task.
protected  java.lang.Integer m_startDelay
          Delay from creation of the task to first invocation
protected  java.lang.String m_strTaskDescription
          Description of the task, will show in the gui.
 
Constructor Summary
BackgroundTask(java.lang.String strTaskDescription, org.opensubsystems.core.util.SetupReader setupReader)
          Default constructor
 
Method Summary
 int getRunEvery()
          Get value which tells it how often this task should be run.
 org.opensubsystems.core.util.SetupReader getSetupReader()
          Get setup reader used to read properties for this task.
 int getStartDelay()
          Get initial delay from the time when the task is created to the time when it is first run.
 
Methods inherited from class java.util.TimerTask
cancel, run, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_strTaskDescription

protected java.lang.String m_strTaskDescription
Description of the task, will show in the gui.


m_setupReader

protected org.opensubsystems.core.util.SetupReader m_setupReader
Reader to read configuration for this task.


m_startDelay

protected java.lang.Integer m_startDelay
Delay from creation of the task to first invocation


m_runEvery

protected java.lang.Integer m_runEvery
How often to run this task

Constructor Detail

BackgroundTask

public BackgroundTask(java.lang.String strTaskDescription,
                      org.opensubsystems.core.util.SetupReader setupReader)
Default constructor

Parameters:
strTaskDescription - - description of the task, will show in the gui
setupReader - - reader to read configuration for this task. Must also implement BackgroundTaskSetupReader interface
Method Detail

getSetupReader

public org.opensubsystems.core.util.SetupReader getSetupReader()
Get setup reader used to read properties for this task. It must implement BackgroundTaskSetupReader interface.

Returns:
SetupReader - reader implementing BackgroundTaskSetupReader interface

getStartDelay

public int getStartDelay()
Get initial delay from the time when the task is created to the time when it is first run.

Returns:
int - value in seconds

getRunEvery

public int getRunEvery()
Get value which tells it how often this task should be run.

Returns:
int - value in seconds


Copyright © 2003 - 2006 OpenSubsystems s.r.o.