Java Doc for LoggerAdapter.java in  » GIS » GeoTools-2.4.1 » org » geotools » util » logging » 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 » GIS » GeoTools 2.4.1 » org.geotools.util.logging 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.util.logging.Logger
      org.geotools.util.logging.LoggerAdapter

All known Subclasses:   org.geotools.util.logging.Log4JLogger,  org.geotools.util.logging.CommonsLogger,
LoggerAdapter
abstract public class LoggerAdapter extends Logger (Code)
An adapter that redirect all Java logging events to an other logging framework. This class redefines the LoggerAdapter.severe(String) severe , LoggerAdapter.warning(String) warning , LoggerAdapter.info(String) info , LoggerAdapter.config(String) config , LoggerAdapter.fine(String) fine , LoggerAdapter.finer(String) finer and LoggerAdapter.finest(String) finest methods as abstract ones. Subclasses should implement those methods in order to map Java logging levels to the backend logging framework.

All LoggerAdapter.log(Level,String) log methods are overriden in order to redirect to one of the above-cited methods. Note that this is the opposite approach than the Java logging framework one, which implemented everything on top of Logger.log(LogRecord) . This adapter is defined in terms of LoggerAdapter.severe(String) severe … LoggerAdapter.finest(String) finest methods instead because external frameworks like Commons-logging don't work with LogRecord , and sometime provides nothing else than convenience methods equivalent to LoggerAdapter.severe(String) severe … LoggerAdapter.finest(String) finest .

Restrictions
Because the configuration is expected to be fully controled by the external logging framework, every configuration methods inherited from Logger are disabled:

Since LoggerAdapter s do not hold any configuration by themself, it is not strictly necessary to . The adapters can be created, garbage-collected and recreated again while preserving their behavior since their configuration is entirely contained in the external logging framework.

Localization
This logger is always created without resource bundles. Localizations must be performed through explicit calls to logrb or LoggerAdapter.log(LogRecord) methods. This is suffisient for GeoTools needs, which performs all localizations through the later. Note that those methods will be slower in this LoggerAdapter than the default Logger because this adapter localizes and formats records immediately instead of letting the performs this work only if needed.

Logging levels
If a log record is not one of the predefined ones, then this class maps to the first level below the specified one. For example if a log record has some level between Level.FINE FINE and Level.FINER FINER , then the LoggerAdapter.finer finer method will be invoked. See LoggerAdapter.isLoggable for implementation tips taking advantage of this rule.
since:
   2.4
version:
   $Id: LoggerAdapter.java 28037 2007-11-24 14:19:24Z aaime $
author:
   Martin Desruisseaux
See Also:   Logging




Constructor Summary
protected  LoggerAdapter(String name)
     Creates a new logger.

