1 4 package com.tc.config.schema.test; 5 6 10 public class L1ConfigBuilder extends BaseConfigBuilder { 11 12 public L1ConfigBuilder() { 13 super(1, ALL_PROPERTIES); 14 } 15 16 public void setILClass(boolean use) { 17 setProperty("class", use); 18 } 19 20 public void setILClass(String use) { 21 setProperty("class", use); 22 } 23 24 public void setILHierarchy(boolean use) { 25 setProperty("hierarchy", use); 26 } 27 28 public void setILHierarchy(String use) { 29 setProperty("hierarchy", use); 30 } 31 32 public void setILLocks(boolean use) { 33 setProperty("locks", use); 34 } 35 36 public void setILLocks(String use) { 37 setProperty("locks", use); 38 } 39 40 public void setILTransientRoot(boolean use) { 41 setProperty("transient-root", use); 42 } 43 44 public void setILTransientRoot(String use) { 45 setProperty("transient-root", use); 46 } 47 48 public void setILRoots(boolean use) { 49 setProperty("roots", use); 50 } 51 52 public void setILRoots(String use) { 53 setProperty("roots", use); 54 } 55 56 public void setILDistributedMethods(boolean use) { 57 setProperty("distributed-methods", use); 58 } 59 60 public void setILDistributedMethods(String use) { 61 setProperty("distributed-methods", use); 62 } 63 64 public void setRLLockDebug(boolean use) { 65 setProperty("lock-debug", use); 66 } 67 68 public void setRLLockDebug(String use) { 69 setProperty("lock-debug", use); 70 } 71 72 public void setRLPartialInstrumentation(boolean use) { 73 setProperty("partial-instrumentation", use); 74 } 75 76 public void setRLPartialInstrumentation(String use) { 77 setProperty("partial-instrumentation", use); 78 } 79 80 public void setRLNonPortableWarning(boolean use) { 81 setProperty("non-portable-warning", use); 82 } 83 84 public void setRLNonPortableWarning(String use) { 85 setProperty("non-portable-warning", use); 86 } 87 88 public void setRLWaitNotifyDebug(boolean use) { 89 setProperty("wait-notify-debug", use); 90 } 91 92 public void setRLWaitNotifyDebug(String use) { 93 setProperty("wait-notify-debug", use); 94 } 95 96 public void setRLDistributedMethodDebug(boolean use) { 97 setProperty("distributed-method-debug", use); 98 } 99 100 public void setRLDistributedMethodDebug(String use) { 101 setProperty("distributed-method-debug", use); 102 } 103 104 public void setRLNewObjectDebug(boolean use) { 105 setProperty("new-object-debug", use); 106 } 107 108 public void setRLNewObjectDebug(String use) { 109 setProperty("new-object-debug", use); 110 } 111 112 public void setROOAutoLockDetails(boolean use) { 113 setProperty("auto-lock-details", use); 114 } 115 116 public void setROOAutoLockDetails(String use) { 117 setProperty("auto-lock-details", use); 118 } 119 120 public void setROOCaller(boolean use) { 121 setProperty("caller", use); 122 } 123 124 public void setROOCaller(String use) { 125 setProperty("caller", use); 126 } 127 128 public void setROOFullStack(boolean use) { 129 setProperty("full-stack", use); 130 } 131 132 public void setROOFullStack(String use) { 133 setProperty("full-stack", use); 134 } 135 136 public void setMaxInMemoryObjectCount(int value) { 137 setProperty("max-in-memory-object-count", value); 138 } 139 140 public void setMaxInMemoryObjectCount(String value) { 141 setProperty("max-in-memory-object-count", value); 142 } 143 144 public void setLogs(String value) { 145 setProperty("logs", value); 146 } 147 148 private static final String [] DSO_INSTRUMENTATION_LOGGING = new String [] { "class", "hierarchy", "locks", 149 "transient-root", "roots", "distributed-methods" }; 150 private static final String [] DSO_RUNTIME_LOGGING = new String [] { "lock-debug", "partial-instrumentation", 151 "non-portable-warning", "wait-notify-debug", "distributed-method-debug", "new-object-debug" }; 152 private static final String [] DSO_RUNTIME_OUTPUT_OPTIONS = new String [] { "auto-lock-details", "caller", 153 "full-stack" }; 154 155 private static final String [] DSO_DEBUGGING = concat(new Object [] { DSO_INSTRUMENTATION_LOGGING, 156 DSO_RUNTIME_LOGGING, DSO_RUNTIME_OUTPUT_OPTIONS }); 157 private static final String [] DSO = concat(new Object [] { "max-in-memory-object-count", 158 DSO_DEBUGGING }); 159 160 private static final String [] ALL_PROPERTIES = concat(new Object [] { "logs", DSO }); 161 162 public String toString() { 163 return element("logs") + openElement("dso", DSO) + element("max-in-memory-object-count") 164 + openElement("debugging", DSO_DEBUGGING) 165 + elementGroup("instrumentation-logging", DSO_INSTRUMENTATION_LOGGING) 166 + elementGroup("runtime-logging", DSO_RUNTIME_LOGGING) 167 + elementGroup("runtime-output-options", DSO_RUNTIME_OUTPUT_OPTIONS) 168 + closeElement("debugging", DSO_DEBUGGING) + closeElement("dso", DSO); 169 } 170 171 public static L1ConfigBuilder newMinimalInstance() { 172 return new L1ConfigBuilder(); 173 } 174 175 public static void main(String [] args) { 176 L1ConfigBuilder builder = new L1ConfigBuilder(); 177 System.err.println(builder); 178 179 builder.setROOCaller(true); 180 builder.setROOFullStack(false); 181 builder.setLogs("funk"); 182 System.err.println(builder); 183 } 184 185 } 186 | Popular Tags |