Class DefaultTriggerService
java.lang.Object
de.hybris.platform.servicelayer.cronjob.impl.DefaultTriggerService
- All Implemented Interfaces:
TriggerService
Default implementation of the trigger service.
- Since:
- 4.3
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intignored value for time, interval, max acceptable waits -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(TriggerModel trigger) Executes the assignedJobModelusing the assignedCronJobModelif the next activation time ((@link TriggerModel#getActivationTime()} is less or equal than the current system time.booleanactivateForTest(TriggerModel trigger, long currentTime) Returns aListof all Triggers, whose next activation time (TriggerService.getNextTime(TriggerModel, Calendar)lies before the current system time.getActiveTriggers(Calendar calendar) Returns aListof all Triggers, whose next activation time (TriggerService.getNextTime(TriggerModel, Calendar)lies before the specified calendar date.getNextTime(TriggerModel trigger, Calendar relativeTo) Returns the next activation time for theTriggerModelin relation to the specified calendar.intReturns a time interval at which trigger activation is fired.voidsetCronJobService(CronJobService cronJobService) voidsetI18NService(I18NService i18nService) voidsetModelService(ModelService modelService) voidsetPulseSeconds(int interval) Sets a time interval at which trigger activation is fired.voidsetSessionService(SessionService sessionService) voidsetTriggerDao(TriggerDao triggerDao)
-
Field Details
-
IGNORE_VALUE
public static final int IGNORE_VALUEignored value for time, interval, max acceptable waits- See Also:
-
-
Constructor Details
-
DefaultTriggerService
public DefaultTriggerService()
-
-
Method Details
-
setCronJobService
-
setModelService
-
setTriggerDao
-
setI18NService
-
setSessionService
-
activateForTest
-
activate
Description copied from interface:TriggerServiceExecutes the assignedJobModelusing the assignedCronJobModelif the next activation time ((@link TriggerModel#getActivationTime()} is less or equal than the current system time.- Specified by:
activatein interfaceTriggerService- Parameters:
trigger- the trigger instance
-
getConfigAttributes
-
getNextTime
Description copied from interface:TriggerServiceReturns the next activation time for theTriggerModelin relation to the specified calendar.Use this method e.g. for different first day of week modes.
- Specified by:
getNextTimein interfaceTriggerService- Parameters:
trigger- the trigger instancerelativeTo- the calendar which the next activation time should be calculated relatively for- Returns:
- the next activation time(
Calendar) for theTriggerModelin relation to the specified time
-
getActiveTriggers
Description copied from interface:TriggerServiceReturns aListof all Triggers, whose next activation time (TriggerService.getNextTime(TriggerModel, Calendar)lies before the current system time.- Specified by:
getActiveTriggersin interfaceTriggerService- Returns:
- a
Listof all Triggers, whose next activation time (TriggerService.getNextTime(TriggerModel, Calendar)is smaller than current system time
-
getActiveTriggers
Description copied from interface:TriggerServiceReturns aListof all Triggers, whose next activation time (TriggerService.getNextTime(TriggerModel, Calendar)lies before the specified calendar date.- Specified by:
getActiveTriggersin interfaceTriggerService- Parameters:
calendar- the calendar- Returns:
- a
Listof all Triggers, whose next activation time (TriggerService.getNextTime(TriggerModel, Calendar)lies before the specified calendar date
-
getPulseSeconds
public int getPulseSeconds()Description copied from interface:TriggerServiceReturns a time interval at which trigger activation is fired. See cronjob.trigger.interval' property- Specified by:
getPulseSecondsin interfaceTriggerService
-
setPulseSeconds
public void setPulseSeconds(int interval) Description copied from interface:TriggerServiceSets a time interval at which trigger activation is fired. See cronjob.trigger.interval' property .- Specified by:
setPulseSecondsin interfaceTriggerService
-