Class GerritTriggerTimer
- java.lang.Object
-
- com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerTimer
-
public final class GerritTriggerTimer extends Object
Manages the timer that is used for each GerritTrigger TimerTask that is active.- Author:
- Fredrik Abrahamson <fredrik.abrahamson@sonymobile.com>
-
-
Field Summary
Fields Modifier and Type Field Description protected static long
DELAY_MILLISECONDS
Wait this many milliseconds before the first call to a TimerTask.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel(GerritTriggerTimerTask timerTask)
Cancel a TimerTask.static GerritTriggerTimer
getInstance()
Returns the instance, and creates it first if needed.void
schedule(GerritTriggerTimerTask timerTask, GerritTrigger trigger)
Schedule a TimerTask according to the two constants above.
-
-
-
Field Detail
-
DELAY_MILLISECONDS
protected static final long DELAY_MILLISECONDS
Wait this many milliseconds before the first call to a TimerTask.- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static GerritTriggerTimer getInstance()
Returns the instance, and creates it first if needed.- Returns:
- the instance of this class
-
schedule
public void schedule(GerritTriggerTimerTask timerTask, @NonNull GerritTrigger trigger)
Schedule a TimerTask according to the two constants above.- Parameters:
trigger
- the trigger associated with the tasktimerTask
- the TimerTask to be scheduled
-
cancel
public void cancel(GerritTriggerTimerTask timerTask)
Cancel a TimerTask.- Parameters:
timerTask
- the TimerTask to cancel
-
-