Package hudson.plugins.build_timeout
Class BuildTimeOutStrategy
java.lang.Object
hudson.plugins.build_timeout.BuildTimeOutStrategy
- All Implemented Interfaces:
Describable<BuildTimeOutStrategy>
- Direct Known Subclasses:
AbsoluteTimeOutStrategy,DeadlineTimeOutStrategy,ElasticTimeOutStrategy,LikelyStuckTimeOutStrategy,NoActivityTimeOutStrategy
public abstract class BuildTimeOutStrategy
extends Object
implements Describable<BuildTimeOutStrategy>
- Author:
- Nicolas De Loof
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final StringexpandAll(AbstractBuild<?, ?> build, BuildListener listener, String string) longgetTimeOut(AbstractBuild<?, ?> build, BuildListener listener) Define the delay (in milliseconds) to wait for the build to complete before interrupting.longgetTimeOut(Run run) Deprecated.protected static final booleanvoidonWrite(AbstractBuild<?, ?> build, byte[] b, int length) Called when some output to console.voidonWrite(AbstractBuild<?, ?> build, int b) Deprecated.booleanDecides whether to callonWrite(AbstractBuild, byte[], int)For performance reason,onWrite(AbstractBuild, byte[], int)is called only when subclass overrides it.
-
Field Details
-
MINUTES
public static final long MINUTES- See Also:
-
LOG
-
-
Constructor Details
-
BuildTimeOutStrategy
public BuildTimeOutStrategy()
-
-
Method Details
-
getTimeOut
Deprecated.overridegetTimeOut(hudson.model.AbstractBuild, hudson.model.BuildListener)instead.Define the delay (in milliseconds) to wait for the build to complete before interrupting.- Parameters:
run-
-
getTimeOut
public long getTimeOut(@NonNull AbstractBuild<?, ?> build, @NonNull BuildListener listener) throws InterruptedException, org.jenkinsci.plugins.tokenmacro.MacroEvaluationException, IOExceptionDefine the delay (in milliseconds) to wait for the build to complete before interrupting.- Parameters:
build- the buildlistener- the build listener- Throws:
InterruptedExceptionorg.jenkinsci.plugins.tokenmacro.MacroEvaluationExceptionIOException
-
onWrite
Deprecated.Called when some output to console. Override this to capture the activity.- Parameters:
build-b- output character.
-
onWrite
Called when some output to console. Override this to capture the activity.- Parameters:
build-b- output characters.length- length of b to output
-
wantsCaptureLog
public boolean wantsCaptureLog()Decides whether to callonWrite(AbstractBuild, byte[], int)For performance reason,onWrite(AbstractBuild, byte[], int)is called only when subclass overrides it.- Returns:
- true to call
onWrite(AbstractBuild, byte[], int)
-
getDescriptor
- Specified by:
getDescriptorin interfaceDescribable<BuildTimeOutStrategy>- Returns:
- See Also:
-
expandAll
protected final String expandAll(@NonNull AbstractBuild<?, ?> build, @NonNull BuildListener listener, @NonNull String string) throws org.jenkinsci.plugins.tokenmacro.MacroEvaluationException, IOException, InterruptedException- Throws:
org.jenkinsci.plugins.tokenmacro.MacroEvaluationExceptionIOExceptionInterruptedException
-
hasMacros
-
getTimeOut(hudson.model.AbstractBuild, hudson.model.BuildListener)instead.