Package org.cyclos.impl.utils.tasks
Class AbstractBackgroundTask
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractGlobalServerComponent
-
- org.cyclos.impl.utils.tasks.AbstractTask
-
- org.cyclos.impl.utils.tasks.AbstractBackgroundTask
-
- All Implemented Interfaces:
BackgroundTask
- Direct Known Subclasses:
ArchiveAccountFeeLogBackgroundTask,BulkActionProcessingBackgroundTask,ChargeAccountFeeBatchBackgroundTask,DispatchAccountFeeChargesBackgroundTask,ExternalPaymentBackgroundTask,ImportBackgroundTask,IndexEntitiesBackgroundTask,InlineScriptBackgroundTask,ResetRatesBackgroundTask,RunScheduledBackgroundTask
public abstract class AbstractBackgroundTask extends AbstractTask implements BackgroundTask
Abstract implementation forBackgroundTask
-
-
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 AbstractBackgroundTask()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract longdoExecute(String context)Must be implemented to actually execute the task logic, returning the number of affected recordsvoidexecute(String context)Executes the background task with the given context.-
Methods inherited from class org.cyclos.impl.utils.tasks.AbstractTask
getLogConfiguration, getName, 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.cyclos.impl.utils.tasks.BackgroundTask
getName
-
-
-
-
Method Detail
-
execute
public final void execute(String context)
Description copied from interface:BackgroundTaskExecutes the background task with the given context. Shouldn't throw errors. Tasks are expected to log either their successes or failures.- Specified by:
executein interfaceBackgroundTask
-
doExecute
protected abstract long doExecute(String context)
Must be implemented to actually execute the task logic, returning the number of affected records
-
-