1 28 29 package com.caucho.java; 30 31 import com.caucho.loader.EnvironmentLocal; 32 33 import javax.annotation.PostConstruct; 34 35 public class JavacConfig { 36 private static final EnvironmentLocal<JavacConfig> _localJavac = 37 new EnvironmentLocal<JavacConfig>(); 38 39 private String _compiler = "internal"; 40 private String _args; 41 private String _encoding; 42 private int _maxBatch = 64; 43 44 47 public static JavacConfig getLocalConfig() 48 { 49 JavacConfig config; 50 51 config = _localJavac.get(); 52 53 if (config != null) 54 return config; 55 else 56 return new JavacConfig(); 57 } 58 59 62 public void setCompiler(String compiler) 63 { 64 _compiler = compiler; 65 } 66 67 70 public String getCompiler() 71 { 72 return _compiler; 73 } 74 75 78 public void setArgs(String args) 79 { 80 _args = args; 81 } 82 83 86 public String getArgs() 87 { 88 return _args; 89 } 90 91 94 public void setEncoding(String encoding) 95 { 96 _encoding = encoding; 97 } 98 99 102 public String getEncoding() 103 { 104 return _encoding; 105 } 106 107 110 public void setMaxBatch(int max) 111 { 112 _maxBatch = max; 113 } 114 115 118 public int getMaxBatch() 119 { 120 return _maxBatch; 121 } 122 123 126 public void setCompilerArgs(String args) 127 { 128 setArgs(args); 129 } 130 131 134 @PostConstruct 135 public void init() 136 { 137 _localJavac.set(this); 138 } 139 } 140 141 | Popular Tags |