Class DynamicPeriodicTrigger
java.lang.Object
org.springframework.integration.util.DynamicPeriodicTrigger
- All Implemented Interfaces:
- Trigger
This is a dynamically changeable 
Trigger. It is based on the
 PeriodicTrigger
 implementations. However, the fields of this dynamic
 trigger are not final and the properties can be inspected and set via
 explicit getters and setters. Changes to the trigger take effect after the
 next execution.- Since:
- 4.2
- Author:
- Gunnar Hillert, Gary Russell, Artem Bilan
- 
Constructor SummaryConstructorsConstructorDescriptionDynamicPeriodicTrigger(long period) Create a trigger with the given period in milliseconds.DynamicPeriodicTrigger(Duration duration) Create a trigger with the provided duration.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturn the duration.Get the initial duration.inthashCode()booleanReturn whether this trigger is fixed rate.nextExecution(TriggerContext triggerContext) Return the time after which a task should run again.voidsetDuration(Duration duration) Set the duration.voidsetFixedRate(boolean fixedRate) Specify whether the periodic interval should be measured between the scheduled start times rather than between actual completion times.voidsetInitialDuration(Duration initialDuration) Specify the delay for the initial execution.Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.scheduling.TriggernextExecutionTime
- 
Constructor Details- 
DynamicPeriodicTriggerpublic DynamicPeriodicTrigger(long period) Create a trigger with the given period in milliseconds.- Parameters:
- period- Must not be negative
 
- 
DynamicPeriodicTriggerCreate a trigger with the provided duration.- Parameters:
- duration- the duration.
- Since:
- 5.1
 
 
- 
- 
Method Details- 
setInitialDurationSpecify the delay for the initial execution.- Parameters:
- initialDuration- the initial delay.
- Since:
- 5.1
 
- 
getDurationReturn the duration.- Returns:
- the duration.
- Since:
- 5.1
 
- 
setDurationSet the duration.- Parameters:
- duration- the duration.
- Since:
- 5.1
 
- 
getInitialDurationGet the initial duration.- Returns:
- the initial duration.
- Since:
- 5.1
 
- 
setFixedRatepublic void setFixedRate(boolean fixedRate) Specify whether the periodic interval should be measured between the scheduled start times rather than between actual completion times. The latter, "fixed delay" behavior, is the default.- Parameters:
- fixedRate- the fixed rate- booleanflag.
 
- 
isFixedRatepublic boolean isFixedRate()Return whether this trigger is fixed rate.- Returns:
- the fixed rate.
 
- 
nextExecutionReturn the time after which a task should run again.- Specified by:
- nextExecutionin interface- Trigger
- Parameters:
- triggerContext- the trigger context to determine the previous state of schedule.
- Returns:
- the next schedule instant.
 
- 
equals
- 
hashCodepublic int hashCode()
 
-