Class PeriodicTaskExecutor

    • Constructor Detail

      • PeriodicTaskExecutor

        public PeriodicTaskExecutor​(String taskId,
                                    Runnable task,
                                    long secondsBeforeFirstExec,
                                    long secondsBetweenExec)
        Builds an executor for a single 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.
      • PeriodicTaskExecutor

        public PeriodicTaskExecutor​(PeriodicTaskExecutor.PeriodicTask... tasks)
        Builds an executor for a set of tasks.
        Parameters:
        tasks - the task definitions.
    • Method Detail

      • shutdown

        public void shutdown()
        Shuts down the executor, attempting to stop any ongoing task execution.