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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final String
expandAll
(AbstractBuild<?, ?> build, BuildListener listener, String string) long
getTimeOut
(AbstractBuild<?, ?> build, BuildListener listener) Define the delay (in milliseconds) to wait for the build to complete before interrupting.long
getTimeOut
(Run run) Deprecated.protected static final boolean
void
onWrite
(AbstractBuild<?, ?> build, byte[] b, int length) Called when some output to console.void
onWrite
(AbstractBuild<?, ?> build, int b) Deprecated.boolean
Decides 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:
InterruptedException
org.jenkinsci.plugins.tokenmacro.MacroEvaluationException
IOException
-
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:
getDescriptor
in 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.MacroEvaluationException
IOException
InterruptedException
-
hasMacros
-
getTimeOut(hudson.model.AbstractBuild, hudson.model.BuildListener)
instead.