You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by do...@apache.org on 2001/12/23 00:11:34 UTC
cvs commit: jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/exec ExecManager.java
donaldp 01/12/22 15:11:34
Added: proposal/myrmidon/src/java/org/apache/myrmidon/framework/exec
ExecManager.java
Log:
Add in an interface via which requests to execute a command can be made.
Revision Changes Path
1.1 jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/exec/ExecManager.java
Index: ExecManager.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.myrmidon.framework.exec;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.apache.myrmidon.api.TaskException;
/**
* Interface via which clients can request that a native
* process be executed. This manages all aspects of running
* a native command including such things as;
*
* <ul>
* <li>Destroying a process if it times out</li>
* <li>Reading data from supplied input stream and
* writing it to processes standard input</li>
* <li>Reading data from processes standard output
* and error streams and writing it to supplied
* streams</li>
* </ul>
*
* @author <a href="mailto:peter@apache.org">Peter Donald</a>
* @version $Revision: 1.1 $ $Date: 2001/12/22 23:11:34 $
*/
public interface ExecManager
{
/**
* Execute a process and wait for it to finish before
* returning.
*
* @param execMetaData the metaData for native command to execute
* @param input the stream to read from and write to standard input.
* May be null in which case nothing will be written to standard.
* input
* @param output the stream to write the processes standard output to.
* May be null in which case that output will go into the void.
* @param error the stream to write the processes standard error to.
* May be null in which case that error will go into the void.
* @param timeout the maximum duration in milliseconds that a process
* can execute. The value must be positive or zero. If it is zero
* then the process will not timeout. If the process times out it
* will be forcibly shutdown and a TimeoutException thrown
*/
int execute( ExecMetaData execMetaData,
InputStream input,
OutputStream output,
OutputStream error,
long timeout )
throws IOException, TaskException /*TimeoutException*/;
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>