1 31 package org.objectweb.proactive.core.process; 32 33 import org.objectweb.proactive.core.util.MessageLogger; 34 35 53 54 public class SimpleExternalProcess extends AbstractExternalProcess { 55 56 private String targetCommand; 57 58 62 66 public SimpleExternalProcess(String targetCommand) { 67 this(new StandardOutputMessageLogger(), targetCommand); 68 } 69 70 71 76 public SimpleExternalProcess(MessageLogger messageLogger, String targetCommand) { 77 this(messageLogger, messageLogger, targetCommand); 78 } 79 80 81 87 public SimpleExternalProcess(MessageLogger inputMessageLogger, MessageLogger errorMessageLogger, String targetCommand) { 88 super(inputMessageLogger, errorMessageLogger); 89 this.targetCommand = targetCommand; 90 } 91 92 93 97 public static void main(String [] args) { 98 try { 99 String targetCommand = null; 100 if (args.length > 0) 101 targetCommand = args[0]; 102 else targetCommand = "ls -las"; 103 SimpleExternalProcess p = new SimpleExternalProcess(targetCommand); 104 p.startProcess(); 105 } catch (Exception e) { 106 e.printStackTrace(); 107 } 108 } 109 110 111 115 protected String buildCommand() { 116 return targetCommand; 117 } 118 119 120 124 125 } 126 | Popular Tags |