Method Summary
public  voidaddHandler(Handler handler)
     Do nothing since this logger adapter does not supports handlers. The configuration should be fully controlled by the external logging framework (e.g.
abstract public  voidconfig(String message)
     Logs an Level.CONFIG CONFIG message.
public  voidentering(String sourceClass, String sourceMethod)
     Logs a method entry to the .
public  voidentering(String sourceClass, String sourceMethod, Object param)
     Logs a method entry to the with one parameter.
public  voidentering(String sourceClass, String sourceMethod, Object[] params)
     Logs a method entry to the with many parameters.
public  voidexiting(String sourceClass, String sourceMethod)
     Logs a method return to the .
public  voidexiting(String sourceClass, String sourceMethod, Object result)
     Logs a method return to the .
abstract public  voidfine(String message)
     Logs a Level.FINE FINE message.
abstract public  voidfiner(String message)
     Logs a Level.FINER FINER message.
abstract public  voidfinest(String message)
     Logs a Level.FINEST FINEST message.
protected  LevelgetDebugLevel()
     Returns the level for LoggerAdapter.entering , LoggerAdapter.exiting and LoggerAdapter.throwing methods. The default implementation returns Level.FINER , which is consistent with the value used in the Java logging framework.
abstract public  LevelgetLevel()
     Returns the level for this logger.
abstract public  voidinfo(String message)
     Logs an Level.INFO INFO message.
abstract public  booleanisLoggable(Level level)
     Returns true if the specified level is loggable.

Implementation tip
Given that Level.intValue for all predefined levels are documented in the Level specification and are multiple of 100, given that integer divisions are rounded toward zero and given rule documented in this class javadoc, then logging levels can be efficiently mapped to predefined levels using switch statements as below.

public  voidlog(LogRecord record)
     Logs a record.
public  voidlog(Level level, String message)
     Logs a record at the specified level.
public  voidlog(Level level, String message, Throwable thrown)
     Logs a record at the specified level.
public  voidlog(Level level, String message, Object param)
     Logs a record at the specified level.
public  voidlog(Level level, String message, Object[] params)
     Logs a record at the specified level.
public  voidlogp(Level level, String sourceClass, String sourceMethod, String message)
     Logs a record at the specified level.
public  voidlogp(Level level, String sourceClass, String sourceMethod, String message, Throwable thrown)
     Logs a record at the specified level.
public  voidlogp(Level level, String sourceClass, String sourceMethod, String message, Object param)
     Logs a record at the specified level.
public  voidlogp(Level level, String sourceClass, String sourceMethod, String message, Object[] params)
     Logs a record at the specified level.
public  voidlogrb(Level level, String sourceClass, String sourceMethod, String bundleName, String message)
     Logs a localizable record at the specified level.
public  voidlogrb(Level level, String sourceClass, String sourceMethod, String bundleName, String message, Throwable thrown)
     Logs a localizable record at the specified level.
public  voidlogrb(Level level, String sourceClass, String sourceMethod, String bundleName, String message, Object param)
     Logs a localizable record at the specified level.
public  voidlogrb(Level level, String sourceClass, String sourceMethod, String bundleName, String message, Object[] params)
     Logs a localizable record at the specified level.
public  voidremoveHandler(Handler handler)
     Do nothing since this logger adapter does not support handlers.
public  voidsetFilter(Filter filter)
     Do nothing since this logger adapter does not support filters.
abstract public  voidsetLevel(Level level)
     Sets the level for this logger.
public  voidsetParent(Logger parent)
     Do nothing since this logger adapter does not support arbitrary parents.
public  voidsetUseParentHandlers(boolean useParentHandlers)
     Do nothing since this logger never use parent handlers.
abstract public  voidsevere(String message)
     Logs a Level.SEVERE SEVERE message.
public  voidthrowing(String sourceClass, String sourceMethod, Throwable thrown)
     Logs a method failure to the .
abstract public  voidwarning(String message)
     Logs a Level.WARNING WARNING message.


Constructor Detail
LoggerAdapter
protected LoggerAdapter(String name)(Code)
Creates a new logger.
Parameters:
  name - The logger name.




Method Detail
addHandler
public void addHandler(Handler handler)(Code)
Do nothing since this logger adapter does not supports handlers. The configuration should be fully controlled by the external logging framework (e.g. Commons-logging) instead, which is not expected to use Handler objects.



config
abstract public void config(String message)(Code)
Logs an Level.CONFIG CONFIG message.



entering
public void entering(String sourceClass, String sourceMethod)(Code)
Logs a method entry to the . Compared to the default Logger , this implementation bypass the level check in order to let the backing logging framework do its own check.



entering
public void entering(String sourceClass, String sourceMethod, Object param)(Code)
Logs a method entry to the with one parameter. Compared to the default Logger , this implementation bypass the level check in order to let the backing logging framework do its own check.



entering
public void entering(String sourceClass, String sourceMethod, Object[] params)(Code)
Logs a method entry to the with many parameters. Compared to the default Logger , this implementation bypass the level check in order to let the backing logging framework do its own check.



exiting
public void exiting(String sourceClass, String sourceMethod)(Code)
Logs a method return to the . Compared to the default Logger , this implementation bypass the level check in order to let the backing logging framework do its own check.



exiting
public void exiting(String sourceClass, String sourceMethod, Object result)(Code)
Logs a method return to the . Compared to the default Logger , this implementation bypass the level check in order to let the backing logging framework do its own check.



fine
abstract public void fine(String message)(Code)
Logs a Level.FINE FINE message.



finer
abstract public void finer(String message)(Code)
Logs a Level.FINER FINER message.



finest
abstract public void finest(String message)(Code)
Logs a Level.FINEST FINEST message.



getDebugLevel
protected Level getDebugLevel()(Code)
Returns the level for LoggerAdapter.entering , LoggerAdapter.exiting and LoggerAdapter.throwing methods. The default implementation returns Level.FINER , which is consistent with the value used in the Java logging framework. Subclasses should override this method if a different debug level is wanted.



getLevel
abstract public Level getLevel()(Code)
Returns the level for this logger. Subclasses shall get this level from the external logging framework.



info
abstract public void info(String message)(Code)
Logs an Level.INFO INFO message.



isLoggable
abstract public boolean isLoggable(Level level)(Code)
Returns true if the specified level is loggable.

Implementation tip
Given that Level.intValue for all predefined levels are documented in the Level specification and are multiple of 100, given that integer divisions are rounded toward zero and given rule documented in this class javadoc, then logging levels can be efficiently mapped to predefined levels using switch statements as below. This statement has good chances to be compiled to the tableswitch bytecode rather than lookupswitch (see Compiling Switches in The Java Virtual Machine Specification).

 "fallthrough")
 public boolean isLoggable(Level level) {
 final int n = level.intValue();
 switch (n / 100) {
 default: {
 // MAX_VALUE is a special value for Level.OFF. Otherwise and
 // if positive, fallthrough since we are greater than SEVERE.
 switch (n) {
 case Integer.MIN_VALUE: return true;  // Level.ALL
 case Integer.MAX_VALUE: return false; // Level.OFF
 default: if (n < 0) return false;
 }
 }
 case 10: return isSevereEnabled();
 case  9: return isWarningEnabled();
 case  8: return isInfoEnabled();
 case  7: return isConfigEnabled();
 case  6: // fallthrough
 case  5: return isFineEnabled();
 case  4: return isFinerEnabled();
 case  3: return isFinestEnabled();
 case  2: // fallthrough
 case  1: // fallthrough
 case  0: return false;
 }
 }
 



