Accessors for PeriodicTrigger properties
Issue: SPR-15982
This commit is contained in:
@@ -74,6 +74,22 @@ public class PeriodicTrigger implements Trigger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return this trigger's period.
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public long getPeriod() {
|
||||||
|
return this.period;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return this trigger's time unit (milliseconds by default).
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public TimeUnit getTimeUnit() {
|
||||||
|
return this.timeUnit;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the delay for the initial execution. It will be evaluated in
|
* Specify the delay for the initial execution. It will be evaluated in
|
||||||
* terms of this trigger's {@link TimeUnit}. If no time unit was explicitly
|
* terms of this trigger's {@link TimeUnit}. If no time unit was explicitly
|
||||||
@@ -83,6 +99,14 @@ public class PeriodicTrigger implements Trigger {
|
|||||||
this.initialDelay = this.timeUnit.toMillis(initialDelay);
|
this.initialDelay = this.timeUnit.toMillis(initialDelay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the initial delay, or 0 if none.
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public long getInitialDelay() {
|
||||||
|
return this.initialDelay;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify whether the periodic interval should be measured between the
|
* Specify whether the periodic interval should be measured between the
|
||||||
* scheduled start times rather than between actual completion times.
|
* scheduled start times rather than between actual completion times.
|
||||||
@@ -92,6 +116,15 @@ public class PeriodicTrigger implements Trigger {
|
|||||||
this.fixedRate = fixedRate;
|
this.fixedRate = fixedRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return whether this trigger uses fixed rate ({@code true}) or
|
||||||
|
* fixed delay ({@code false}) behavior.
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public boolean isFixedRate() {
|
||||||
|
return this.fixedRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the time after which a task should run again.
|
* Returns the time after which a task should run again.
|
||||||
|
|||||||
Reference in New Issue
Block a user