Package de.hybris.platform.task.impl
Class DefaultScheduleAndTriggerStrategy
- java.lang.Object
-
- de.hybris.platform.task.impl.DefaultScheduleAndTriggerStrategy
-
- All Implemented Interfaces:
ScheduleAndTriggerStrategy
public class DefaultScheduleAndTriggerStrategy extends java.lang.Object implements ScheduleAndTriggerStrategy
-
-
Constructor Summary
Constructors Constructor Description DefaultScheduleAndTriggerStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddisableNestedTransactions(SessionContext loclCtx)protected voiddoScheduleInTransaction(TaskModel task)protected voidfinishScheduleTaskWithConditions(TaskModel task, java.util.Date scheduledExecutionDate)protected booleaninsertEventConditionOrRetryMatch(TaskEvent event)Returns true if repolling tasks makes senseprotected voidinsertScheduleConditionOrRetryMatch(TaskModel task, PK taskPK, TaskConditionModel cond)protected booleanisIgnorableScheduleConditionException(TaskConditionModel condition, java.lang.Exception e)protected voidprepareScheduleTaskWithConditions(TaskModel task)protected booleanretryMatchConditionForEvent(TaskEvent event)protected voidretryMatchConditionForSchedule(TaskConditionModel cond, PK taskPK, ModelSavingException creationExcpetion)voidscheduleTask(TaskModel task)Schedules a new task.protected voidscheduleTaskInternal(TaskModel task)protected voidscheduleTaskWithConditions(TaskModel task)protected voidscheduleTaskWithoutConditions(TaskModel task)voidsetModelService(ModelService modelService)voidsetTaskDao(TaskDAO dao)booleantriggerEvent(TaskEvent event)Triggers a task event.booleantriggerEvent(java.lang.String uniqueId)Triggers a task event.booleantriggerEvent(java.lang.String uniqueId, java.util.Date expirationDate)Triggers a task event.protected booleantriggerEventInTransaction(TaskEvent event)
-
-
-
Method Detail
-
triggerEvent
public boolean triggerEvent(TaskEvent event)
Description copied from interface:ScheduleAndTriggerStrategyTriggers a task event.- Specified by:
triggerEventin interfaceScheduleAndTriggerStrategy- Parameters:
event- event to be triggered- Returns:
trueif operation succeeded orfalseif event has been already triggered
-
triggerEventInTransaction
protected boolean triggerEventInTransaction(TaskEvent event)
-
insertEventConditionOrRetryMatch
protected boolean insertEventConditionOrRetryMatch(TaskEvent event)
Returns true if repolling tasks makes sense
-
retryMatchConditionForEvent
protected boolean retryMatchConditionForEvent(TaskEvent event)
-
isIgnorableScheduleConditionException
protected boolean isIgnorableScheduleConditionException(TaskConditionModel condition, java.lang.Exception e)
-
triggerEvent
public boolean triggerEvent(java.lang.String uniqueId)
Description copied from interface:ScheduleAndTriggerStrategyTriggers a task event.- Specified by:
triggerEventin interfaceScheduleAndTriggerStrategy- Returns:
- true if re-polling on this node is advisable based on the result of the trigger operation
-
triggerEvent
public boolean triggerEvent(java.lang.String uniqueId, java.util.Date expirationDate)Description copied from interface:ScheduleAndTriggerStrategyTriggers a task event.- Specified by:
triggerEventin interfaceScheduleAndTriggerStrategy- Parameters:
uniqueId- id of eventexpirationDate- expiration date for event
-
scheduleTask
public void scheduleTask(TaskModel task)
Description copied from interface:ScheduleAndTriggerStrategySchedules a new task.- Specified by:
scheduleTaskin interfaceScheduleAndTriggerStrategy
-
scheduleTaskInternal
protected void scheduleTaskInternal(TaskModel task)
-
doScheduleInTransaction
protected void doScheduleInTransaction(TaskModel task)
-
scheduleTaskWithoutConditions
protected void scheduleTaskWithoutConditions(TaskModel task)
-
scheduleTaskWithConditions
protected void scheduleTaskWithConditions(TaskModel task)
-
finishScheduleTaskWithConditions
protected void finishScheduleTaskWithConditions(TaskModel task, java.util.Date scheduledExecutionDate)
-
prepareScheduleTaskWithConditions
protected void prepareScheduleTaskWithConditions(TaskModel task)
-
insertScheduleConditionOrRetryMatch
protected void insertScheduleConditionOrRetryMatch(TaskModel task, PK taskPK, TaskConditionModel cond)
-
retryMatchConditionForSchedule
protected void retryMatchConditionForSchedule(TaskConditionModel cond, PK taskPK, ModelSavingException creationExcpetion)
-
disableNestedTransactions
protected void disableNestedTransactions(SessionContext loclCtx)
-
setModelService
public void setModelService(ModelService modelService)
-
setTaskDao
public void setTaskDao(TaskDAO dao)
- Specified by:
setTaskDaoin interfaceScheduleAndTriggerStrategy
-
-