log
public void log(LogRecord record)(Code)
Logs a record. The default implementation delegates to LoggerAdapter.logrb(Level,String,String,String,String,Object[]) logrb .



log
public void log(Level level, String message)(Code)
Logs a record at the specified level. The default implementation delegates to one of the LoggerAdapter.severe(String) severe , LoggerAdapter.warning(String) warning , LoggerAdapter.info(String) info , LoggerAdapter.config(String) config , LoggerAdapter.fine(String) fine , LoggerAdapter.finer(String) finer or LoggerAdapter.finest(String) finest methods according the supplied level.



log
public void log(Level level, String message, Throwable thrown)(Code)
Logs a record at the specified level. The default implementation discards the exception and delegates to (level, message).



log
public void log(Level level, String message, Object param)(Code)
Logs a record at the specified level. The defaut implementation delegates to (level, message, params) where the params array is built from the param object.



log
public void log(Level level, String message, Object[] params)(Code)
Logs a record at the specified level. The defaut implementation formats the message immediately, then delegates to (level, message).



logp
public void logp(Level level, String sourceClass, String sourceMethod, String message)(Code)
Logs a record at the specified level. The defaut implementation discards the source class and source method, then delegates to (level, message).



logp
public void logp(Level level, String sourceClass, String sourceMethod, String message, Throwable thrown)(Code)
Logs a record at the specified level. The defaut implementation discards the source class and source method, then delegates to (level, message, thrown).



logp
public void logp(Level level, String sourceClass, String sourceMethod, String message, Object param)(Code)
Logs a record at the specified level. The defaut implementation delegates to (level, sourceClass, sourceMethod, message, params) where the params array is built from the param object.

Note that sourceClass and sourceMethod will be discarted unless the target LoggerAdapter.logp(Level,String,String,String) logp method has been overriden.




logp
public void logp(Level level, String sourceClass, String sourceMethod, String message, Object[] params)(Code)
Logs a record at the specified level. The defaut implementation formats the message immediately, then delegates to (level, sourceClass, sourceMethod, message).

Note that sourceClass and sourceMethod will be discarted unless the target LoggerAdapter.logp(Level,String,String,String) logp method has been overriden.




logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String message)(Code)
Logs a localizable record at the specified level. The defaut implementation localizes the message immediately, then delegates to (level, sourceClass, sourceMethod, message).



logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String message, Throwable thrown)(Code)
Logs a localizable record at the specified level. The defaut implementation localizes the message immediately, then delegates to (level, sourceClass, sourceMethod, message, thrown).



logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String message, Object param)(Code)
Logs a localizable record at the specified level. The defaut implementation localizes the message immediately, then delegates to (level, sourceClass, sourceMethod, message, param).



logrb
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String message, Object[] params)(Code)
Logs a localizable record at the specified level. The defaut implementation localizes the message immediately, then delegates to (level, sourceClass, sourceMethod, message, params).



removeHandler
public void removeHandler(Handler handler)(Code)
Do nothing since this logger adapter does not support handlers.



setFilter
public void setFilter(Filter filter)(Code)
Do nothing since this logger adapter does not support filters. It is difficult to query efficiently the filter in this LoggerAdapter architecture (e.g. we would need to make sure that Filter.isLoggable is invoked only once even if a log call is cascaded into many other log calls, and this test must works in multi-threads environment).



