| 1 19 20 package ca.mcgill.sable.soot.launching; 21 22 import java.lang.reflect.InvocationTargetException ; 23 24 import org.eclipse.core.runtime.IProgressMonitor; 25 import org.eclipse.jface.operation.IRunnableWithProgress; 26 import org.eclipse.swt.widgets.*; 27 28 32 public class SootProcessRunner implements IRunnableWithProgress { 33 34 private String cmd; 35 private SootClasspath sootClasspath; 36 private Display display; 37 private Process proc; 38 39 public SootProcessRunner(Display display, String cmd, SootClasspath cp) { 40 setCmd(cmd); 41 setSootClasspath(cp); 42 setDisplay(display); 43 } 44 45 46 49 public void run(IProgressMonitor monitor) 50 throws InvocationTargetException , InterruptedException { 51 52 try { 53 54 String exec1 = "java -cp \""+getSootClasspath().getSootClasspath()+"\" soot.Main -p jb use-original-names "+ getCmd(); 55 setProc(Runtime.getRuntime().exec(exec1)); 56 57 58 getProc().waitFor(); 59 } 60 catch (Exception e1) { 61 System.out.println(e1.getMessage()); 62 } 63 } 64 65 69 public String getCmd() { 70 return cmd; 71 } 72 73 77 public void setCmd(String cmd) { 78 this.cmd = cmd; 79 } 80 81 82 83 87 public SootClasspath getSootClasspath() { 88 return sootClasspath; 89 } 90 91 95 public void setSootClasspath(SootClasspath sootClasspath) { 96 this.sootClasspath = sootClasspath; 97 } 98 99 103 public Display getDisplay() { 104 return display; 105 } 106 107 111 public void setDisplay(Display display) { 112 this.display = display; 113 } 114 115 119 public Process getProc() { 120 return proc; 121 } 122 123 127 public void setProc(Process proc) { 128 this.proc = proc; 129 } 130 131 } 132 | Popular Tags |