1 28 29 package com.caucho.java; 30 31 import com.caucho.log.Log; 32 import com.caucho.util.L10N; 33 34 import java.io.IOException ; 35 import java.util.logging.Logger ; 36 37 40 abstract public class AbstractJavaCompiler implements Runnable { 41 protected static final L10N L = new L10N(AbstractJavaCompiler.class); 42 protected static final Logger log = Log.open(AbstractJavaCompiler.class); 43 44 protected JavaCompiler _compiler; 45 private volatile boolean _isDone; 46 47 private String []_path; 49 private LineMap _lineMap; 50 51 private Throwable _exception; 52 53 public AbstractJavaCompiler(JavaCompiler compiler) 54 { 55 _compiler = compiler; 56 } 57 58 61 public void setPath(String []path) 62 { 63 _path = path; 64 } 65 66 69 public void setLineMap(LineMap lineMap) 70 { 71 _lineMap = lineMap; 72 } 73 74 77 public Throwable getException() 78 { 79 return _exception; 80 } 81 82 85 public boolean isDone() 86 { 87 return _isDone; 88 } 89 90 93 public void run() 94 { 95 try { 96 Thread.currentThread().setContextClassLoader(ClassLoader.getSystemClassLoader()); 97 98 compileInt(_path, _lineMap); 99 } catch (Throwable e) { 100 _exception = e; 101 } finally { 102 _isDone = true; 103 104 synchronized (this) { 105 notifyAll(); 106 } 107 } 108 } 109 110 113 public void abort() 114 { 115 } 116 117 123 abstract protected void compileInt(String []path, LineMap lineMap) 124 throws IOException ; 125 } 126 | Popular Tags |