Package jenkins.tasks
Class SimpleBuildWrapper.Disposer
java.lang.Object
jenkins.tasks.SimpleBuildWrapper.Disposer
- All Implemented Interfaces:
- Serializable
- Enclosing class:
- SimpleBuildWrapper
An optional callback to run at the end of the wrapped block.
 Must be safely serializable, so it receives runtime context comparable to that of the original setup.
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal booleanDetermines whether or not this end-of-wrapped-block callback requires a workspace context (working directory and launcher).voidtearDown(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) Attempt to clean up anything that was done in the initial setup.voidtearDown(Run<?, ?> build, TaskListener listener) Attempt to clean up anything that was done in the initial setup.
- 
Constructor Details- 
Disposerpublic Disposer()
 
- 
- 
Method Details- 
requiresWorkspace@Restricted(org.kohsuke.accmod.restrictions.Beta.class) public final boolean requiresWorkspace()Determines whether or not this end-of-wrapped-block callback requires a workspace context (working directory and launcher).When such a context is required (the default), then tearDown(Run, FilePath, Launcher, TaskListener)applies. Otherwise,tearDown(Run, TaskListener)applies.- Returns:
- truewhen this end-of-wrapped-block callback requires a workspace context;- falseotherwise.
- Since:
- 2.258
 
- 
tearDownpublic void tearDown(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedExceptionAttempt to clean up anything that was done in the initial setup.This method must be overridden when this end-of-wrapped-block callback requires a workspace context. If such a context is not required, it does not need to be overridden; it will then forward to tearDown(Run, TaskListener).- Parameters:
- build- a build being run
- workspace- a workspace of the build
- launcher- a way to start commands
- listener- a way to report progress
- Throws:
- AbstractMethodError- if this end-of-wrapped-block callback requires a workspace and this method is not overridden.
- IOException- if something fails;- AbortExceptionfor user errors
- InterruptedException- if tear down is interrupted
 
- 
tearDownpublic void tearDown(Run<?, ?> build, TaskListener listener) throws IOException, InterruptedExceptionAttempt to clean up anything that was done in the initial setup.This method must be overridden when this end-of-wrapped-block callback does not require a workspace context, and will not be called when such a context is required. - Parameters:
- build- a build being run
- listener- a way to report progress
- Throws:
- AbstractMethodError- if this this method is not overridden
- IllegalStateException- if this end-of-wrapped-block callback requires a workspace
- IOException- if something fails;- AbortExceptionfor user errors
- InterruptedException- if tear down is interrupted
- Since:
- 2.258
 
 
-