setLevel
abstract public void setLevel(Level level)(Code)
Sets the level for this logger. Subclasses must redirect the call to the external logging framework, or do nothing if the level can not be changed programmatically.



setParent
public void setParent(Logger parent)(Code)
Do nothing since this logger adapter does not support arbitrary parents. More specifically, it should not inherits any configuration from a parent logger using the Java logging framework.



setUseParentHandlers
public void setUseParentHandlers(boolean useParentHandlers)(Code)
Do nothing since this logger never use parent handlers. This is consistent with LoggerAdapter.addHandler not allowing to add any handlers, and avoid mixing loggings from the external framework with Java loggings.



severe
abstract public void severe(String message)(Code)
Logs a Level.SEVERE SEVERE message.



throwing
public void throwing(String sourceClass, String sourceMethod, Throwable thrown)(Code)
Logs a method failure to the . Compared to the default Logger , this implementation bypass the level check in order to let the backing logging framework do its own check.



warning
abstract public void warning(String message)(Code)
Logs a Level.WARNING WARNING message.



Fields inherited from java.util.logging.Logger
final public static String GLOBAL_LOGGER_NAME(Code)(Java Doc)
final public static Logger global(Code)(Java Doc)

Methods inherited from java.util.logging.Logger
public synchronized void addHandler(Handler handler) throws SecurityException(Code)(Java Doc)
public void config(String msg)(Code)(Java Doc)
public void entering(String sourceClass, String sourceMethod)(Code)(Java Doc)
public void entering(String sourceClass, String sourceMethod, Object param1)(Code)(Java Doc)
public void entering(String sourceClass, String sourceMethod, Object params)(Code)(Java Doc)
public void exiting(String sourceClass, String sourceMethod)(Code)(Java Doc)
public void exiting(String sourceClass, String sourceMethod, Object result)(Code)(Java Doc)
public void fine(String msg)(Code)(Java Doc)
public void finer(String msg)(Code)(Java Doc)
public void finest(String msg)(Code)(Java Doc)
public static synchronized Logger getAnonymousLogger()(Code)(Java Doc)
public static synchronized Logger getAnonymousLogger(String resourceBundleName)(Code)(Java Doc)
public synchronized Filter getFilter()(Code)(Java Doc)
final public static Logger getGlobal()(Code)(Java Doc)
public synchronized Handler[] getHandlers()(Code)(Java Doc)
public Level getLevel()(Code)(Java Doc)
public static synchronized Logger getLogger(String name)(Code)(Java Doc)
public static synchronized Logger getLogger(String name, String resourceBundleName)(Code)(Java Doc)
public String getName()(Code)(Java Doc)
public Logger getParent()(Code)(Java Doc)
public ResourceBundle getResourceBundle()(Code)(Java Doc)
public String getResourceBundleName()(Code)(Java Doc)
public synchronized boolean getUseParentHandlers()(Code)(Java Doc)
public void info(String msg)(Code)(Java Doc)
public boolean isLoggable(Level level)(Code)(Java Doc)
public void log(LogRecord record)(Code)(Java Doc)
public void log(Level level, String msg)(Code)(Java Doc)
public void log(Level level, String msg, Object param1)(Code)(Java Doc)
public void log(Level level, String msg, Object params)(Code)(Java Doc)
public void log(Level level, String msg, Throwable thrown)(Code)(Java Doc)
public void logp(Level level, String sourceClass, String sourceMethod, String msg)(Code)(Java Doc)
public void logp(Level level, String sourceClass, String sourceMethod, String msg, Object param1)(Code)(Java Doc)
public void logp(Level level, String sourceClass, String sourceMethod, String msg, Object params)(Code)(Java Doc)
public void logp(Level level, String sourceClass, String sourceMethod, String msg, Throwable thrown)(Code)(Java Doc)
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg)(Code)(Java Doc)
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object param1)(Code)(Java Doc)
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object params)(Code)(Java Doc)
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Throwable thrown)(Code)(Java Doc)
public synchronized void removeHandler(Handler handler) throws SecurityException(Code)(Java Doc)
public synchronized void setFilter(Filter newFilter) throws SecurityException(Code)(Java Doc)
public void setLevel(Level newLevel) throws SecurityException(Code)(Java Doc)
public void setParent(Logger parent)(Code)(Java Doc)
public synchronized void setUseParentHandlers(boolean useParentHandlers)(Code)(Java Doc)
public void severe(String msg)(Code)(Java Doc)
public void throwing(String sourceClass, String sourceMethod, Throwable thrown)(Code)(Java Doc)
public void warning(String msg)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.