01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package org.terracotta.dso.views;
05:
06: import com.terracottatech.config.DsoApplication;
07: import com.terracottatech.config.Include;
08: import com.terracottatech.config.InstrumentedClasses;
09:
10: public class InstrumentedClassesWrapper {
11: private DsoApplication fApp;
12:
13: InstrumentedClassesWrapper(DsoApplication dsoApp) {
14: fApp = dsoApp;
15: }
16:
17: int sizeOfIncludeArray() {
18: InstrumentedClasses ic = fApp.getInstrumentedClasses();
19: return ic != null ? ic.sizeOfIncludeArray() : 0;
20: }
21:
22: Include getIncludeArray(int i) {
23: InstrumentedClasses ic = fApp.getInstrumentedClasses();
24: return ic != null ? ic.getIncludeArray(i) : null;
25: }
26:
27: void removeInclude(int i) {
28: InstrumentedClasses ic = fApp.getInstrumentedClasses();
29: if (ic != null) {
30: ic.removeInclude(i);
31: }
32: testRemove();
33: }
34:
35: int sizeOfExcludeArray() {
36: InstrumentedClasses ic = fApp.getInstrumentedClasses();
37: return ic != null ? ic.sizeOfExcludeArray() : 0;
38: }
39:
40: String getExcludeArray(int i) {
41: InstrumentedClasses ic = fApp.getInstrumentedClasses();
42: return ic != null ? ic.getExcludeArray(i) : null;
43: }
44:
45: void removeExclude(int i) {
46: InstrumentedClasses ic = fApp.getInstrumentedClasses();
47: if (ic != null) {
48: ic.removeExclude(i);
49: }
50: testRemove();
51: }
52:
53: private void testRemove() {
54: InstrumentedClasses ic = fApp.getInstrumentedClasses();
55: if (ic != null) {
56: if (ic.sizeOfExcludeArray() == 0
57: && ic.sizeOfIncludeArray() == 0) {
58: fApp.unsetInstrumentedClasses();
59: }
60: }
61: }
62: }
|