1 4 5 package com.tc.aspectwerkz.transform; 6 7 import com.tc.aspectwerkz.expression.regexp.Pattern; 8 import com.tc.aspectwerkz.expression.regexp.TypePattern; 9 import com.tc.aspectwerkz.expression.SubtypePatternType; 10 11 16 public class Properties { 17 18 public static final String ASPECT_MODULES; 20 public static final boolean USE_GLOBAL_CONTEXT; 21 public final static boolean VERBOSE_LOGGING; 22 public static final boolean PRINT_DEPLOYMENT_INFO; 23 public final static boolean EAGERLY_GENERATE_CLOSURE; 24 public static final String DUMP_DIR_CLOSURES; 25 public static final String DUMP_DIR_FACTORIES; 26 public static final boolean DUMP_JIT_CLOSURES; 27 public final static boolean DUMP_JIT_FACTORIES; 28 public final static TypePattern DUMP_PATTERN; 29 public final static boolean DUMP_BEFORE; 30 public final static boolean DUMP_AFTER; 31 public static final String DUMP_DIR_BEFORE; 32 public static final String DUMP_DIR_AFTER; 33 34 private final static String AW_PRINT_DEPLOYMENT_INFO = "aspectwerkz.deployment.info"; 36 private final static String AW_VERBOSE_LOGGING = "aspectwerkz.details"; 37 private final static String AW_EAGERLY_GENERATE_CLOSURES = "aspectwerkz.gen.closures"; 38 private final static String AW_DUMP_PATTERN = "aspectwerkz.dump.pattern"; 39 private final static String AW_DUMP_CLOSURES = "aspectwerkz.dump.closures"; 40 private final static String AW_DUMP_FACTORIES = "aspectwerkz.dump.factories"; 41 private final static String AW_ASPECT_MODULES = "aspectwerkz.aspectmodules"; 42 43 static { 44 String global = System.getProperty("tc.dso.global"); 46 if (global != null) { 47 USE_GLOBAL_CONTEXT = Boolean.valueOf(global).booleanValue(); 48 } else { 49 USE_GLOBAL_CONTEXT = true; 50 } 51 52 ASPECT_MODULES = System.getProperty(AW_ASPECT_MODULES, "").trim(); 54 String dumpJP = System.getProperty(AW_DUMP_CLOSURES, null); 55 DUMP_JIT_CLOSURES = "yes".equalsIgnoreCase(dumpJP) || "true".equalsIgnoreCase(dumpJP); 56 String dumpFactories = System.getProperty(AW_DUMP_FACTORIES, null); 57 DUMP_JIT_FACTORIES = "yes".equalsIgnoreCase(dumpFactories) || "true".equalsIgnoreCase(dumpFactories); 58 String verbose = System.getProperty(AW_PRINT_DEPLOYMENT_INFO, null); 59 PRINT_DEPLOYMENT_INFO = "yes".equalsIgnoreCase(verbose) || "true".equalsIgnoreCase(verbose); 60 String details = System.getProperty(AW_VERBOSE_LOGGING, null); 61 VERBOSE_LOGGING = "yes".equalsIgnoreCase(details) || "true".equalsIgnoreCase(details); 62 String genjp = System.getProperty(AW_EAGERLY_GENERATE_CLOSURES, null); 63 EAGERLY_GENERATE_CLOSURE = "yes".equalsIgnoreCase(genjp) || "true".equalsIgnoreCase(genjp); 64 String dumpPattern = System.getProperty(AW_DUMP_PATTERN, null); 65 if (dumpPattern == null) { 66 DUMP_BEFORE = false; 67 DUMP_AFTER = false; 68 DUMP_PATTERN = null; 69 } else { 70 dumpPattern = dumpPattern.trim(); 71 DUMP_AFTER = true; 72 DUMP_BEFORE = dumpPattern.indexOf(",before") > 0; 73 if (DUMP_BEFORE) { 74 DUMP_PATTERN = Pattern.compileTypePattern(dumpPattern.substring(0, dumpPattern.indexOf(',')), 75 SubtypePatternType.NOT_HIERARCHICAL); 76 } else { 77 DUMP_PATTERN = Pattern.compileTypePattern(dumpPattern, SubtypePatternType.NOT_HIERARCHICAL); 78 } 79 } 80 DUMP_DIR_CLOSURES = "_dump/closures"; 81 DUMP_DIR_BEFORE = "_dump/before"; 82 DUMP_DIR_AFTER = "_dump/after"; 83 DUMP_DIR_FACTORIES = "_dump/factories"; 84 } 85 86 } 87 | Popular Tags |