commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Pugh <ep...@upstate.com>
Subject Re: [exec] Design of commons-exec
Date Tue, 02 Aug 2005 19:14:18 GMT
Jerome Lacoste wrote a proposal a couple months ago to the  
CruiseControl mailing list talking about the same basic idea.  His  
proposal is here: http://www.coffeebreaks.org/blogs/?p=8.  I will  
forward this thread to him as he might be very interested in  
contributing.

At any rate, something like this in Jakarta Commons would be great, I  
know I am using at least three different implementations of the same  
basic functionality!

Eric Pugh

On Aug 1, 2005, at 7:04 PM, Kev Jackson wrote:

>
>
>>
>> This is a very short description of the cleaned up Ant exec task  
>> design:
>>
>> * Exec: the former Ant task class used to create and configure  
>> Execute instances. Now mainly a convience class for starting new  
>> Execute instances.
>> * Execute: the main class for running one process. Handles  
>> creation and configuration of the necessary objects (stream pump,  
>> watchdog, process destroyer). Can wait for the full execution time  
>> to enable synchronous return of the process return code or spawn a  
>> process to run async.
>> * Process destroyer: adds itself as a shutdown hook, Execute adds  
>> and removes created processes to ensure that they are correctly  
>> destroyed when the JVM stops.
>> * WatchDog: used to time out a running process. After a given time  
>> has passed, the process is checked if it's still running and there  
>> after destroyed.
>> * CommandLauncher: a family of classes for actually starting the  
>> processes. Implementations exist for e.g. Java 1.1, Java 1.3,  
>> WinNT, Mac, VMS and so on. These classes handles the platform  
>> specifics.
>> * Environment: used to retrive the current environment as well as  
>> setting new environment variables. Reading the current environment  
>> is done using platform specific commands (e.g. "cmd /c set",  
>> "env", "/bin/env") and parsing the result. This could of course be  
>> improved on J2SE 5.0 to use System.getenv() instead.
>> * StreamPumper: used to read/write the three stream (in, out,  
>> error) simultaniously.
>> * CommandLine: class for handling (e.g. parsing, quoting) command  
>> lines.
>>
>
> It might be worth extracting the interface from Ant, creating an  
> implementation (using the interface) and then using this in a  
> branch of Ant just to test that we've extracted all the necessary  
> functionality.  IIRC Environment is really derived through  
> JavaEnvUtils (though I'll have to check source).  A common  
> interface for a commandLine would allow us to create platform  
> specific commandLines depending on environment
>
> 2c
>
> Kev
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message