Examples of PumpStreamHandler


Examples of org.apache.karaf.util.process.PumpStreamHandler

        Collections.addAll(args, files);
        Process chmod = new ProcessBuilder()
            .directory(new File(targetDir, "bin"))
            .command(args)
            .start();
        PumpStreamHandler pump = new PumpStreamHandler(System.in, System.out, System.err);
        pump.attach(chmod);
        pump.start();
        waitForProcessEnd(chmod, 5000);
    }
View Full Code Here

Examples of org.apache.karaf.util.process.PumpStreamHandler

        } else {
            builder.command("/bin/sh", new File(homeDir, "bin/" + script).getAbsolutePath(), args);
        }
        builder.redirectErrorStream(true);
        Process process = builder.start();
        PumpStreamHandler pump = new PumpStreamHandler(System.in, System.out, System.err);
        pump.attach(process);
        pump.start();
        return process;
    }
View Full Code Here

Examples of org.apache.karaf.util.process.PumpStreamHandler

    private List<String> args;

    protected Object doExecute() throws Exception {
        ProcessBuilder builder = new ProcessBuilder(args);

        PumpStreamHandler handler = new PumpStreamHandler(System.in, System.out, System.err, "Command" + args.toString());

        log.info("Executing: {}", builder.command());
        Process p = builder.start();

        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 null;
    }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.PumpStreamHandler

   */
  protected int execInOtherVM(String[] args) {
    try {

      Project project = getProject();
      PumpStreamHandler handler = new LogStreamHandler(this, verbose ? Project.MSG_VERBOSE : Project.MSG_INFO,
          Project.MSG_WARN);

      // replace above two lines with what follows as an aid to debugging when running the unit tests....
      // LogStreamHandler handler = new LogStreamHandler(this,
      // Project.MSG_INFO, Project.MSG_WARN) {
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.PumpStreamHandler

        log("Javadoc execution", Project.MSG_INFO);

        JavadocOutputStream out = new JavadocOutputStream(Project.MSG_INFO);
        JavadocOutputStream err = new JavadocOutputStream(Project.MSG_WARN);
        Execute exe = new Execute(new PumpStreamHandler(out, err));
        exe.setAntRun(getProject());

        /*
         * No reason to change the working directory as all filenames and
         * path components have been resolved already.
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.PumpStreamHandler

            FileOutputStream fos = new FileOutputStream(tmp);
            tmp2 = new File("pvcs_ant_" + rand.nextLong() + ".log");
            log(commandLine.describeCommand(), Project.MSG_VERBOSE);
            try {
                result = runCmd(commandLine,
                                new PumpStreamHandler(fos,
                                    new LogOutputStream(this,
                                                        Project.MSG_WARN)));
            } finally {
                fos.close();
            }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.PumpStreamHandler

            } else if (!quiet) {
                errorstream = new LogOutputStream(this, Project.MSG_WARN);
            } else {
                errorstream = new LogOutputStream(this, Project.MSG_DEBUG);
            }
            streamhandler = new PumpStreamHandler(outputstream, errorstream);
        }

        Execute exe = getExecute(toExecute, streamhandler);
        try {
            log("Building the RPM based on the " + specFile + " file");
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.PumpStreamHandler

        return names;
    }

    /** execute in a forked VM */
    private int run(String[] command, OutputStream out, OutputStream err) throws IOException {
        PumpStreamHandler psh;
        if (err == null) {
            psh = new PumpStreamHandler(out, bos);
        } else {
            psh = new PumpStreamHandler(out, new TeeOutputStream(err, bos));
        }

        Execute exe = new Execute(psh, null);

        exe.setAntRun(getProject());
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.PumpStreamHandler

                    throw new BuildException(e, location);
                }
            } else {
                errorstream = new LogOutputStream(this, Project.MSG_WARN);
            }
            streamhandler = new PumpStreamHandler(outputstream, errorstream);
        }

        Execute exe = new Execute(streamhandler, null);

        exe.setAntRun(project);
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.PumpStreamHandler

            FileOutputStream fos = new FileOutputStream(tmp);
            tmp2 = new File("pvcs_ant_" + rand.nextLong() + ".log");
            log(commandLine.describeCommand(), Project.MSG_VERBOSE);
            try {
                result = runCmd(commandLine,
                                new PumpStreamHandler(fos,
                                    new LogOutputStream(this,
                                                        Project.MSG_WARN)));
            } finally {
                fos.close();
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.