|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
hudson.model.TaskThread
public abstract class TaskThread
Thread
for performing one-off task.
Designed to be used inside TaskAction
.
TaskAction
Nested Class Summary | |
---|---|
static class |
TaskThread.ListenerAndText
Tuple of TaskListener and AnnotatedLargeText , representing
the interface for producing output and how to retrieve it later. |
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
protected |
TaskThread(TaskAction owner,
TaskThread.ListenerAndText output)
|
Method Summary | |
---|---|
protected void |
associateWith(TaskAction action)
Registers that this TaskThread is run for the specified
TaskAction . |
protected TaskThread.ListenerAndText |
createListener()
Determines where the output of this TaskThread goes. |
boolean |
isRunning()
|
protected abstract void |
perform(TaskListener listener)
Do the actual work. |
Reader |
readAll()
|
void |
run()
|
void |
start()
Starts the task execution asynchronously. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected TaskThread(TaskAction owner, TaskThread.ListenerAndText output)
output
- Determines where the output from this task thread goes.Method Detail |
---|
public Reader readAll() throws IOException
IOException
protected final void associateWith(TaskAction action)
TaskThread
is run for the specified
TaskAction
. This can be explicitly called from subtypes
to associate a single TaskThread
across multiple tag actions.
public void start()
start
in class Thread
public boolean isRunning()
protected TaskThread.ListenerAndText createListener() throws IOException
TaskThread
goes.
Subclass can override this to send the output to a file, for example.
IOException
public final void run()
run
in interface Runnable
run
in class Thread
protected abstract void perform(TaskListener listener) throws Exception
Exception
- The exception is recorded and reported as a failure.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |