public class JobProcessManagerImpl extends java.lang.Object implements JobProcessManager
Constructor and Description |
---|
JobProcessManagerImpl(org.springframework.scheduling.TaskScheduler taskScheduler,
BraveTracingComponents tracingComponents)
Constructor.
|
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.io.File jobScript,
boolean interactive,
java.lang.Integer timeout,
boolean launchInJobDirectory)
Launch the job process (unless launch was aborted by previous a
kill call). |
JobProcessResult |
waitFor()
Wait indefinitely for the job process to terminate.
|
public JobProcessManagerImpl(org.springframework.scheduling.TaskScheduler taskScheduler, BraveTracingComponents tracingComponents)
taskScheduler
- The TaskScheduler
instance to use to run scheduled asynchronous taskstracingComponents
- The BraveTracingComponents
instance to use for propagating trace informationpublic void launchProcess(java.io.File jobDirectory, java.io.File jobScript, boolean interactive, @Nullable java.lang.Integer timeout, boolean launchInJobDirectory) throws JobLaunchException
kill
call).launchProcess
in interface JobProcessManager
jobDirectory
- Job directoryjobScript
- job script (a.k.a. run file)interactive
- 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 itlaunchInJobDirectory
- launch the job process from the job directory rather than the current directoryJobLaunchException
- if the job process failed to launchpublic void kill(KillService.KillSource source)
kill
in interface JobProcessManager
source
- The KillService.KillSource
value representing where this kill request is coming frompublic JobProcessResult waitFor() throws java.lang.InterruptedException
waitFor
in interface JobProcessManager
java.lang.InterruptedException
- if the calling thread is interrupted while waiting