public abstract class Controller extends Object implements Serializable
| Constructor and Description |
|---|
Controller() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
cleanup(hudson.FilePath workspace)
Cleans up after a task is done.
|
Integer |
exitStatus(hudson.FilePath workspace)
Deprecated.
use
exitStatus(FilePath, Launcher, TaskListener) instead |
Integer |
exitStatus(hudson.FilePath workspace,
hudson.Launcher launcher)
Deprecated.
use
exitStatus(FilePath, Launcher, TaskListener) instead |
Integer |
exitStatus(hudson.FilePath workspace,
hudson.Launcher launcher,
hudson.model.TaskListener logger)
Checks whether the task has finished.
|
String |
getDiagnostics(hudson.FilePath workspace,
hudson.Launcher launcher)
Should be overridden to provide specific information about the status of an external process, for diagnostic purposes.
|
byte[] |
getOutput(hudson.FilePath workspace,
hudson.Launcher launcher)
Obtain the process output.
|
void |
stop(hudson.FilePath workspace)
Deprecated.
use
stop(FilePath, Launcher) instead |
void |
stop(hudson.FilePath workspace,
hudson.Launcher launcher)
Tries to stop any running task.
|
void |
watch(hudson.FilePath workspace,
Handler handler,
hudson.model.TaskListener listener)
Begins watching the process asynchronously, so that the master may receive notification when output is available or the process has exited.
|
abstract boolean |
writeLog(hudson.FilePath workspace,
OutputStream sink)
Obtains any new task log output.
|
public void watch(@Nonnull hudson.FilePath workspace, @Nonnull Handler handler, @Nonnull hudson.model.TaskListener listener) throws IOException, InterruptedException, UnsupportedOperationException
writeLog(hudson.FilePath, java.io.OutputStream) or cleanup(hudson.FilePath) in this case; you do not need to call exitStatus(FilePath, Launcher) frequently,
though it is advisable to still call it occasionally to verify that the process is still running.workspace - the workspace in usehandler - a remotable callbacklistener - a remotable destination for messagesIOException - if initiating the watch fails, for example with a ChannelClosedExceptionUnsupportedOperationException - when this mode is not available, so you must fall back to polling writeLog(hudson.FilePath, java.io.OutputStream) and exitStatus(FilePath, Launcher)InterruptedExceptionpublic abstract boolean writeLog(hudson.FilePath workspace,
OutputStream sink)
throws IOException,
InterruptedException
workspace - the workspace in usesink - where to send new log outputIOExceptionInterruptedExceptionDurableTask.charset(java.nio.charset.Charset),
DurableTask.defaultCharset()@CheckForNull public Integer exitStatus(hudson.FilePath workspace, hudson.Launcher launcher, hudson.model.TaskListener logger) throws IOException, InterruptedException
workspace - the workspace in uselauncher - a way to start processes (currently unused)logger - a way to report special messagesIOExceptionInterruptedException@Deprecated @CheckForNull public Integer exitStatus(hudson.FilePath workspace, hudson.Launcher launcher) throws IOException, InterruptedException
exitStatus(FilePath, Launcher, TaskListener) insteadIOExceptionInterruptedException@Deprecated @CheckForNull public Integer exitStatus(hudson.FilePath workspace) throws IOException, InterruptedException
exitStatus(FilePath, Launcher, TaskListener) insteadIOExceptionInterruptedException@Nonnull public byte[] getOutput(@Nonnull hudson.FilePath workspace, @Nonnull hudson.Launcher launcher) throws IOException, InterruptedException
exitStatus(FilePath, Launcher) has returned a non-null status.
The result is undefined if DurableTask.captureOutput() was not called before launch; generally an IOException will result.workspace - the workspace in uselauncher - a way to start processes (currently unused)IOExceptionInterruptedExceptionDurableTask.charset(java.nio.charset.Charset),
DurableTask.defaultCharset()public void stop(hudson.FilePath workspace,
hudson.Launcher launcher)
throws IOException,
InterruptedException
workspace - the workspace in uselauncher - a way to start processesIOExceptionInterruptedExceptionpublic void stop(hudson.FilePath workspace)
throws IOException,
InterruptedException
stop(FilePath, Launcher) insteadIOExceptionInterruptedExceptionpublic abstract void cleanup(hudson.FilePath workspace)
throws IOException,
InterruptedException
DurableTask.launch(hudson.EnvVars, hudson.FilePath, hudson.Launcher, hudson.model.TaskListener).workspace - the workspace in useIOExceptionInterruptedExceptionpublic String getDiagnostics(hudson.FilePath workspace, hudson.Launcher launcher) throws IOException, InterruptedException
Object.toString() by defaultIOExceptionInterruptedExceptionCopyright © 2016–2021. All rights reserved.