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.util;
05:
06: import com.tc.object.config.DSOClientConfigHelper;
07: import com.tc.object.config.TransparencyClassSpec;
08:
09: public class DSOConfigUtil {
10: public static void addWriteAutolock(DSOClientConfigHelper config,
11: Class clazz) {
12: config.addWriteAutolock("* " + clazz.getName() + "*.*(..)");
13: }
14:
15: public static void addRoot(TransparencyClassSpec spec, String root) {
16: spec.addRoot(root, root);
17: }
18:
19: public static void autoLockAndInstrumentClass(
20: DSOClientConfigHelper config, Class clazz) {
21: autoLockAndInstrumentClass(config, clazz, false);
22: }
23:
24: public static void autoLockAndInstrumentClass(
25: DSOClientConfigHelper config, Class clazz,
26: boolean honorTransient) {
27: config.addIncludePattern(clazz.getName(), honorTransient);
28: config.addIncludePattern(clazz.getName() + "$*");
29:
30: addWriteAutolock(config, clazz);
31: }
32: }
|