Package org.apache.commons.exec

Examples of org.apache.commons.exec.ExecuteResultHandler


    /** Start the jar if not done yet, and setup runtime hook
     *  to stop it.
     */
    public void start() throws Exception {
        final ExecuteResultHandler h = new ExecuteResultHandler() {
            public void onProcessFailed(ExecuteException ex) {
                log.error("Process execution failed:" + ex, ex);
            }

            public void onProcessComplete(int result) {
View Full Code Here


        executor.setStreamHandler(new PumpStreamHandler(this.baos, this.baosErr));
      }

      executor.setWatchdog(watchdog);

      executor.execute(commandLine, new ExecuteResultHandler(){

        public void onProcessComplete(int e)
        {
          out.setText(baos.toString());
        }
View Full Code Here

    /**
     * Start the jar if not done yet, and setup runtime hook to stop it.
     */
    public void start() throws Exception {
        final ExecuteResultHandler h = new ExecuteResultHandler() {
            @Override
            public void onProcessFailed(ExecuteException ex) {
                log.error("Process execution failed:" + ex, ex);
            }

View Full Code Here

    protected void executeCommandLineInBackground( Executor exec, final CommandLine commandLine, Map enviro,
                                                   OutputStream out, OutputStream err )
            throws ExecuteException, IOException, MojoExecutionException
    {
        ExecuteResultHandler resultHandler = new ExecuteResultHandler( )
        {
            public void onProcessComplete( int resultCode )
            {
                if ( isResultCodeAFailure( resultCode ) )
                {
View Full Code Here

    protected void executeCommandLineInBackground( Executor exec, final CommandLine commandLine, Map enviro,
                                                   OutputStream out, OutputStream err )
            throws ExecuteException, IOException, MojoExecutionException
    {
        ExecuteResultHandler resultHandler = new ExecuteResultHandler( )
        {
            public void onProcessComplete( int resultCode )
            {
                if ( isResultCodeAFailure( resultCode ) )
                {
View Full Code Here

    protected void executeCommandLineInBackground( Executor exec, final CommandLine commandLine, Map enviro,
                                                   OutputStream out, OutputStream err )
            throws ExecuteException, IOException, MojoExecutionException
    {
        ExecuteResultHandler resultHandler = new ExecuteResultHandler()
        {
            public void onProcessComplete( int resultCode )
            {
                if ( isResultCodeAFailure( resultCode ) )
                {
View Full Code Here

            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);
        } catch (Exception e) {
            s_logger.debug(e);
View Full Code Here

TOP

Related Classes of org.apache.commons.exec.ExecuteResultHandler

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.