*
* @param process framework process
* @return stream handler
*/
private Thread createShutdownHook(final Process process) {
final Pipe errPipe = new Pipe(process.getErrorStream(), System.err).start("Error pipe");
final Pipe outPipe = new Pipe(process.getInputStream(), System.out).start("Out pipe");
final Pipe inPipe = new Pipe(process.getOutputStream(), System.in).start("In pipe");
return new Thread(
new Runnable() {
@Override
public void run() {
inPipe.stop();
outPipe.stop();
errPipe.stop();
try {
process.destroy();