hudson.model
Class AsyncAperiodicWork

java.lang.Object
  extended by java.util.TimerTask
      extended by hudson.triggers.SafeTimerTask
          extended by hudson.model.AperiodicWork
              extended by hudson.model.AsyncAperiodicWork
All Implemented Interfaces:
ExtensionPoint, Runnable

public abstract class AsyncAperiodicWork
extends AperiodicWork

AperiodicWork that takes a long time to run. Similar to AsyncPeriodicWork, see AsyncPeriodicWork for details and AperiodicWork for differences between AperiodicWork and PeriodicWork.

Since:
1.410
Author:
vjuranek

Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 String name
          Name of the work.
 
Fields inherited from class hudson.model.AperiodicWork
logger
 
Constructor Summary
protected AsyncAperiodicWork(String name)
           
 
Method Summary
protected  StreamTaskListener createListener()
           
 void doAperiodicRun()
          Schedules this periodic work now in a new thread, if one isn't already running.
protected abstract  void execute(TaskListener listener)
          Executes the task.
protected  File getLogFile()
          Determines the log file that records the result of this task.
 
Methods inherited from class hudson.model.AperiodicWork
all, doRun, getInitialDelay, getNewInstance, getRecurrencePeriod
 
Methods inherited from class hudson.triggers.SafeTimerTask
run
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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:
doAperiodicRun in class AperiodicWork

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.