1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.qedeq.kernel.bo.log; |
17 |
|
|
18 |
|
import java.util.ArrayList; |
19 |
|
import java.util.List; |
20 |
|
|
21 |
|
import org.qedeq.base.trace.Trace; |
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
@author |
32 |
|
|
|
|
| 96.9% |
Uncovered Elements: 2 (65) |
Complexity: 27 |
Complexity Density: 0.75 |
|
33 |
|
public final class QedeqLog implements LogListener { |
34 |
|
|
35 |
|
|
36 |
|
private static final Class CLASS = QedeqLog.class; |
37 |
|
|
38 |
|
|
39 |
|
private static QedeqLog instance = new QedeqLog(); |
40 |
|
|
41 |
|
|
42 |
|
private List loggers = new ArrayList(); |
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
@return |
49 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
50 |
9017
|
public static final QedeqLog getInstance() {... |
51 |
9017
|
return instance; |
52 |
|
} |
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
58 |
41
|
private QedeqLog() {... |
59 |
|
|
60 |
|
} |
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
@param |
66 |
|
|
|
|
| 66.7% |
Uncovered Elements: 2 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
67 |
36
|
public synchronized void addLog(final LogListener log) {... |
68 |
36
|
if (log == null) { |
69 |
0
|
return; |
70 |
|
} |
71 |
36
|
loggers.add(log); |
72 |
36
|
Trace.paramInfo(CLASS, this, "addLog(LogListener)", "log", log.getClass()); |
73 |
|
} |
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
@param |
79 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
80 |
37
|
public synchronized void removeLog(final LogListener log) {... |
81 |
37
|
loggers.remove(log); |
82 |
37
|
if (log != null) { |
83 |
36
|
Trace.paramInfo(CLASS, this, "removeLog(LogListener)", "log", log.getClass()); |
84 |
|
} |
85 |
|
} |
86 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 3 |
Complexity Density: 0.75 |
|
87 |
190
|
public synchronized void logMessageState(final String text, final String url) {... |
88 |
373
|
for (int i = 0; i < loggers.size(); i++) { |
89 |
183
|
try { |
90 |
183
|
((LogListener) loggers.get(i)).logMessageState(text, url); |
91 |
|
} catch (RuntimeException e) { |
92 |
1
|
Trace.fatal(CLASS, this, "logMessageState", "LogListener throwed RuntimeException", |
93 |
|
e); |
94 |
|
} |
95 |
|
} |
96 |
|
} |
97 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 3 |
Complexity Density: 0.75 |
|
98 |
33
|
public synchronized void logFailureState(final String text, final String url, final String description) {... |
99 |
50
|
for (int i = 0; i < loggers.size(); i++) { |
100 |
17
|
try { |
101 |
17
|
((LogListener) loggers.get(i)).logFailureState(text, url, description); |
102 |
|
} catch (RuntimeException e) { |
103 |
1
|
Trace.fatal(CLASS, this, "logFailureState", "LogListener throwed RuntimeException", |
104 |
|
e); |
105 |
|
} |
106 |
|
} |
107 |
|
} |
108 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 3 |
Complexity Density: 0.75 |
|
109 |
49
|
public synchronized void logSuccessfulState(final String text, final String url) {... |
110 |
99
|
for (int i = 0; i < loggers.size(); i++) { |
111 |
50
|
try { |
112 |
50
|
((LogListener) loggers.get(i)).logSuccessfulState(text, url); |
113 |
|
} catch (RuntimeException e) { |
114 |
1
|
Trace.fatal(CLASS, this, "logSuccessfulState", |
115 |
|
"LogListener throwed RuntimeException", e); |
116 |
|
} |
117 |
|
} |
118 |
|
} |
119 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 3 |
Complexity Density: 0.75 |
|
120 |
1133
|
public synchronized void logRequest(final String text, final String url) {... |
121 |
1156
|
for (int i = 0; i < loggers.size(); i++) { |
122 |
23
|
try { |
123 |
23
|
((LogListener) loggers.get(i)).logRequest(text, url); |
124 |
|
} catch (RuntimeException e) { |
125 |
1
|
Trace.fatal(CLASS, this, "logRequest", "LogListener throwed RuntimeException", e); |
126 |
|
} |
127 |
|
} |
128 |
|
} |
129 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 3 |
Complexity Density: 0.75 |
|
130 |
1028
|
public synchronized void logSuccessfulReply(final String text, final String url) {... |
131 |
1048
|
for (int i = 0; i < loggers.size(); i++) { |
132 |
20
|
try { |
133 |
20
|
((LogListener) loggers.get(i)).logSuccessfulReply(text, url); |
134 |
|
} catch (RuntimeException e) { |
135 |
1
|
Trace.fatal(CLASS, this, "logSuccessfulReply", "LogListener throwed RuntimeException", |
136 |
|
e); |
137 |
|
} |
138 |
|
} |
139 |
|
} |
140 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 3 |
Complexity Density: 0.75 |
|
141 |
94
|
public synchronized void logFailureReply(final String text, final String url, final String description) {... |
142 |
102
|
for (int i = 0; i < loggers.size(); i++) { |
143 |
8
|
try { |
144 |
8
|
((LogListener) loggers.get(i)).logFailureReply(text, url, description); |
145 |
|
} catch (RuntimeException e) { |
146 |
2
|
Trace.fatal(CLASS, this, "logFailureReply", "LogListener throwed RuntimeException", |
147 |
|
e); |
148 |
|
} |
149 |
|
} |
150 |
|
} |
151 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 3 |
Complexity Density: 0.75 |
|
152 |
6463
|
public synchronized void logMessage(final String text) {... |
153 |
6489
|
for (int i = 0; i < loggers.size(); i++) { |
154 |
26
|
try { |
155 |
26
|
((LogListener) loggers.get(i)).logMessage(text); |
156 |
|
} catch (RuntimeException e) { |
157 |
3
|
Trace.fatal(CLASS, this, "logMessage", "LogListener throwed RuntimeException", e); |
158 |
|
} |
159 |
|
} |
160 |
|
} |
161 |
|
|
162 |
|
|
163 |
|
} |