Package org.apache.commons.exec.launcher
Class VmsCommandLauncher
- java.lang.Object
-
- org.apache.commons.exec.launcher.CommandLauncherImpl
-
- org.apache.commons.exec.launcher.Java13CommandLauncher
-
- org.apache.commons.exec.launcher.VmsCommandLauncher
-
- All Implemented Interfaces:
CommandLauncher
public class VmsCommandLauncher extends Java13CommandLauncher
A command launcher for VMS that writes the command to a temporary DCL script before launching commands. This is due to limitations of both the DCL interpreter and the Java VM implementation.- Version:
- $Id: VmsCommandLauncher.java 1636056 2014-11-01 21:12:52Z ggregory $
-
-
Constructor Summary
Constructors Constructor Description VmsCommandLauncher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Process
exec(CommandLine cmd, java.util.Map<java.lang.String,java.lang.String> env)
Launches the given command in a new process.java.lang.Process
exec(CommandLine cmd, java.util.Map<java.lang.String,java.lang.String> env, java.io.File workingDir)
Launches the given command in a new process, in the given working directory.boolean
isFailure(int exitValue)
Checks whetherexitValue
signals a failure on the current system (OS specific).
-
-
-
Constructor Detail
-
VmsCommandLauncher
public VmsCommandLauncher()
-
-
Method Detail
-
exec
public java.lang.Process exec(CommandLine cmd, java.util.Map<java.lang.String,java.lang.String> env) throws java.io.IOException
Launches the given command in a new process.- Specified by:
exec
in interfaceCommandLauncher
- Overrides:
exec
in classCommandLauncherImpl
- Parameters:
cmd
- The command to executeenv
- The environment for the new process. If null, the environment of the current process is used.- Returns:
- the newly created process
- Throws:
java.io.IOException
- if attempting to run a command in a specific directory
-
exec
public java.lang.Process exec(CommandLine cmd, java.util.Map<java.lang.String,java.lang.String> env, java.io.File workingDir) throws java.io.IOException
Launches the given command in a new process, in the given working directory. Note that under Java 1.3.1, 1.4.0 and 1.4.1 on VMS this method only works ifworkingDir
is null or the logical JAVA$FORK_SUPPORT_CHDIR needs to be set to TRUE.- Specified by:
exec
in interfaceCommandLauncher
- Overrides:
exec
in classJava13CommandLauncher
- Parameters:
cmd
- the command line to execute as an array of stringsenv
- the environment to set as an array of stringsworkingDir
- the working directory where the command should run- Returns:
- the newly created process
- Throws:
java.io.IOException
- probably forwarded from Runtime#exec
-
isFailure
public boolean isFailure(int exitValue)
Description copied from interface:CommandLauncher
Checks whetherexitValue
signals a failure on the current system (OS specific).Note that this method relies on the conventions of the OS, it will return false results if the application you are running doesn't follow these conventions. One notable exception is the Java VM provided by HP for OpenVMS - it will return 0 if successful (like on any other platform), but this signals a failure on OpenVMS. So if you execute a new Java VM on OpenVMS, you cannot trust this method.
- Specified by:
isFailure
in interfaceCommandLauncher
- Overrides:
isFailure
in classCommandLauncherImpl
- Parameters:
exitValue
- the exit value (return code) to be checked- Returns:
true
ifexitValue
signals a failure- See Also:
CommandLauncher.isFailure(int)
-
-