this.log("Started "+"[" + this.nameProcess + "]> " + this.getCommand() + "| workdir: " + this.getWorkDir() + " ", 2);
   public void run() {      String terminationType = "normal";      do {         try {            //this.log("Command Start: "+command,3);            this.log("RunProcessInfo > " + this.toString(), 5);            this.log("Started "+"[" + this.nameProcess + "]> " + this.getCommand() + "| workdir: " + this.getWorkDir() + " ", 2);            subProcess = runtime.exec(command, envProp, workDir);            //TODO: make get methods and change the way RunProcess access to this references!  Accesing to variables directly.            //CHECK: check the way RunProcess access to this references to Stream objects this is a quick hack! Accesing to variables directly            StreamGobbler outputGobbler;            // any output?            //this.log("RunProcess > " + "Creating gobblers for new process, "); // + (((SFRunCommand)this.sfObj).outputStreamObj).toString() +", " + this.toString(), 5);			this.log("RunProcess > " + "Creating gobblers for new process, " + (((SFRunCommand)this.sfObj).outputStreamObj).toString() +", " + this.toString(), 5);            if ((this.sfObj instanceof SFRunCommand) && (((SFRunCommand)this.sfObj).outputStreamObj != null)) {               outputGobbler = new StreamGobbler(subProcess.getInputStream(), "[" + this.nameProcess + "] " + "OUT", ((SFRunCommand)this.sfObj).outputStreamObj.getOutputStream(), ((SFRunCommand)this.sfObj).printMsgImp);               this.log(" RunProcess "+"[" + this.nameProcess + "]> " + "gobbler (OUTPUT) redirected.", 5);            } else {               outputGobbler = new StreamGobbler(subProcess.getInputStream(), "[" + this.nameProcess + "] " + "OUT", null, ((SFRunCommand)this.sfObj).printMsgImp);               this.log(" RunProcess "+"[" + this.nameProcess + "]> " + "gobbler (OUTPUT) created (not redirected).", 5);            }            // any error message?            //StreamGobbler errorGobbler = new StreamGobbler(subProcess.getErrorStream(), "[" + this.nameProcess + "] " + "ERR");            StreamGobbler errorGobbler;            if ((this.sfObj instanceof SFRunCommand) && (((SFRunCommand)this.sfObj).errorStreamObj != null)) {               errorGobbler = new StreamGobbler(subProcess.getErrorStream(), "[" + this.nameProcess + "] " + "ERR", ((SFRunCommand)this.sfObj).outputStreamObj.getOutputStream(),((SFRunCommand)this.sfObj).printErrMsgImp);               this.log(" RunProcess "+"[" + this.nameProcess + "]> " + "gobbler (ERROR) redirected.", 5);            } else {               errorGobbler = new StreamGobbler(subProcess.getErrorStream(), "[" + this.nameProcess + "] " + "ERR", null, ((SFRunCommand)this.sfObj).printErrMsgImp);               this.log(" RunProcess "+"[" + this.nameProcess + "]> " + "gobbler (ERROR) created (not redirected).", 5);            }            // kick them off			if (outputGobbler != null)				System.out.println("OUTPUTGOBBLER NOT NULL");			else				System.out.println("OUTPUTGOBBLER IS NULL");            			errorGobbler.setPassType(false); //india- team changes            outputGobbler.setPassType(false);//india- team changes            			errorGobbler.start(); //india- team changes            outputGobbler.start();//india- team changes            this.log("Process (re)started,"+"[" + this.nameProcess + "]> ", 3);            status = "running";            int exitVal = subProcess.waitFor();            // wait until process finishes            this.log("Exit Val "+"[" + this.nameProcess + "]>"+ exitVal + "", 2);            this.clean();            if(exitVal == 0) {                terminationType = "normal";                if ((this.sfObj instanceof SFRunCommand) && (((SFRunCommand)this.sfObj).printMsgImp != null)) {                   ((SFRunCommand)this.sfObj).printMsgImp.printMsg("NORMAL Termination. "+"Exit Val "+"[" + this.nameProcess + "]>"+ exitVal + "");                }            } else {                terminationType = "abnormal";                if ((this.sfObj instanceof SFRunCommand) && (((SFRunCommand)this.sfObj).printErrMsgImp != null)) {                  ((SFRunCommand)this.sfObj).printErrMsgImp.printErrMsg("ABNORMAL Termination. "+"Exit Val "+"[" + this.nameProcess + "]>"+ exitVal + "");                }            }            if (stop) {               break;            }            Thread.sleep(delay);         } catch (Exception ex) {            terminationType = "abnormal";            this.log("Problem starting "+"[" + this.nameProcess + "]> " + ex.getMessage() + ", " + this.toString(), 1);            if ((this.sfObj instanceof SFRunCommand) && (((SFRunCommand)this.sfObj).printErrMsgImp != null)) {              try {                ((SFRunCommand)this.sfObj).printErrMsgImp.printErrMsg("ABNORMAL Termination. "+""+"[" + this.nameProcess + "]>"+ "Problem starting application: "+ ex.getMessage() + "");              } catch (Exception exc) {              }            } else {               System.err.println("ABNORMAL Termination. "+""+"[" + this.nameProcess + "]>"+ "Problem starting application: "+ ex.getMessage() + "");            }            if (printStack) {               ex.printStackTrace();            }            try {               this.kill();               Thread.sleep(10 * 1000);            } catch (Exception e) {               //e.printStackTrace();            }         }      } while (reStart);      if (shouldTerminate) {        // Do a propper terminate of the whole lot!!!        if (shouldDetach) detach();           terminate(terminationType);        } else if (shouldDetach) {           detach();        }   }