Package org.zeroturnaround.exec.close
Class StandardProcessCloser
- java.lang.Object
-
- org.zeroturnaround.exec.close.StandardProcessCloser
-
- All Implemented Interfaces:
ProcessCloser
- Direct Known Subclasses:
TimeoutProcessCloser
public class StandardProcessCloser extends java.lang.Object implements ProcessCloser
StopsExecuteStreamHandlerfrom pumping the streams and closes them.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Loggerlogprotected ExecuteStreamHandlerstreams
-
Constructor Summary
Constructors Constructor Description StandardProcessCloser(ExecuteStreamHandler streams)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.io.IOExceptionadd(java.io.IOException exception, java.io.IOException newException)voidclose(java.lang.Process process)Closes standard streams of a given sub process.private voidcloseStreams(java.lang.Process process)Close the streams belonging to the given Process.
-
-
-
Field Detail
-
log
private static final org.slf4j.Logger log
-
streams
protected final ExecuteStreamHandler streams
-
-
Constructor Detail
-
StandardProcessCloser
public StandardProcessCloser(ExecuteStreamHandler streams)
-
-
Method Detail
-
close
public void close(java.lang.Process process) throws java.io.IOException, java.lang.InterruptedExceptionDescription copied from interface:ProcessCloserCloses standard streams of a given sub process.- Specified by:
closein interfaceProcessCloser- Parameters:
process- sub process (notnull).- Throws:
java.io.IOException- if I/O errors occur while closing the underlying streamjava.lang.InterruptedException- if underlying throws a InterruptedException
-
closeStreams
private void closeStreams(java.lang.Process process) throws java.io.IOExceptionClose the streams belonging to the given Process.- Throws:
java.io.IOException
-
add
private static java.io.IOException add(java.io.IOException exception, java.io.IOException newException)
-
-