Package hudson.model
Class AsyncAperiodicWork
- java.lang.Object
-
- java.util.TimerTask
-
- hudson.triggers.SafeTimerTask
-
- hudson.model.AperiodicWork
-
- hudson.model.AsyncAperiodicWork
-
- All Implemented Interfaces:
ExtensionPoint,Runnable
public abstract class AsyncAperiodicWork extends AperiodicWork
AperiodicWorkthat takes a long time to run. Similar toAsyncPeriodicWork, seeAsyncPeriodicWorkfor details andAperiodicWorkfor differences betweenAperiodicWorkandPeriodicWork.- Since:
- 1.410
- Author:
- vjuranek
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.triggers.SafeTimerTask
SafeTimerTask.ExceptionRunnable
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description StringnameName of the work.-
Fields inherited from class hudson.model.AperiodicWork
logger
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAsyncAperiodicWork(String name)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected StreamTaskListenercreateListener()voiddoAperiodicRun()Schedules this periodic work now in a new thread, if one isn't already running.protected abstract voidexecute(TaskListener listener)Executes the task.protected LevelgetErrorLoggingLevel()Returns the logging level at which error messages are displayed.protected FilegetLogFile()Determines the log file that records the result of this task.protected LevelgetNormalLoggingLevel()Returns the logging level at which normal messages are displayed.protected LevelgetSlowLoggingLevel()Returns the logging level at which previous task still executing messages is displayed.-
Methods inherited from class hudson.model.AperiodicWork
all, doRun, getInitialDelay, getNewInstance, getRecurrencePeriod, init
-
Methods inherited from class hudson.triggers.SafeTimerTask
getLogsRoot, of, run
-
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
-
-
-
-
Field Detail
-
name
public final String name
Name of the work.
-
-
Constructor Detail
-
AsyncAperiodicWork
protected AsyncAperiodicWork(String name)
-
-
Method Detail
-
doAperiodicRun
public final void doAperiodicRun()
Schedules this periodic work now in a new thread, if one isn't already running.- Specified by:
doAperiodicRunin classAperiodicWork
-
createListener
protected StreamTaskListener createListener()
-
getLogFile
protected File getLogFile()
Determines the log file that records the result of this task.
-
getNormalLoggingLevel
protected Level getNormalLoggingLevel()
Returns the logging level at which normal messages are displayed.- Returns:
- The logging level.
- Since:
- 1.651
-
getSlowLoggingLevel
protected Level getSlowLoggingLevel()
Returns the logging level at which previous task still executing messages is displayed.- Returns:
- The logging level.
- Since:
- 1.651
-
getErrorLoggingLevel
protected Level getErrorLoggingLevel()
Returns the logging level at which error messages are displayed.- Returns:
- The logging level.
- Since:
- 1.651
-
execute
protected abstract void execute(TaskListener listener) throws IOException, InterruptedException
Executes the task.- Parameters:
listener- Output sent will be reported to the users. (this work is TBD.)- Throws:
InterruptedException- The caller will record the exception and moves on.IOException- The caller will record the exception and moves on.
-
-