Package org.cyclos.impl.messaging
Class BaseEntityNotificationProcessingPollingTask
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractGlobalServerComponent
-
- org.cyclos.impl.utils.tasks.AbstractTask
-
- org.cyclos.impl.utils.tasks.AbstractPollingTask
-
- org.cyclos.impl.utils.tasks.SimplePollingTask
-
- org.cyclos.impl.messaging.BaseEntityNotificationProcessingPollingTask
-
- All Implemented Interfaces:
Runnable,PollingTask,HasMessageKey
- Direct Known Subclasses:
TransactionNotificationProcessingPollingTask,TransferNotificationProcessingPollingTask
public abstract class BaseEntityNotificationProcessingPollingTask extends SimplePollingTask
Base polling task associated to a givenNotificationProcessingEntityTypeused to read all entities marked as pending-notification.
For each entity it:- Generates a new
EntityNotificationProcessingBackgroundTaskexecution; - Marks the entity as processed.
EntityNotificationProcessingBackgroundTaskexecution, will read the entity and process the corresponding notifications for it.
-
-
Field Summary
Fields Modifier and Type Field Description protected static intBATCH_SIZE-
Fields inherited from class org.cyclos.impl.utils.tasks.AbstractTask
clusterHandler, 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 BaseEntityNotificationProcessingPollingTask()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected longexecute()Executes the task batch.PollingTaskFirstExecutiongetFirstExecution()Returns the polling task first executionprotected abstract NotificationProcessingEntityType<?>getNotificationProcessingEntityType()-
Methods inherited from class org.cyclos.impl.utils.tasks.SimplePollingTask
doRun, isRunInTransaction, notifyIssueToLicense, notifyIssueToLicense
-
Methods inherited from class org.cyclos.impl.utils.tasks.AbstractPollingTask
getRecurrence, getStorage, isVerbose, logName, run, toString
-
Methods inherited from class org.cyclos.impl.utils.tasks.AbstractTask
getLogConfiguration, getName, logTaskError, logTaskSuccess, resolveName, shouldGenerateErrorLog
-
Methods inherited from class org.cyclos.impl.AbstractGlobalServerComponent
getBaseEntityManagerHandler, getEntityManager
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, dataTranslationProxy, delete, detach, doDataTranslationProxy, 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.utils.HasMessageKey
getMessageKey
-
Methods inherited from interface org.cyclos.impl.utils.tasks.PollingTask
getName
-
-
-
-
Field Detail
-
BATCH_SIZE
protected static final int BATCH_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getFirstExecution
public PollingTaskFirstExecution getFirstExecution()
Description copied from interface:PollingTaskReturns the polling task first execution- Specified by:
getFirstExecutionin interfacePollingTask- Overrides:
getFirstExecutionin 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
-
getNotificationProcessingEntityType
protected abstract NotificationProcessingEntityType<?> getNotificationProcessingEntityType()
-
-