> Proposal
> --------
>
> to me commons-exec is slightly over-engineered. As is, clients will
> have to resort to strange things and rewrite somewhat complex helper
> classes to do simple things.
>
> I propose to change the API.
>
> Vision: Make commons-exec a reusable Library that is available to all
> SDK, that not only solves the problems solved by ProcessBuilder but
> also add functionality for Process and Stream management, allowing
> flexible reuse of this functionality.
[blablabla...]
better to show code than words?
I started refactoring the API to something that fits better the vision
I have with this library.
I would appreciate if you could review some of the design ideas I put
in this refactoring.
I can then write & send patches to migrate from the original version
to something we agree with.
Here's a list of some of the things I did or plan to do in this refactoring:
DONE
Renamed environment package to os
Moved OS into os package
Made Environment simpler
Made Environment a real Map
Made Environment values the String value and not EnvironmentVariable instances
Moved getProcEnvironment in separate ProcEnvironment class
Renamed getProcEnvironment to getenv()
Made CommandLauncher use Map instead of Environment
-> moved conversion of Environment to Map inside abstract command
launcher class (for now)
Introduced ProcessLauncher (our ProcessBuilder for SDK < 5.0)
Made Execute delegate to ProcessLauncher
Made Execute and Exec use Map instead of Environment in their API
Merged ProcessDestroyer and Watchdog behind a unique Execute.Listener interface
TODO:
- finish Execute
- look at Exec
- look at stream management
- implement support for SDK 5.0
- constants
The files can be viewed at:
http://moca.dynalias.com/~jerome/projects/exec2/
Cheers,
Jerome
PS: first time I participate in the commons project, so let me know if
there's something I don't do right.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
|