GlobalTraceStore.java
1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa.ut.trace;
import com.adobe.xfa.ut.trace.Trace;
import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
final class GlobalTraceStore {
private static final GlobalTraceStore mInstance = new GlobalTraceStore();
private final ConcurrentMap<String, Trace> mTraceAreas = new ConcurrentHashMap<String, Trace>();
private volatile boolean mbEnabled;
void addTrace(Trace trace) {
Trace existingTrace = this.mTraceAreas.putIfAbsent(trace.getName(), trace);
if (existingTrace != null && existingTrace.isPlaceHolder() && !trace.isPlaceHolder()) {
existingTrace.setHelpId(trace.getHelpId());
existingTrace.setPlaceHolder(false);
return;
}
}
void removeTrace(Trace trace) {
this.mTraceAreas.remove(trace.getName());
}
static GlobalTraceStore getStore() {
return mInstance;
}
Collection<Trace> getTraceSections() {
return this.mTraceAreas.values();
}
void ensureTraceExists(String sName) {
if (!this.mTraceAreas.containsKey(sName)) {
this.addTrace(new Trace(sName));
}
}
void enable() {
this.mbEnabled = true;
}
boolean isEnabled() {
return this.mbEnabled;
}
protected GlobalTraceStore() {
}
}