Class JvmCommandRunner

java.lang.Object
org.springframework.batch.core.step.tasklet.JvmCommandRunner
All Implemented Interfaces:
CommandRunner

public class JvmCommandRunner extends Object implements CommandRunner
Implementation of the CommandRunner interface that calls the standard Runtime.exec(java.lang.String) method. It should be noted that there is no unit tests for this class, since there is only one line of actual code, that would only be testable by mocking Runtime.
Since:
5.0
Author:
Stefano Cordio, Mahmoud Ben Hassine
  • Constructor Details

    • JvmCommandRunner

      public JvmCommandRunner()
  • Method Details

    • exec

      public Process exec(String[] command, String[] envp, File dir) throws IOException
      Delegate call to Runtime.exec(java.lang.String) with the arguments provided.
      Specified by:
      exec in interface CommandRunner
      Parameters:
      command - a specified system command and its arguments.
      envp - array of strings, each element of which has environment variable settings in the format name=value, or null if the subprocess should inherit the environment of the current process.
      dir - the working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process.
      Returns:
      A new Process object for managing the subprocess
      Throws:
      IOException - If an I/O error occurs
      See Also: