01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tctest.longrunning;
05:
06: import com.tc.object.config.ConfigVisitor;
07: import com.tc.object.config.DSOClientConfigHelper;
08: import com.tc.simulator.app.ApplicationConfig;
09: import com.tc.simulator.app.ApplicationConfigBuilder;
10:
11: public class LongrunningGCTestAppConfigBuilder implements
12: ApplicationConfigBuilder {
13:
14: private ConfigVisitor visitor;
15:
16: public LongrunningGCTestAppConfigBuilder() {
17: this .visitor = new ConfigVisitor();
18: }
19:
20: public void visitClassLoaderConfig(DSOClientConfigHelper config) {
21: this .visitor.visit(config, LongrunningGCTestApp.class);
22: }
23:
24: public ApplicationConfig newApplicationConfig() {
25: LongrunningGCTestAppConfigObject rv = new LongrunningGCTestAppConfigObject();
26: try {
27: long sleepTime = Long
28: .parseLong(System
29: .getProperty("com.tctest.longrunning.LongrunningGCTestApp.loopSleepTime"));
30: System.err.println("Setting loop sleep time to: "
31: + sleepTime);
32: rv.setLoopSleepTime(sleepTime);
33: } catch (Exception e) {
34: e.printStackTrace();
35: }
36: return rv;
37: }
38:
39: public static void visitL1DSOConfig(ConfigVisitor visitor,
40: DSOClientConfigHelper cfg) {
41: visitor.visit(cfg, LongrunningGCTestApp.class);
42: }
43:
44: }
|