DESY ACOP Beans Home

com.cosylab.util
Class AbstractSchedulerTask

java.lang.Object
  extended by com.cosylab.util.AbstractSchedulerTask
All Implemented Interfaces:
SchedulerTask, java.lang.Runnable

public abstract class AbstractSchedulerTask
extends java.lang.Object
implements SchedulerTask

This is a convenience implementation of SchedulerTask interface.

Version:
$id$
Author:
Ales Pucelj

Constructor Summary
AbstractSchedulerTask(java.lang.String taskName, long taskInterval)
          Creates a new AbstractSchedulerTask object.
 
Method Summary
 void cancel()
          Mark this task to be canceled.
 long getInterval()
          Returns interval between executions.
 java.lang.String getTaskName()
          Returns name of this task.
 boolean isCanceled()
          Returns whether cancel() has been called.
 void setTaskName(java.lang.String taskName)
          Set new name for this task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cosylab.util.SchedulerTask
run
 

Constructor Detail

AbstractSchedulerTask

public AbstractSchedulerTask(java.lang.String taskName,
                             long taskInterval)
Creates a new AbstractSchedulerTask object.

Parameters:
taskName - DOCUMENT ME!
taskInterval - DOCUMENT ME!
Method Detail

cancel

public void cancel()
Mark this task to be canceled.

Specified by:
cancel in interface SchedulerTask
See Also:
SchedulerTask.cancel()

isCanceled

public boolean isCanceled()
Returns whether cancel() has been called.

Specified by:
isCanceled in interface SchedulerTask
Returns:
True if the task should be destroyed.
See Also:
SchedulerTask.isCanceled()

setTaskName

public void setTaskName(java.lang.String taskName)
Set new name for this task.

Parameters:
taskName - Name of task.

getTaskName

public java.lang.String getTaskName()
Description copied from interface: SchedulerTask
Returns name of this task. This name is for informative purposes only. Can be null. If specified it can aid in debugging, since the thread executing this task can be identified.

Specified by:
getTaskName in interface SchedulerTask
Returns:
Name Name of this task or null.
See Also:
SchedulerTask.getTaskName()

getInterval

public long getInterval()
Returns interval between executions. If negative, indicates this task should execute immediatelly.

Specified by:
getInterval in interface SchedulerTask
Returns:
Time in miliseconds.
See Also:
SchedulerTask.getInterval()


Copyright © 2010. All Rights Reserved.