Package hudson.model

Class TaskThread

  • All Implemented Interfaces:
    Runnable

    public abstract class TaskThread
    extends Thread
    Thread for performing one-off task.

    Designed to be used inside TaskAction.

    Since:
    1.191
    Author:
    Kohsuke Kawaguchi
    See Also:
    TaskAction
    • Method Detail

      • associateWith

        protected final void associateWith​(TaskAction action)
        Registers that this TaskThread is run for the specified TaskAction. This can be explicitly called from subtypes to associate a single TaskThread across multiple tag actions.
      • start

        public void start()
        Starts the task execution asynchronously.
        Overrides:
        start in class Thread
      • isRunning

        public boolean isRunning()
      • run

        public final void run()
        Specified by:
        run in interface Runnable
        Overrides:
        run in class Thread
      • perform

        protected abstract void perform​(TaskListener listener)
                                 throws Exception
        Do the actual work.
        Throws:
        Exception - The exception is recorded and reported as a failure.