KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > util > explorer > core > common > lib > BasicLoggable


1 /*====================================================================
2
3 Objectweb Explorer Framework
4 Copyright (C) 2000-2004 INRIA - USTL - LIFL - GOAL
5 Contact: openccm@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Romain Rouvoy.
23 Contributor(s): ______________________________________.
24
25 ====================================================================*/

26 package org.objectweb.util.explorer.core.common.lib;
27
28 import org.objectweb.util.monolog.api.Loggable;
29 import org.objectweb.util.monolog.api.Logger;
30 import org.objectweb.util.monolog.api.LoggerFactory;
31 import org.objectweb.util.trace.TraceTemplate;
32
33 /**
34  *
35  *
36  * @author <a HREF="mailto:Romain.Rouvoy@lifl.fr">Romain Rouvoy</a>.
37  *
38  * @version 0.1
39  */

40 public class BasicLoggable
41   implements Loggable
42 {
43
44     // ==================================================================
45
//
46
// Internal States.
47
//
48
// ==================================================================
49

50     /** Log wrapper. */
51     protected TraceTemplate trace;
52
53     /** LoggerFactory. */
54     protected LoggerFactory factory;
55         
56     // ==================================================================
57
//
58
// Constructors.
59
//
60
// ==================================================================
61

62     // ==================================================================
63
//
64
// Internal methods.
65
//
66
// ==================================================================
67

68     // ==================================================================
69
//
70
// Public methods for Loggable interface.
71
//
72
// ==================================================================
73

74     /**
75     * @return Returns the trace.
76     */

77     protected TraceTemplate getTrace() {
78         return trace;
79     }
80
81     /**
82     * @param trace The trace to set.
83     */

84     protected void setTrace(TraceTemplate trace) {
85         this.trace = trace;
86     }
87
88     /* (non-Javadoc)
89     * @see org.objectweb.util.monolog.api.Loggable#getLogger()
90     */

91     public Logger getLogger() {
92         return getTrace().getLogger();
93     }
94
95     /* (non-Javadoc)
96     * @see org.objectweb.util.monolog.api.Loggable#setLogger(org.objectweb.util.monolog.api.Logger)
97     */

98     public void setLogger(Logger log) {
99         setTrace(new TraceTemplate(log));
100     }
101
102     /* (non-Javadoc)
103     * @see org.objectweb.util.monolog.api.Loggable#getLoggerFactory()
104     */

105     public LoggerFactory getLoggerFactory() {
106         return this.factory;
107     }
108
109     /* (non-Javadoc)
110     * @see org.objectweb.util.monolog.api.Loggable#setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory)
111     */

112     public void setLoggerFactory(LoggerFactory loggerFactory) {
113         this.factory = loggerFactory;
114     }
115     
116 }
117
Popular Tags