Package org.apache.geronimo.gshell.common.io

Examples of org.apache.geronimo.gshell.common.io.PumpStreamHandler


  private int chmod(File serviceFile, String mode) throws Exception {
    ProcessBuilder builder = new ProcessBuilder();
    builder.command("chmod", mode, serviceFile.getCanonicalPath());
        Process p = builder.start();

        PumpStreamHandler handler = new PumpStreamHandler(io.inputStream, io.outputStream, io.errorStream);
        handler.attach(p);
        handler.start();
        int status = p.waitFor();
        handler.stop();
        return status;
  }
View Full Code Here


        log.info("Executing: {}", builder.command());

        Process p = builder.start();

        PumpStreamHandler handler = new PumpStreamHandler(io.inputStream, io.outputStream, io.errorStream) {
            protected Thread createPump(final InputStream in, final OutputStream out, final boolean closeWhenExhausted) {
                assert in != null;
                assert out != null;
                final Thread result = new Thread(new StreamPumper(in, out, closeWhenExhausted)) {
                    private IO io;
                    public void start() {
                        io = ProxyIO.getIO();
                        super.start();
                    }
                    public void run() {
                        ProxyIO.setIO(io);
                        super.run();
                    }
                };
                result.setDaemon(true);
                return result;
            }
        };
        handler.attach(p);
        handler.start();

        log.debug("Waiting for process to exit...");

        int status = p.waitFor();


        log.info("Process exited w/status: {}", status);

        handler.stop();

        return status;
    }
View Full Code Here

  private int chmod(File serviceFile, String mode) throws Exception {
    ProcessBuilder builder = new ProcessBuilder();
    builder.command("chmod", mode, serviceFile.getCanonicalPath());
        Process p = builder.start();

        PumpStreamHandler handler = new PumpStreamHandler(io.inputStream, io.outputStream, io.errorStream);
        handler.attach(p);
        handler.start();
        int status = p.waitFor();
        handler.stop();
        return status;
  }
View Full Code Here

  private int chmod(File serviceFile, String mode) throws Exception {
    ProcessBuilder builder = new ProcessBuilder();
    builder.command("chmod", mode, serviceFile.getCanonicalPath());
        Process p = builder.start();

        PumpStreamHandler handler = new PumpStreamHandler(io.inputStream, io.outputStream, io.errorStream);
        handler.attach(p);
        handler.start();
        int status = p.waitFor();
        handler.stop();
        return status;
  }
View Full Code Here

        log.info("Executing: {}", builder.command());

        Process p = builder.start();

        PumpStreamHandler handler = new PumpStreamHandler(io.inputStream, io.outputStream, io.errorStream);
        handler.attach(p);
        handler.start();

        log.debug("Waiting for process to exit...");

        int status = p.waitFor();


        log.info("Process exited w/status: {}", status);

        handler.stop();

        return status;
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.gshell.common.io.PumpStreamHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.