hudson.model
Class AsyncPeriodicWork
java.lang.Object
java.util.TimerTask
hudson.triggers.SafeTimerTask
hudson.model.PeriodicWork
hudson.model.AsyncPeriodicWork
- All Implemented Interfaces:
- ExtensionPoint, Runnable
- Direct Known Subclasses:
- ConnectionActivityMonitor, FingerprintCleanupThread, WorkspaceCleanupThread
public abstract class AsyncPeriodicWork
- extends PeriodicWork
PeriodicWork
that takes a long time to run.
Subclasses will implement the execute(TaskListener)
method and can carry out a long-running task.
This runs in a separate thread so as not to block the timer thread, and this class handles
all those details.
- Author:
- Kohsuke Kawaguchi
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
name
public final String name
- Name of the work.
AsyncPeriodicWork
protected AsyncPeriodicWork(String name)
doRun
public final void doRun()
- Schedules this periodic work now in a new thread, if one isn't already running.
- Specified by:
doRun
in class SafeTimerTask
createListener
protected StreamTaskListener createListener()
getLogFile
protected File getLogFile()
- Determines the log file that records the result of this task.
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.
Copyright © 2004-2013. All Rights Reserved.