Package dev.enola.common.exec
Interface ProcessLauncher
- All Known Implementing Classes:
MockProcessLauncher,PtyProcessLauncher
public interface ProcessLauncher
ProcessLauncher launches a process described by a
ProcessRequest.
Implementations could include:
- JDK's built-in
ProcessBuilder - Wrappers around native bindings (e.g. pty4j (in a "raw" JLine Terminal), or NuProcess, or jnr-process)
- SSH client
- in Container
- in VM
Exec is a related higher-level utility which builds upon this that may also interest you.-
Method Summary
Modifier and TypeMethodDescriptionexecute(ProcessRequest request) Launch a new process (and immediately return).
-
Method Details
-
execute
Launch a new process (and immediately return).Note that this intentionally does NOT throw IOException. Any start errors, such as a failure to launch e.g. due to an image file not found or not executable, as well as implementation-specific conditions encountered later (such as perhaps an "unexpected return code") are always only reported via
ProcessResponse.async().- Parameters:
request- theProcessRequest- Returns:
- the
ProcessResponse
-