Source Code Cross Referenced for Jdk14Logger.java in  » Inversion-of-Control » DNA » org » codehaus » dna » impl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Inversion of Control » DNA » org.codehaus.dna.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (C) The DNA Group. All rights reserved.
003:         *
004:         * This software is published under the terms of the DNA
005:         * Software License version 1.1, a copy of which has been included
006:         * with this distribution in the LICENSE.txt file.
007:         */
008:        package org.codehaus.dna.impl;
009:
010:        import java.util.logging.Level;
011:
012:        import org.codehaus.dna.Logger;
013:
014:        /**
015:         * Logging facade implmentation for JDK1.4 logging toolkit.
016:         * The following lists the mapping between DNA log levels
017:         * and JDK1.4 log levels.
018:         *
019:         * <ul>
020:         *   <li>trace ==&gt; finest</li>
021:         *   <li>debug ==&gt; fine</li>
022:         *   <li>info ==&gt; info</li>
023:         *   <li>warn ==&gt; warning</li>
024:         *   <li>error ==&gt; severe</li>
025:         * </ul>
026:         *
027:         * @version $Revision: 1.2 $ $Date: 2004/05/01 09:51:48 $
028:         */
029:        public class Jdk14Logger implements  Logger {
030:            /**
031:             * The JDK1.4 logger.
032:             */
033:            private final java.util.logging.Logger m_logger;
034:
035:            /**
036:             * Create an instance of JDK14Logger facade.
037:             *
038:             * @param logger the JDK1.4 logger.
039:             */
040:            public Jdk14Logger(final java.util.logging.Logger logger) {
041:                if (null == logger) {
042:                    throw new NullPointerException("logger");
043:                }
044:                m_logger = logger;
045:            }
046:
047:            /**
048:             * Log a trace message.
049:             *
050:             * @param message the message
051:             */
052:            public void trace(final String message) {
053:                m_logger.log(Level.FINEST, message);
054:            }
055:
056:            /**
057:             * Log a trace message with an associated throwable.
058:             *
059:             * @param message the message
060:             * @param throwable the throwable
061:             */
062:            public void trace(final String message, final Throwable throwable) {
063:                m_logger.log(Level.FINEST, message, throwable);
064:            }
065:
066:            /**
067:             * Return true if a trace message will be logged.
068:             *
069:             * @return true if message will be logged
070:             */
071:            public boolean isTraceEnabled() {
072:                return m_logger.isLoggable(Level.FINEST);
073:            }
074:
075:            /**
076:             * Log a debug message.
077:             *
078:             * @param message the message
079:             */
080:            public void debug(final String message) {
081:                m_logger.log(Level.FINE, message);
082:            }
083:
084:            /**
085:             * Log a debug message with an associated throwable.
086:             *
087:             * @param message the message
088:             * @param throwable the throwable
089:             */
090:            public void debug(final String message, final Throwable throwable) {
091:                m_logger.log(Level.FINE, message, throwable);
092:            }
093:
094:            /**
095:             * Return true if a debug message will be logged.
096:             *
097:             * @return true if message will be logged
098:             */
099:            public boolean isDebugEnabled() {
100:                return m_logger.isLoggable(Level.FINE);
101:            }
102:
103:            /**
104:             * Log a info message.
105:             *
106:             * @param message the message
107:             */
108:            public void info(final String message) {
109:                m_logger.log(Level.INFO, message);
110:            }
111:
112:            /**
113:             * Log a info message with an associated throwable.
114:             *
115:             * @param message the message
116:             * @param throwable the throwable
117:             */
118:            public void info(final String message, final Throwable throwable) {
119:                m_logger.log(Level.INFO, message, throwable);
120:            }
121:
122:            /**
123:             * Return true if an info message will be logged.
124:             *
125:             * @return true if message will be logged
126:             */
127:            public boolean isInfoEnabled() {
128:                return m_logger.isLoggable(Level.INFO);
129:            }
130:
131:            /**
132:             * Log a warn message.
133:             *
134:             * @param message the message
135:             */
136:            public void warn(final String message) {
137:                m_logger.log(Level.WARNING, message);
138:            }
139:
140:            /**
141:             * Log a warn message with an associated throwable.
142:             *
143:             * @param message the message
144:             * @param throwable the throwable
145:             */
146:            public void warn(final String message, final Throwable throwable) {
147:                m_logger.log(Level.WARNING, message, throwable);
148:            }
149:
150:            /**
151:             * Return true if a warn message will be logged.
152:             *
153:             * @return true if message will be logged
154:             */
155:            public boolean isWarnEnabled() {
156:                return m_logger.isLoggable(Level.WARNING);
157:            }
158:
159:            /**
160:             * Log a error message.
161:             *
162:             * @param message the message
163:             */
164:            public void error(final String message) {
165:                m_logger.log(Level.SEVERE, message);
166:            }
167:
168:            /**
169:             * Log a error message with an associated throwable.
170:             *
171:             * @param message the message
172:             * @param throwable the throwable
173:             */
174:            public void error(final String message, final Throwable throwable) {
175:                m_logger.log(Level.SEVERE, message, throwable);
176:            }
177:
178:            /**
179:             * Return true if a error message will be logged.
180:             *
181:             * @return true if message will be logged
182:             */
183:            public boolean isErrorEnabled() {
184:                return m_logger.isLoggable(Level.SEVERE);
185:            }
186:
187:            /**
188:             * Get the child logger with specified name.
189:             *
190:             * @param name the name of child logger
191:             * @return the child logger
192:             */
193:            public Logger getChildLogger(final String name) {
194:                final String childName = m_logger.getName() + "." + name;
195:                return new Jdk14Logger(java.util.logging.Logger
196:                        .getLogger(childName));
197:            }
198:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.