ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/java/org/apache/aut/nativelib/impl ProcessMonitor.java
Date Sat, 26 Jan 2002 04:51:14 GMT
donaldp     02/01/25 20:51:14

  Modified:    proposal/myrmidon/src/java/org/apache/aut/nativelib/impl
                        ProcessMonitor.java
  Log:
  Make sure all output is processed and none is left buffered when the native process completes
  
  Revision  Changes    Path
  1.4       +16 -4     jakarta-ant/proposal/myrmidon/src/java/org/apache/aut/nativelib/impl/ProcessMonitor.java
  
  Index: ProcessMonitor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/aut/nativelib/impl/ProcessMonitor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ProcessMonitor.java	20 Jan 2002 17:32:59 -0000	1.3
  +++ ProcessMonitor.java	26 Jan 2002 04:51:14 -0000	1.4
  @@ -21,7 +21,7 @@
    * It will also in the future do the same for stdin.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.3 $ $Date: 2002/01/20 17:32:59 $
  + * @version $Revision: 1.4 $ $Date: 2002/01/26 04:51:14 $
    */
   class ProcessMonitor
       extends AbstractLogEnabled
  @@ -118,9 +118,7 @@
       {
           while( STATE_RUNNING == m_state )
           {
  -            processStandardInput();
  -            processStandardOutput();
  -            processStandardError();
  +            processStreams();
   
               if( !isProcessStopped() )
               {
  @@ -137,9 +135,23 @@
               }
           }
   
  +        //Process streams again to make sure
  +        //that we have got all the data
  +        processStreams();
  +
           IOUtil.shutdownStream( m_input );
           IOUtil.shutdownStream( m_output );
           IOUtil.shutdownStream( m_error );
  +    }
  +
  +    /**
  +     * Utility method to process all the standard streams.
  +     */
  +    private void processStreams()
  +    {
  +        processStandardInput();
  +        processStandardOutput();
  +        processStandardError();
       }
   
       /**
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message