Package org.apache.commons.exec

Examples of org.apache.commons.exec.PumpStreamHandler


            {
                getLog().error( "An error occurred executing background process with command line [" + commandLine
                        + "].", e );
            }
        };
        exec.setStreamHandler( new PumpStreamHandler( out, err, System.in ) );
        // Kill the process when this JVM exits.
        exec.setProcessDestroyer( new ShutdownHookProcessDestroyer() );
        exec.execute( commandLine, enviro, resultHandler );

        if ( backgroundPollingAddress != null )
View Full Code Here


        Executor exec = new DefaultExecutor();
        Map<String, String> env = new HashMap<String, String>(System.getenv());
//        env.put("path", ";");
//        env.put("path", System.getProperty("java.home"));

        ExecuteStreamHandler handler = new PumpStreamHandler(System.out, System.err, System.in);
        exec.setStreamHandler(handler);
        exec.setWorkingDirectory(getWorkingDirectory());
        ShutdownHookProcessDestroyer destroyer = new ShutdownHookProcessDestroyer();
        exec.setProcessDestroyer(destroyer);
View Full Code Here

    ExecuteWatchdog watchdog = new ExecuteWatchdog(timeout);
    Executor executor = new DefaultExecutor();

    ByteArrayOutputStream stdout = new ByteArrayOutputStream();
    PumpStreamHandler streamHandler = new PumpStreamHandler(stdout);

    executor.setExitValue(1);
    executor.setStreamHandler(streamHandler);
    executor.setWatchdog(watchdog);
View Full Code Here

            
            String workingDir = System.getProperty("user.dir");
            String path = workingDir + "/../../config/api-server/tests/";
            File f = new File(path);
            exec.setWorkingDirectory(f);
            exec.setStreamHandler(new PumpStreamHandler(new ByteArrayOutputStream()));
            CommandLine cmd = buildServerLaunchCmd(port);
            ExecuteResultHandler handler = null;
            exec.execute(cmd, handler);
            /* sleep 5 seconds for server to get started */
            Thread.sleep(5000);
View Full Code Here

    ExecuteWatchdog watchdog = new ExecuteWatchdog(timeout);
    Executor executor = new DefaultExecutor();

    ByteArrayOutputStream stdout = new ByteArrayOutputStream();
    PumpStreamHandler streamHandler = new PumpStreamHandler(stdout);

    executor.setExitValue(1);
    executor.setStreamHandler(streamHandler);
    executor.setWatchdog(watchdog);
View Full Code Here

      executor.setWorkingDirectory(new File(workDir));
    }

    ByteArrayOutputStream out = new ByteArrayOutputStream();

    PumpStreamHandler streamHandler = new PumpStreamHandler(out, out);
    if (streamHandler != null) {
      executor.setStreamHandler(streamHandler);
    }

    try {
View Full Code Here

TOP

Related Classes of org.apache.commons.exec.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.