org.squashtest.tm.plugin.testautomation.jenkins.internal.tasks
Class BuildStep<S extends BuildStep<S>>

java.lang.Object
  extended by org.squashtest.tm.plugin.testautomation.jenkins.internal.tasks.BuildStep<S>
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
CheckBuildQueue, CheckBuildRunning, GatherTestList, GetBuildID, StartBuild

public abstract class BuildStep<S extends BuildStep<S>>
extends Object
implements Runnable


Field Summary
protected  BuildProcessor buildProcessor
           
 
Constructor Summary
BuildStep(BuildProcessor processor)
           
 
Method Summary
 void addListener(StepEventListener<S> newListener)
           
abstract  boolean needsRescheduling()
          Tells whether the current step is complete, or the same step needs to be executed again at a later time.
abstract  void perform()
          do the job
abstract  void reset()
          sets the same object ready for reuse
 void run()
           
 void setBuildProcessor(BuildProcessor processor)
           
abstract  Integer suggestedReschedulingInterval()
          Returns a positive or null integer if it can suggest an adequate delay before next execution, if the task is unconclusive and must be rescheduled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buildProcessor

protected BuildProcessor buildProcessor
Constructor Detail

BuildStep

public BuildStep(BuildProcessor processor)
Method Detail

addListener

public void addListener(StepEventListener<S> newListener)

setBuildProcessor

public void setBuildProcessor(BuildProcessor processor)

run

public void run()
Specified by:
run in interface Runnable

needsRescheduling

public abstract boolean needsRescheduling()
Tells whether the current step is complete, or the same step needs to be executed again at a later time.

Returns:
true if needs rescheduling, false if we can move to the next step

perform

public abstract void perform()
                      throws Exception
do the job

Throws:
Exception

reset

public abstract void reset()
sets the same object ready for reuse


suggestedReschedulingInterval

public abstract Integer suggestedReschedulingInterval()
Returns a positive or null integer if it can suggest an adequate delay before next execution, if the task is unconclusive and must be rescheduled. Null should be returned if it has no opinion and let the processor decide instead.

Returns:


Copyright © 2010-2013 Henix, henix.fr. All Rights Reserved.