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 package org.jomc.logging.ri.commons;
37
38 import java.util.logging.Level;
39 import org.apache.commons.logging.Log;
40 import org.apache.commons.logging.LogFactory;
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65 @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.5", comments = "See http://www.jomc.org/jomc/1.5/jomc-tools-1.5" )
66
67
68 public final class CommonsLogger
69 implements
70 org.jomc.logging.Logger,
71 org.jomc.spi.Listener
72 {
73
74
75
76 @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.5", comments = "See http://www.jomc.org/jomc/1.5/jomc-tools-1.5" )
77 public CommonsLogger()
78 {
79
80 super();
81
82 }
83
84
85
86
87 public boolean isConfigEnabled()
88 {
89 return this.getLogger().isDebugEnabled();
90 }
91
92 public void config( final String message )
93 {
94 this.getLogger().debug( message );
95 }
96
97 public void config( final Throwable throwable )
98 {
99 this.getLogger().debug( throwable.getMessage(), throwable );
100 }
101
102 public void config( final String message, final Throwable throwable )
103 {
104 this.getLogger().debug( message, throwable );
105 }
106
107 public boolean isDebugEnabled()
108 {
109 return this.getLogger().isDebugEnabled();
110 }
111
112 public void debug( final String message )
113 {
114 this.getLogger().debug( message );
115 }
116
117 public void debug( final Throwable throwable )
118 {
119 this.getLogger().debug( throwable.getMessage(), throwable );
120 }
121
122 public void debug( final String message, final Throwable throwable )
123 {
124 this.getLogger().debug( message, throwable );
125 }
126
127 public boolean isErrorEnabled()
128 {
129 return this.getLogger().isErrorEnabled();
130 }
131
132 public void error( final String message )
133 {
134 this.getLogger().error( message );
135 }
136
137 public void error( final Throwable throwable )
138 {
139 this.getLogger().error( throwable.getMessage(), throwable );
140 }
141
142 public void error( final String message, final Throwable throwable )
143 {
144 this.getLogger().error( message, throwable );
145 }
146
147 public boolean isFatalEnabled()
148 {
149 return this.getLogger().isFatalEnabled();
150 }
151
152 public void fatal( final String message )
153 {
154 this.getLogger().fatal( message );
155 }
156
157 public void fatal( final Throwable throwable )
158 {
159 this.getLogger().fatal( throwable.getMessage(), throwable );
160 }
161
162 public void fatal( final String message, final Throwable throwable )
163 {
164 this.getLogger().fatal( message, throwable );
165 }
166
167 public boolean isInfoEnabled()
168 {
169 return this.getLogger().isInfoEnabled();
170 }
171
172 public void info( final String message )
173 {
174 this.getLogger().info( message );
175 }
176
177 public void info( final Throwable throwable )
178 {
179 this.getLogger().info( throwable.getMessage(), throwable );
180 }
181
182 public void info( final String message, final Throwable throwable )
183 {
184 this.getLogger().info( message, throwable );
185 }
186
187 public boolean isTraceEnabled()
188 {
189 return this.getLogger().isTraceEnabled();
190 }
191
192 public void trace( final String message )
193 {
194 this.getLogger().trace( message );
195 }
196
197 public void trace( final Throwable throwable )
198 {
199 this.getLogger().trace( throwable.getMessage(), throwable );
200 }
201
202 public void trace( final String message, final Throwable throwable )
203 {
204 this.getLogger().trace( message, throwable );
205 }
206
207 public boolean isWarnEnabled()
208 {
209 return this.getLogger().isWarnEnabled();
210 }
211
212 public void warn( final String message )
213 {
214 this.getLogger().warn( message );
215 }
216
217 public void warn( final Throwable throwable )
218 {
219 this.getLogger().warn( throwable.getMessage(), throwable );
220 }
221
222 public void warn( final String message, final Throwable throwable )
223 {
224 this.getLogger().warn( message, throwable );
225 }
226
227
228
229 public void onLog( final Level level, final String message, final Throwable throwable )
230 {
231 if ( level != null )
232 {
233 if ( level.intValue() <= Level.FINEST.intValue() )
234 {
235 this.getObjectManagementLogger().trace( message, throwable );
236 }
237 else if ( level.intValue() <= Level.FINER.intValue() )
238 {
239 this.getObjectManagementLogger().debug( message, throwable );
240 }
241 else if ( level.intValue() <= Level.FINE.intValue() )
242 {
243 this.getObjectManagementLogger().debug( message, throwable );
244 }
245 else if ( level.intValue() <= Level.CONFIG.intValue() )
246 {
247 this.getObjectManagementLogger().config( message, throwable );
248 }
249 else if ( level.intValue() <= Level.INFO.intValue() )
250 {
251 this.getObjectManagementLogger().info( message, throwable );
252 }
253 else if ( level.intValue() <= Level.WARNING.intValue() )
254 {
255 this.getObjectManagementLogger().warn( message, throwable );
256 }
257 else if ( level.intValue() <= Level.SEVERE.intValue() )
258 {
259 this.getObjectManagementLogger().error( message, throwable );
260 }
261 else if ( level.intValue() < Level.OFF.intValue() )
262 {
263 this.getObjectManagementLogger().fatal( message, throwable );
264 }
265 }
266 }
267
268
269
270
271
272
273
274
275
276
277
278 public Log getLogger()
279 {
280 return LogFactory.getLog( this.getName() );
281 }
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312 @SuppressWarnings("unused")
313 @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.5", comments = "See http://www.jomc.org/jomc/1.5/jomc-tools-1.5" )
314 private org.jomc.logging.Logger getObjectManagementLogger()
315 {
316 final org.jomc.logging.Logger _d = (org.jomc.logging.Logger) org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getDependency( this, "ObjectManagementLogger" );
317 assert _d != null : "'ObjectManagementLogger' dependency not found.";
318 return _d;
319 }
320
321
322
323
324
325
326
327
328
329
330
331
332 @SuppressWarnings("unused")
333 @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.5", comments = "See http://www.jomc.org/jomc/1.5/jomc-tools-1.5" )
334 public java.lang.String getName()
335 {
336 final java.lang.String _p = (java.lang.String) org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getProperty( this, "name" );
337 assert _p != null : "'name' property not found.";
338 return _p;
339 }
340
341
342
343
344 }