public interface JobProcessManager extends org.springframework.context.ApplicationListener<KillService.KillEvent>
Modifier and Type | Method and Description |
---|---|
void |
kill(KillService.KillSource source)
Terminate job process execution (if still running) or prevent it from launching (if not launched yet).
|
void |
launchProcess(java.io.File jobDirectory,
java.util.Map<java.lang.String,java.lang.String> environmentVariables,
java.util.List<java.lang.String> commandArguments,
java.util.List<java.lang.String> jobArguments,
boolean interactive,
java.lang.Integer timeout)
Launch the job process (unless launch was aborted by previous a
kill call). |
JobProcessResult |
waitFor()
Wait indefinitely for the job process to terminate.
|
void launchProcess(java.io.File jobDirectory, java.util.Map<java.lang.String,java.lang.String> environmentVariables, java.util.List<java.lang.String> commandArguments, java.util.List<java.lang.String> jobArguments, boolean interactive, @Nullable java.lang.Integer timeout) throws JobLaunchException
kill
call).jobDirectory
- Job directoryenvironmentVariables
- additional environment variables (to merge on top of inherited environment)commandArguments
- command-line executable and its fixed arguments argumentsjobArguments
- job-specific argumentsinteractive
- launch in interactive mode (inherit I/O) or batch (no input, write outputs to files)timeout
- The optional number of seconds this job is allowed to run before the system will
kill itJobLaunchException
- if the job process failed to launchvoid kill(KillService.KillSource source)
source
- The KillService.KillSource
value representing where this kill request is coming fromJobProcessResult waitFor() throws java.lang.InterruptedException
java.lang.IllegalStateException
- if the process was not launchedjava.lang.InterruptedException
- if the calling thread is interrupted while waiting