KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > grlea > logBridge > impl > NullLogBridgeFactory


1 package org.grlea.logBridge.impl;
2
3 // $Id: NullLogBridgeFactory.java,v 1.1 2005/03/02 10:46:04 grlea Exp $
4
// Copyright (c) 2005 Graham Lea. All rights reserved.
5

6 // Licensed under the Apache License, Version 2.0 (the "License");
7
// you may not use this file except in compliance with the License.
8
// You may obtain a copy of the License at
9
//
10
// http://www.apache.org/licenses/LICENSE-2.0
11
//
12
// Unless required by applicable law or agreed to in writing, software
13
// distributed under the License is distributed on an "AS IS" BASIS,
14
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
// See the License for the specific language governing permissions and
16
// limitations under the License.
17

18 import org.grlea.logBridge.LogBridge;
19 import org.grlea.logBridge.LogBridgeFactory;
20
21 /**
22  * <p>A {@link LogBridgeFactory} implementation that returns {@link LogBridge}s that do nothing.</p>
23  *
24  * @author grlea
25  * @version $Revision: 1.1 $
26  */

27 public class
28 NullLogBridgeFactory
29 implements LogBridgeFactory
30 {
31    private final Bridge bridge = new Bridge();
32
33    public
34    NullLogBridgeFactory()
35    {}
36
37    public LogBridge
38    getLogBridge(Class JavaDoc sourceClass)
39    {
40       return bridge;
41    }
42
43    private static final class
44    Bridge
45    implements LogBridge
46    {
47       public boolean
48       isErrorEnabled()
49       {
50          return false;
51       }
52
53       public boolean
54       isWarnEnabled()
55       {
56          return false;
57       }
58
59       public boolean
60       isInfoEnabled()
61       {
62          return false;
63       }
64
65       public boolean
66       isDebugEnabled()
67       {
68          return false;
69       }
70
71       public boolean
72       isVerboseEnabled()
73       {
74          return false;
75       }
76
77       public boolean
78       isTracingEnabled()
79       {
80          return false;
81       }
82
83       public void
84       error(String JavaDoc message)
85       {}
86
87       public void
88       error(String JavaDoc objectName, Object JavaDoc value)
89       {}
90
91       public void
92       error(Throwable JavaDoc error)
93       {}
94
95       public void
96       warn(String JavaDoc message)
97       {}
98
99       public void
100       warn(String JavaDoc objectName, Object JavaDoc value)
101       {}
102
103       public void
104       warn(Throwable JavaDoc error)
105       {}
106
107       public void
108       info(String JavaDoc message)
109       {}
110
111       public void
112       info(String JavaDoc objectName, Object JavaDoc value)
113       {}
114
115       public void
116       info(Throwable JavaDoc error)
117       {}
118
119       public void
120       debug(String JavaDoc message)
121       {}
122
123       public void
124       debug(String JavaDoc objectName, Object JavaDoc value)
125       {}
126
127       public void
128       debug(Throwable JavaDoc error)
129       {}
130
131       public void
132       verbose(String JavaDoc message)
133       {}
134
135       public void
136       verbose(String JavaDoc objectName, Object JavaDoc value)
137       {}
138
139       public void
140       verbose(Throwable JavaDoc error)
141       {}
142
143       public void
144       entry(String JavaDoc methodName)
145       {}
146
147       public void
148       exit(String JavaDoc methodName)
149       {}
150    }
151 }
Popular Tags