Package hudson.triggers
Class SafeTimerTask
- java.lang.Object
-
- java.util.TimerTask
-
- hudson.triggers.SafeTimerTask
-
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
AperiodicWork
,PeriodicWork
public abstract class SafeTimerTask extends TimerTask
Wrapper so that a fatal error inTimerTask
will not terminate the timer.Timer.get()
is a shared timer instance that can be used inside Jenkins to schedule recurring work. But the usual usage is automatic viaPeriodicWork
orAperiodicWork
.- Since:
- 1.124
- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SafeTimerTask.ExceptionRunnable
-
Constructor Summary
Constructors Constructor Description SafeTimerTask()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
doRun()
static File
getLogsRoot()
The root path that should be used to put logs related to the tasks running in Jenkins.static SafeTimerTask
of(SafeTimerTask.ExceptionRunnable r)
Lambda-friendly means of creating a task.void
run()
-
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
-
-
-
-
Method Detail
-
of
public static SafeTimerTask of(SafeTimerTask.ExceptionRunnable r)
Lambda-friendly means of creating a task.- Since:
- 2.216
-
run
public final void run()
-
getLogsRoot
public static File getLogsRoot()
The root path that should be used to put logs related to the tasks running in Jenkins.- Returns:
- the path where the logs should be put.
- Since:
- 2.114
- See Also:
AsyncAperiodicWork.getLogFile()
,AsyncPeriodicWork.getLogFile()
-
-