commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jordan Grant <JordanGr...@carfax.com>
Subject [exec] Portability of Different Approaches across Windows and OpenVMS
Date Thu, 05 Jul 2012 19:16:35 GMT
I have written two implementations using commons-exec that are functionally the same in Windows,
but our production environment is in OpenVMS.  I am curious as to whether one approach or
the other is preferred for portability.  I noticed that the CommandLauncherFactory is capable
of producing a VmsCommandLauncher and assume that the second approach is more portable than
the first somehow.  Does the DefaultExecutor use the CommandLauncherFactory and the CommandLauncher
under the covers, rendering the approaches basically the same?

1)
CommandLine cmd = CommandLine.parse("ping localhost");
DefaultExecutor executor = new DefaultExecutor();

2)
CommandLauncher launcher = CommandLauncherFactory.createVMLauncher();
CommandLine cmd = CommandLine.parse("ping localhost");
Process process = launcher.exec(cmd, null);
PumpStreamHandler outputHandler = new PumpStreamHandler();
outputHandler.setProcessOutputStream(process.getInputStream());
outputHandler.start();

process.waitFor();

outputHandler.stop();

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message