org.exolab.jmscts.core
Class Executor

java.lang.Object
  |
  +--org.exolab.jmscts.core.Executor

public class Executor
extends java.lang.Object

This class enables commands to be executed, with the output being captured, or echoed to System.out and System.err

Version:
$Revision: 1.3 $ $Date: 2004/01/31 13:44:24 $
Author:
Tim Anderson

Constructor Summary
Executor(java.lang.String command)
          Constructor to execute a command, with output going to System.out and System.err
Executor(java.lang.String command, java.io.OutputStream log)
          Constructor to execute a command, with all output going to a stream
Executor(java.lang.String command, java.io.OutputStream out, java.io.OutputStream err)
          Constructor to execute a command with standard output and error output going to two separate streams
 
Method Summary
 int run()
          Execute the command
 void stop()
          Stop the process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Executor

public Executor(java.lang.String command)
Constructor to execute a command, with output going to System.out and System.err
Parameters:
command - the command to execute

Executor

public Executor(java.lang.String command,
                java.io.OutputStream log)
Constructor to execute a command, with all output going to a stream
Parameters:
command - the command to execute
log - the stream to log output to

Executor

public Executor(java.lang.String command,
                java.io.OutputStream out,
                java.io.OutputStream err)
Constructor to execute a command with standard output and error output going to two separate streams
Parameters:
command - the command to execute
out - the stream to direct standard output to
err - the stream to direct standard error to
Method Detail

run

public int run()
        throws java.lang.Exception
Execute the command
Returns:
the command exit status
Throws:
java.lang.Exception - if the command cannot be executed

stop

public void stop()
Stop the process


Copyright © 2001-2004 JMS CTS Team. All Rights Reserved.