1 4 package com.tctest.longrunning; 5 6 import com.tc.object.config.ConfigVisitor; 7 import com.tc.object.config.DSOClientConfigHelper; 8 import com.tc.simulator.app.ApplicationConfig; 9 import com.tc.simulator.app.ApplicationConfigBuilder; 10 11 public class LongrunningGCTestAppConfigBuilder implements ApplicationConfigBuilder { 12 13 private ConfigVisitor visitor; 14 15 public LongrunningGCTestAppConfigBuilder() { 16 this.visitor = new ConfigVisitor(); 17 } 18 19 public void visitClassLoaderConfig(DSOClientConfigHelper config) { 20 this.visitor.visit(config, LongrunningGCTestApp.class); 21 } 22 23 public ApplicationConfig newApplicationConfig() { 24 LongrunningGCTestAppConfigObject rv = new LongrunningGCTestAppConfigObject(); 25 try { 26 long sleepTime = Long.parseLong(System.getProperty("com.tctest.longrunning.LongrunningGCTestApp.loopSleepTime")); 27 System.err.println("Setting loop sleep time to: " + sleepTime); 28 rv.setLoopSleepTime(sleepTime); 29 } catch (Exception e) { 30 e.printStackTrace(); 31 } 32 return rv; 33 } 34 35 public static void visitL1DSOConfig(ConfigVisitor visitor, DSOClientConfigHelper cfg) { 36 visitor.visit(cfg, LongrunningGCTestApp.class); 37 } 38 39 } | Popular Tags |