Package org.cyclos.impl.system
Class RunScheduledPollingTask
-
- All Implemented Interfaces:
Runnable,PollingTask
@Component public class RunScheduledPollingTask extends SimplePollingTask
APollingTaskwhich starts running custom scheduled tasks
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.utils.tasks.AbstractTask
errorLogService, invokerHandler, loggingHandler
-
Fields inherited from class org.cyclos.impl.AbstractGlobalServerComponent
rawEntityManagerHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
-
Constructor Summary
Constructors Constructor Description RunScheduledPollingTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected longexecute()Executes the task batch.DategetFirstExecution()Returns the first execution time for this polling taskStringgetName()Returns the task nameDategetNextExecution()Returns the next time the task should be executed-
Methods inherited from class org.cyclos.impl.utils.tasks.SimplePollingTask
doRun, isRunInTransaction
-
Methods inherited from class org.cyclos.impl.utils.tasks.AbstractPollingTask
dateFromDelay, getInitialSleepSeconds, getSecondsUntilNextDay, getSecondsUntilNextHour, getSleepSeconds, getStorage, initialize, isExclusiveInCluster, run
-
Methods inherited from class org.cyclos.impl.utils.tasks.AbstractTask
getLogConfiguration, logName, logTaskError, logTaskSuccess, shouldGenerateErrorLog, toString
-
Methods inherited from class org.cyclos.impl.AbstractGlobalServerComponent
getBaseEntityManagerHandler, getEntityManager
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, delete, detach, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
-
-
-
Method Detail
-
getFirstExecution
public Date getFirstExecution()
Description copied from interface:PollingTaskReturns the first execution time for this polling task- Specified by:
getFirstExecutionin interfacePollingTask- Overrides:
getFirstExecutionin classAbstractPollingTask
-
getName
public String getName()
Description copied from interface:PollingTaskReturns the task name- Specified by:
getNamein interfacePollingTask- Specified by:
getNamein classAbstractTask
-
getNextExecution
public Date getNextExecution()
Description copied from interface:PollingTaskReturns the next time the task should be executed- Specified by:
getNextExecutionin interfacePollingTask- Overrides:
getNextExecutionin classAbstractPollingTask
-
execute
protected long execute() throws ThrowableDescription copied from class:SimplePollingTaskExecutes the task batch. This method must be idempotent, which means that subsequent invocations should not cause side effects. For example, a task could expire data up to the current hour. If executed several times within any given hour, only the first execution should change data, while others should not affect anything. Should return the number of affected records- Specified by:
executein classSimplePollingTask- Throws:
Throwable
-
-