Package org.cyclos.impl.utils.tasks
Interface RecurringTask
-
- All Superinterfaces:
HasMessageKey,Runnable
public interface RecurringTask extends Runnable, HasMessageKey
A RecurringTask is a task which keeps looking for available data to be processed. By definition, RecurringTasks should be idempotent, that is, running the same task over and over again should only process data which hasn't been processed yet.
Each RecurringTask runs in a task scheduler, and are scheduled on Cyclos startup. A RecurringTask should resolve its first execution date and then the next execution date. However, a RecurringTask can be awaken by services. So, if a service knows something will be immediately available for processing, it can use theRecurringTaskHandler.scheduleAwake(Class)method. The will cause the recurring task to run right after the service transaction is committed. This is important, because if the task would run before the service transaction commits, it wouldn't probably find the data to be processed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RecurringTaskFirstExecutiongetFirstExecution()Returns the recurring task first executionStringgetName()Returns the task nameStringgetNotesForLogging()Returns an optional text to be logged only server-side at start upRecurringTaskRecurrencegetRecurrence()Return the recurring task recurrence-
Methods inherited from interface org.cyclos.utils.HasMessageKey
getMessageKey
-
-
-
-
Method Detail
-
getFirstExecution
RecurringTaskFirstExecution getFirstExecution()
Returns the recurring task first execution
-
getName
String getName()
Returns the task name
-
getNotesForLogging
String getNotesForLogging()
Returns an optional text to be logged only server-side at start up
-
getRecurrence
RecurringTaskRecurrence getRecurrence()
Return the recurring task recurrence
-
-