private ShellCommandExecutor buildTaskControllerExecutor(
      TaskCommands command, String userName, List<String> cmdArgs,
      File workDir, Map<String, String> env) 
      throws IOException {
    String[] taskControllerCmd = new String[3 + cmdArgs.size()];
    taskControllerCmd[0] = getTaskControllerExecutablePath();
    taskControllerCmd[1] = userName;
    taskControllerCmd[2] = String.valueOf(command.ordinal());
    int i = 3;
    for (String cmdArg : cmdArgs) {
      taskControllerCmd[i++] = cmdArg;
    }
    if (LOG.isDebugEnabled()) {
      for (String cmd : taskControllerCmd) {
        LOG.debug("taskctrl command = " + cmd);
      }
    }
    ShellCommandExecutor shExec = null;
    if(workDir != null && workDir.exists()) {
      shExec = new ShellCommandExecutor(taskControllerCmd,
          workDir, env);
    } else {
      shExec = new ShellCommandExecutor(taskControllerCmd);
    }
    
    return shExec;
  }
private ShellCommandExecutor buildTaskControllerExecutor ( TaskCommands command , String userName , List < String > cmdArgs , File workDir , Map < String , String > env ) throws IOException { String [ ] taskControllerCmd = new String [ 3 + cmdArgs . size ( ) ] ; taskControllerCmd [ 0 ] = getTaskControllerExecutablePath ( ) ; taskControllerCmd [ 1 ] = userName ; taskControllerCmd [ 2 ] = String . valueOf ( command . ordinal ( ) ) ; int i = 3 ; for ( String cmdArg : cmdArgs ) { taskControllerCmd [ i ++ ] = cmdArg ; } if ( LOG . isDebugEnabled ( ) ) { for ( String cmd : taskControllerCmd ) { LOG . debug ( "taskctrl command = " + cmd ) ; } } ShellCommandExecutor shExec = null ; if ( workDir != null && workDir . exists ( ) ) { shExec = new ShellCommandExecutor ( taskControllerCmd , workDir , env ) ; } else { shExec = new ShellCommandExecutor ( taskControllerCmd ) ; } return shExec ; }
Builds the command line for launching/terminating/killing task JVM.
Following is the format for launching/terminating/killing task JVM
<br/>
For launching following is command line argument:
<br/>
{@code user-name command tt-root job_id task_id}
<br/>
For terminating/killing task jvm.
{@code user-name command tt-root task-pid}

@param command command to be executed.
@param userName user name
@param cmdArgs list of extra arguments
@param env JVM environment variables.
@return {@link ShellCommandExecutor}
@throws IOException