dk.netarkivet.common.lifecycle
Class PeriodicTaskExecutor.PeriodicTask

java.lang.Object
  extended by dk.netarkivet.common.lifecycle.PeriodicTaskExecutor.PeriodicTask
Enclosing class:
PeriodicTaskExecutor

public static class PeriodicTaskExecutor.PeriodicTask
extends java.lang.Object

Represents a periodic task.


Constructor Summary
PeriodicTaskExecutor.PeriodicTask(java.lang.String taskId, java.lang.Runnable task, long secondsBeforeFirstExec, long secondsBetweenExec)
          Builds a new task.
 
Method Summary
(package private)  void setFuture(java.util.concurrent.ScheduledFuture<?> future)
          Set the designated ScheduledFuture object to the one given as argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PeriodicTaskExecutor.PeriodicTask

public PeriodicTaskExecutor.PeriodicTask(java.lang.String taskId,
                                         java.lang.Runnable task,
                                         long secondsBeforeFirstExec,
                                         long secondsBetweenExec)
Builds a new task.

Parameters:
taskId - the task id string (should be unique)
task - the actual Runnable object.
secondsBeforeFirstExec - the delay in seconds between starting the executor and the initial task execution.
secondsBetweenExec - the delay in seconds between two successive task executions.
Method Detail

setFuture

void setFuture(java.util.concurrent.ScheduledFuture<?> future)
Set the designated ScheduledFuture object to the one given as argument.

Parameters:
future - a given ScheduledFuture