Package org.cyclos.impl.utils.tasks
Class BackgroundTaskHandlerImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractGlobalServerComponent
-
- org.cyclos.impl.BaseGlobalHandlerImpl
-
- org.cyclos.impl.utils.tasks.BackgroundTaskHandlerImpl
-
- All Implemented Interfaces:
ApplicationInitializationListener,BackgroundTaskHandler,BackgroundTaskHandlerImplementor
@Component public class BackgroundTaskHandlerImpl extends BaseGlobalHandlerImpl implements BackgroundTaskHandlerImplementor, ApplicationInitializationListener
Implementation forBackgroundTaskHandler
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.AbstractGlobalServerComponent
rawEntityManagerHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
Fields inherited from interface org.cyclos.impl.ApplicationInitializationListener
MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description BackgroundTaskHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(Long id)Executes the task nowbooleanisScheduledOrRunning(Class<? extends BackgroundTask> type, Long entityId)Returns whether the given background task type, with the given entity id as context, is either scheduled for execution or currently runnnigbooleanisScheduledOrRunning(Class<? extends BackgroundTask> type, String context)Returns whether the given background task type, with the given context, is either scheduled for execution or currently runnnigvoidonApplicationInitialization()Invoked when the application service is initializedvoidschedule(Class<? extends BackgroundTask> type, Long entityId)Schedules aBackgroundTaskexecution with the given entity id as a contextvoidschedule(Class<? extends BackgroundTask> type, String context)Schedules aBackgroundTaskexecution with the given context-
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, toString, wait, wait, wait
-
Methods inherited from interface org.cyclos.impl.ApplicationInitializationListener
applicationInitializationPriority, getInitializationId
-
-
-
-
Method Detail
-
execute
public void execute(Long id)
Description copied from interface:BackgroundTaskHandlerImplementorExecutes the task now- Specified by:
executein interfaceBackgroundTaskHandlerImplementor
-
isScheduledOrRunning
public boolean isScheduledOrRunning(Class<? extends BackgroundTask> type, Long entityId)
Description copied from interface:BackgroundTaskHandlerReturns whether the given background task type, with the given entity id as context, is either scheduled for execution or currently runnnig- Specified by:
isScheduledOrRunningin interfaceBackgroundTaskHandler
-
isScheduledOrRunning
public boolean isScheduledOrRunning(Class<? extends BackgroundTask> type, String context)
Description copied from interface:BackgroundTaskHandlerReturns whether the given background task type, with the given context, is either scheduled for execution or currently runnnig- Specified by:
isScheduledOrRunningin interfaceBackgroundTaskHandler
-
onApplicationInitialization
public void onApplicationInitialization()
Description copied from interface:ApplicationInitializationListenerInvoked when the application service is initialized- Specified by:
onApplicationInitializationin interfaceApplicationInitializationListener
-
schedule
public void schedule(Class<? extends BackgroundTask> type, Long entityId)
Description copied from interface:BackgroundTaskHandlerSchedules aBackgroundTaskexecution with the given entity id as a context- Specified by:
schedulein interfaceBackgroundTaskHandler
-
schedule
public void schedule(Class<? extends BackgroundTask> type, String context)
Description copied from interface:BackgroundTaskHandlerSchedules aBackgroundTaskexecution with the given context- Specified by:
schedulein interfaceBackgroundTaskHandler
-
-