commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerome lacoste <>
Subject Re: [exec] API, implementation various notes
Date Sat, 24 Sep 2005 13:10:49 GMT
> 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.


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:


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

- finish Execute
- look at Exec
- look at stream management
- implement support for SDK 5.0
- constants

The files can be viewed at:



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:
For additional commands, e-mail:

View raw message