1 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 ; 17 import java.util.List ; 18 19 22 public class SubtypeMatchingTestApp extends AbstractTransparentApp { 23 24 private List list = new ArrayList (); 25 26 public SubtypeMatchingTestApp(String 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 e) { 37 e.printStackTrace(); 38 throw new RuntimeException (e); 39 } 40 } 41 42 public static void visitL1DSOConfig(ConfigVisitor visitor, DSOClientConfigHelper config) { 43 String 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 |