KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tctest > longrunning > LongrunningGCTestAppConfigBuilder


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

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 JavaDoc 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