Package org.apache.flink.tests.util
Class AutoClosableProcess
- java.lang.Object
-
- org.apache.flink.tests.util.AutoClosableProcess
-
- All Implemented Interfaces:
AutoCloseable
public class AutoClosableProcess extends Object implements AutoCloseable
Utility class to terminate a givenProcess
when exiting a try-with-resources statement.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AutoClosableProcess.AutoClosableProcessBuilder
Builder for most sophisticated processes.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
static AutoClosableProcess.AutoClosableProcessBuilder
create(String... commands)
Process
getProcess()
static void
runBlocking(String... commands)
static AutoClosableProcess
runNonBlocking(String... commands)
-
-
-
Method Detail
-
getProcess
public Process getProcess()
-
runNonBlocking
public static AutoClosableProcess runNonBlocking(String... commands) throws IOException
- Throws:
IOException
-
runBlocking
public static void runBlocking(String... commands) throws IOException
- Throws:
IOException
-
create
public static AutoClosableProcess.AutoClosableProcessBuilder create(String... commands)
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
-