KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tctest > SubtypeMatchingTestApp


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

5 package com.tctest;
6
7 import com.tc.object.config.ConfigVisitor;
8 import com.tc.object.config.DSOClientConfigHelper;
9 import com.tc.object.config.TransparencyClassSpec;
10 import com.tc.simulator.app.ApplicationConfig;
11 import com.tc.simulator.listener.ListenerProvider;
12 import com.tctest.runner.AbstractTransparentApp;
13 import com.tctest.transparency.MatchingSubclass1;
14 import com.tctest.transparency.MatchingSubclass2;
15
16 import java.util.ArrayList JavaDoc;
17 import java.util.List JavaDoc;
18
19 /**
20  * @author Eugene Kuleshov
21  */

22 public class SubtypeMatchingTestApp extends AbstractTransparentApp {
23
24   private List JavaDoc list = new ArrayList JavaDoc();
25
26   public SubtypeMatchingTestApp(String JavaDoc appId, ApplicationConfig cfg, ListenerProvider listenerProvider) {
27     super(appId, cfg, listenerProvider);
28   }
29
30   public void run() {
31     try {
32       synchronized (list) {
33         list.add(new MatchingSubclass1());
34         list.add(new MatchingSubclass2());
35       }
36     } catch (Exception JavaDoc e) {
37       e.printStackTrace();
38       throw new RuntimeException JavaDoc(e);
39     }
40   }
41
42   public static void visitL1DSOConfig(ConfigVisitor visitor, DSOClientConfigHelper config) {
43     String JavaDoc testClass = ArrayTestApp.class.getName();
44     TransparencyClassSpec spec = config.getOrCreateSpec(testClass);
45     spec.addRoot("list", "list");
46     
47     config.addWriteAutolock("* " + testClass + "*.*(..)");
48
49     config.addIncludePattern("com.tctest.transparency.MarkerInterface+");
50     config.addIncludePattern("com.tctest.transparency.MatchingClass+");
51   }
52
53 }
54
Popular Tags