Java Doc for AbstractSessionLog.java in  » Database-ORM » toplink » oracle » toplink » essentials » 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 » Database ORM » toplink » oracle.toplink.essentials.logging 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   oracle.toplink.essentials.logging.AbstractSessionLog

All known Subclasses:   oracle.toplink.essentials.logging.DefaultSessionLog,  oracle.toplink.essentials.logging.JavaLog,  oracle.toplink.essentials.platform.server.ServerLog,
AbstractSessionLog
abstract public class AbstractSessionLog implements SessionLog,java.lang.Cloneable(Code)
Represents the abstract log that implements all the generic logging functions. It contains a singleton SessionLog that logs messages from outside any TopLink session. The singleton SessionLog can also be passed to a TopLink session when messages are logged through that session. When JDK1.4 is used, a singleton JavaLog is created. Otherwise a singleton DefaultSessionLog is created.
See Also:   SessionLog
See Also:   SessionLogEntry
See Also:   DefaultSessionLog
See Also:   JavaLog


Field Summary
protected static  StringCONFIG_PREFIX
    
final protected static  StringCONNECTION_STRING
    
protected static  StringFINER_PREFIX
    
protected static  StringFINEST_PREFIX
    
protected static  StringFINE_PREFIX
    
protected static  StringINFO_PREFIX
    
protected static  StringSEVERE_PREFIX
    
final protected static  StringTHREAD_STRING
    
protected static  StringTOPLINK_PREFIX
     Cached TopLink prefix string.
protected static  StringWARNING_PREFIX
    
protected  DateFormatdateFormat
     Format use to print the current date/time.
protected static  SessionLogdefaultLog
    
protected  intlevel
    
protected  Sessionsession
    
protected  StringsessionHashCode
    
protected  StringsessionType
    
protected  BooleanshouldLogExceptionStackTrace
     Allows the printing of the stack to be explictitly disabled/enabled.
protected  BooleanshouldPrintConnection
     Allows the printing of the connection to be explictitly disabled/enabled.
protected  BooleanshouldPrintDate
     Allows the printing of the date to be explictitly disabled/enabled.
protected  BooleanshouldPrintSession
     Allows the printing of the session to be explictitly disabled/enabled.
protected  BooleanshouldPrintThread
     Allows the printing of the thread to be explictitly disabled/enabled.
protected  Writerwriter
    

Constructor Summary
public  AbstractSessionLog()
    

Method Summary
protected  DateFormatbuildDefaultDateFormat()
     Build and return a date format.
protected  voidbuildSessionHashCode()
     Return the current session hash code.
protected  voidbuildSessionType()
     Return the current session type.
public  Objectclone()
    
public  voidconfig(String message)
     PUBLIC:

This method is called when a config level message needs to be logged.

public  voidfine(String message)
     PUBLIC:

This method is called when a fine level message needs to be logged.

public  voidfiner(String message)
     PUBLIC:

This method is called when a finer level message needs to be logged.

public  voidfinest(String message)
     PUBLIC:

This method is called when a finest level message needs to be logged.

protected  StringformatMessage(SessionLogEntry entry)
     Return the formatted message based on the information from the given SessionLogEntry.
protected  StringgetConnectionString(Accessor connection)
     Return the specified connection information.
public  DateFormatgetDateFormat()
     PUBLIC: Return the date format to be used when printing a log entry date.
protected  StringgetDateString(Date date)
     Return the specified date and/or time information in string.
public  intgetLevel()
     PUBLIC:

Return the log level.

public  intgetLevel(String category)
     PUBLIC:

Return the log level for the category name space.

the log level


Parameters:
  category - the string representation of a TopLink category, e.g.

public static  SessionLoggetLog()
     PUBLIC:

Return the singleton SessionLog.

public  SessiongetSession()
     PUBLIC:

Get the session.

protected  StringgetSessionString(Session session)
     Return the current session including the type and id.
protected  StringgetSessionString()
     Return the current session including the type and id.
protected  StringgetSupplementDetailString(SessionLogEntry entry)
     Return the supplement detail information including date, session, thread and connection.
protected  StringgetThreadString(Thread thread)
     Return the specified thread information.
public  WritergetWriter()
     PUBLIC:

Return the writer that will receive the formatted log entries.

public  voidinfo(String message)
     PUBLIC:

This method is called when a info level message needs to be logged.

public  booleanisOff()
     PUBLIC: Check if the log level is set to off.
public  voidlog(int level, String message)
     PUBLIC:

Log a message that does not need to be translated.

public  voidlog(int level, String message, Object param)
     INTERNAL:

Log a message with one parameter that needs to be translated.

public  voidlog(int level, String message, Object param1, Object param2)
     INTERNAL:

Log a message with two parameters that needs to be translated.

public  voidlog(int level, String message, Object param1, Object param2, Object param3)
     INTERNAL:

Log a message with three parameters that needs to be translated.

public  voidlog(int level, String message, Object[] params)
     INTERNAL:

Log a message with an array of parameters that needs to be translated.

public  voidlog(int level, String message, Object[] params, boolean shouldTranslate)
     INTERNAL:

Log a message.

abstract public  voidlog(SessionLogEntry sessionLogEntry)
    
public  voidlogThrowable(int level, Throwable throwable)
     PUBLIC:

Log a throwable with level.

protected  voidprintPrefixString(int level)
    
public  voidsetDateFormat(DateFormat dateFormat)
     PUBLIC: Set the date format to be used when printing a log entry date.
public  voidsetLevel(int level)
     PUBLIC:

Set the log level.

public  voidsetLevel(int level, String category)
     PUBLIC:

Set the log level for the category name space.


Parameters:
  level - the new log level
Parameters:
  category - the string representation of a TopLink category, e.g.

public static  voidsetLog(SessionLog sessionLog)
     PUBLIC:

Set the singleton SessionLog.

public  voidsetSession(Session session)
     PUBLIC:

Set the session.

public  voidsetShouldLogExceptionStackTrace(boolean shouldLogExceptionStackTrace)
     By default the stack is logged for FINER or less (finest).
public  voidsetShouldPrintConnection(boolean shouldPrintConnection)
     By default the connection is printed, this can be turned off.
public  voidsetShouldPrintDate(boolean shouldPrintDate)
     By default the date is always printed, but can be turned off.
public  voidsetShouldPrintSession(boolean shouldPrintSession)
     By default the session (and its connection is available) are printed, this can be turned off.
public  voidsetShouldPrintThread(boolean shouldPrintThread)
     By default the thread is logged for FINE or less (finer,etc.).
public  voidsetWriter(Writer writer)
     PUBLIC:

Set the writer that will receive the formatted log entries.

public  voidsevere(String message)
     PUBLIC:

This method is called when a severe level message needs to be logged.

public  booleanshouldLog(int level)
     PUBLIC:

Check if a message of the given level would actually be logged.

public  booleanshouldLog(int level, String category)
     PUBLIC:

Check if a message of the given level would actually be logged for the category name space. !isOff() is checked to screen out the possibility when both log level and log request level are set to OFF.

true if the given message level will be logged


Parameters:
  level - the log request level
Parameters:
  category - the string representation of a TopLink category, e.g.

public  booleanshouldLogExceptionStackTrace()
     By default the stack is logged for FINER or less (finest).
public  booleanshouldPrintConnection()
     By default the connection is printed, this can be turned off.
public  booleanshouldPrintDate()
     By default the date is always printed, but can be turned off.
public  booleanshouldPrintSession()
     By default the session (and its connection is available) are printed, this can be turned off.
public  booleanshouldPrintThread()
     By default the thread is logged for FINE or less (finer,etc.).
public  voidthrowing(Throwable throwable)
     PUBLIC:

Log a throwable at FINER level.

public static  StringtranslateLoggingLevelToString(int loggingLevel)
     INTERNAL: Translate the string value of the log level to the constant value.
public static  inttranslateStringToLoggingLevel(String loggingLevel)
     INTERNAL: Translate the string value of the log level to the constant value.
public  voidwarning(String message)
     PUBLIC:

This method is called when a warning level message needs to be logged.


Field Detail
CONFIG_PREFIX
protected static String CONFIG_PREFIX(Code)
Represents prefix to logged config



CONNECTION_STRING
final protected static String CONNECTION_STRING(Code)
Connection string



FINER_PREFIX
protected static String FINER_PREFIX(Code)
Represents prefix to logged finer



FINEST_PREFIX
protected static String FINEST_PREFIX(Code)
Represents prefix to logged finest



FINE_PREFIX
protected static String FINE_PREFIX(Code)
Represents prefix to logged fine



INFO_PREFIX
protected static String INFO_PREFIX(Code)
Represents prefix to logged info



SEVERE_PREFIX
protected static String SEVERE_PREFIX(Code)
Represents prefix to logged severe



THREAD_STRING
final protected static String THREAD_STRING(Code)
Thread string



TOPLINK_PREFIX
protected static String TOPLINK_PREFIX(Code)
Cached TopLink prefix string.



WARNING_PREFIX
protected static String WARNING_PREFIX(Code)
Represents prefix to logged warning



dateFormat
protected DateFormat dateFormat(Code)
Format use to print the current date/time.



defaultLog
protected static SessionLog defaultLog(Code)
Represents the singleton SessionLog



level
protected int level(Code)
Represents the log level



session
protected Session session(Code)
Represents the session that owns this SessionLog



sessionHashCode
protected String sessionHashCode(Code)
Caches the session hash code string of the session that owns this SessionLog



sessionType
protected String sessionType(Code)
Represents the session type of the session that owns this SessionLog



shouldLogExceptionStackTrace
protected Boolean shouldLogExceptionStackTrace(Code)
Allows the printing of the stack to be explictitly disabled/enabled. CR #3870467. null value is default behavoir of determining from log level.



shouldPrintConnection
protected Boolean shouldPrintConnection(Code)
Allows the printing of the connection to be explictitly disabled/enabled. CR #4157545. null value is default behavoir of determining from log level.



shouldPrintDate
protected Boolean shouldPrintDate(Code)
Allows the printing of the date to be explictitly disabled/enabled. CR #3870467. null value is default behavoir of determining from log level.



shouldPrintSession
protected Boolean shouldPrintSession(Code)
Allows the printing of the session to be explictitly disabled/enabled. CR #3870467. null value is default behavoir of determining from log level.



shouldPrintThread
protected Boolean shouldPrintThread(Code)
Allows the printing of the thread to be explictitly disabled/enabled. CR #3870467. null value is default behavoir of determining from log level.



writer
protected Writer writer(Code)
Represents the writer that will receive the formatted log entries




Constructor Detail
AbstractSessionLog
public AbstractSessionLog()(Code)
PUBLIC: Create a new AbstractSessionLog




Method Detail
buildDefaultDateFormat
protected DateFormat buildDefaultDateFormat()(Code)
Build and return a date format. The default is a format that is sortable and easily parsed. the date format



buildSessionHashCode
protected void buildSessionHashCode()(Code)
Return the current session hash code.



buildSessionType
protected void buildSessionType()(Code)
Return the current session type.



clone
public Object clone()(Code)
INTERNAL: Each session owns its own session log because session is stored in the session log



config
public void config(String message)(Code)
PUBLIC:

This method is called when a config level message needs to be logged. The message will be translated


Parameters:
  message - the message key




fine
public void fine(String message)(Code)
PUBLIC:

This method is called when a fine level message needs to be logged. The message will be translated


Parameters:
  message - the message key




finer
public void finer(String message)(Code)
PUBLIC:

This method is called when a finer level message needs to be logged. The message will be translated


Parameters:
  message - the message key




finest
public void finest(String message)(Code)
PUBLIC:

This method is called when a finest level message needs to be logged. The message will be translated


Parameters:
  message - the message key




formatMessage
protected String formatMessage(SessionLogEntry entry)(Code)
Return the formatted message based on the information from the given SessionLogEntry. The message will either be translated and formatted or formatted only depending on if the shouldTranslate flag is set to true of false.



getConnectionString
protected String getConnectionString(Accessor connection)(Code)
Return the specified connection information.



getDateFormat
public DateFormat getDateFormat()(Code)
PUBLIC: Return the date format to be used when printing a log entry date. the date format



getDateString
protected String getDateString(Date date)(Code)
Return the specified date and/or time information in string. The format will be determined by the date format settings.



getLevel
public int getLevel()(Code)
PUBLIC:

Return the log level. It is used when session is not available.

the log level




getLevel
public int getLevel(String category)(Code)
PUBLIC:

Return the log level for the category name space.

the log level


Parameters:
  category - the string representation of a TopLink category, e.g. "sql", "transaction" ...




getLog
public static SessionLog getLog()(Code)
PUBLIC:

Return the singleton SessionLog. If the singleton SessionLog does not exist, a new one is created based on the version of JDK being used from the Version class.

the singleton SessionLog




getSession
public Session getSession()(Code)
PUBLIC:

Get the session.

session




getSessionString
protected String getSessionString(Session session)(Code)
Return the current session including the type and id.



getSessionString
protected String getSessionString()(Code)
Return the current session including the type and id.



getSupplementDetailString
protected String getSupplementDetailString(SessionLogEntry entry)(Code)
Return the supplement detail information including date, session, thread and connection.



getThreadString
protected String getThreadString(Thread thread)(Code)
Return the specified thread information.



getWriter
public Writer getWriter()(Code)
PUBLIC:

Return the writer that will receive the formatted log entries.

the log writer




info
public void info(String message)(Code)
PUBLIC:

This method is called when a info level message needs to be logged. The message will be translated


Parameters:
  message - the message key




isOff
public boolean isOff()(Code)
PUBLIC: Check if the log level is set to off.



log
public void log(int level, String message)(Code)
PUBLIC:

Log a message that does not need to be translated. This method is intended for external use when logging messages are wanted within the TopLink output.


Parameters:
  level - the log request level value


Parameters:
  message - the string message




log
public void log(int level, String message, Object param)(Code)
INTERNAL:

Log a message with one parameter that needs to be translated.


Parameters:
  level - the log request level value


Parameters:
  message - the string message


Parameters:
  param - a parameter of the message




log
public void log(int level, String message, Object param1, Object param2)(Code)
INTERNAL:

Log a message with two parameters that needs to be translated.


Parameters:
  level - the log request level value


Parameters:
  message - the string message


Parameters:
  param1 - a parameter of the message


Parameters:
  param2 - second parameter of the message




log
public void log(int level, String message, Object param1, Object param2, Object param3)(Code)
INTERNAL:

Log a message with three parameters that needs to be translated.


Parameters:
  level - the log request level value


Parameters:
  message - the string message


Parameters:
  param1 - a parameter of the message


Parameters:
  param2 - second parameter of the message


Parameters:
  param3 - third parameter of the message




log
public void log(int level, String message, Object[] params)(Code)
INTERNAL:

Log a message with an array of parameters that needs to be translated.


Parameters:
  level - the log request level value


Parameters:
  message - the string message


Parameters:
  params - array of parameters to the message




log
public void log(int level, String message, Object[] params, boolean shouldTranslate)(Code)
INTERNAL:

Log a message. shouldTranslate determines if the message needs to be translated.


Parameters:
  level - the log request level


Parameters:
  message - the string message


Parameters:
  params - array of parameters to the message


Parameters:
  shouldTranslate - true if the message needs to be translated




log
abstract public void log(SessionLogEntry sessionLogEntry)(Code)
PUBLIC:

Log a SessionLogEntry


Parameters:
  entry - SessionLogEntry that holds all the information for a TopLink logging event




logThrowable
public void logThrowable(int level, Throwable throwable)(Code)
PUBLIC:

Log a throwable with level.


Parameters:
  level - the log request level value


Parameters:
  throwable - a Throwable




printPrefixString
protected void printPrefixString(int level)(Code)
Print the prefix string representing TopLink logging



setDateFormat
public void setDateFormat(DateFormat dateFormat)(Code)
PUBLIC: Set the date format to be used when printing a log entry date.
Parameters:
  dateFormat - java.text.DateFormat



setLevel
public void setLevel(int level)(Code)
PUBLIC:

Set the log level. It is used when session is not available.


Parameters:
  level - the new log level




setLevel
public void setLevel(int level, String category)(Code)
PUBLIC:

Set the log level for the category name space.


Parameters:
  level - the new log level
Parameters:
  category - the string representation of a TopLink category, e.g. "sql", "transaction" ...




setLog
public static void setLog(SessionLog sessionLog)(Code)
PUBLIC:

Set the singleton SessionLog.


Parameters:
  sessionLog - a SessionLog




setSession
public void setSession(Session session)(Code)
PUBLIC:

Set the session.


Parameters:
  session - a Session




setShouldLogExceptionStackTrace
public void setShouldLogExceptionStackTrace(boolean shouldLogExceptionStackTrace)(Code)
By default the stack is logged for FINER or less (finest). The logging of the stack can also be explicitly turned on or off.



setShouldPrintConnection
public void setShouldPrintConnection(boolean shouldPrintConnection)(Code)
By default the connection is printed, this can be turned off.



setShouldPrintDate
public void setShouldPrintDate(boolean shouldPrintDate)(Code)
By default the date is always printed, but can be turned off.



setShouldPrintSession
public void setShouldPrintSession(boolean shouldPrintSession)(Code)
By default the session (and its connection is available) are printed, this can be turned off.



setShouldPrintThread
public void setShouldPrintThread(boolean shouldPrintThread)(Code)
By default the thread is logged for FINE or less (finer,etc.). The logging of the thread can also be explicitly turned on or off.



setWriter
public void setWriter(Writer writer)(Code)
PUBLIC:

Set the writer that will receive the formatted log entries.


Parameters:
  writer - the log writer




severe
public void severe(String message)(Code)
PUBLIC:

This method is called when a severe level message needs to be logged. The message will be translated


Parameters:
  message - the message key




shouldLog
public boolean shouldLog(int level)(Code)
PUBLIC:

Check if a message of the given level would actually be logged. It is used when session is not available.

true if the given message level will be logged


Parameters:
  level - the log request level




shouldLog
public boolean shouldLog(int level, String category)(Code)
PUBLIC:

Check if a message of the given level would actually be logged for the category name space. !isOff() is checked to screen out the possibility when both log level and log request level are set to OFF.

true if the given message level will be logged


Parameters:
  level - the log request level
Parameters:
  category - the string representation of a TopLink category, e.g. "sql", "transaction" ...*




shouldLogExceptionStackTrace
public boolean shouldLogExceptionStackTrace()(Code)
By default the stack is logged for FINER or less (finest). The logging of the stack can also be explicitly turned on or off.



shouldPrintConnection
public boolean shouldPrintConnection()(Code)
By default the connection is printed, this can be turned off.



shouldPrintDate
public boolean shouldPrintDate()(Code)
By default the date is always printed, but can be turned off.



shouldPrintSession
public boolean shouldPrintSession()(Code)
By default the session (and its connection is available) are printed, this can be turned off.



shouldPrintThread
public boolean shouldPrintThread()(Code)
By default the thread is logged for FINE or less (finer,etc.). The logging of the thread can also be explicitly turned on or off.



throwing
public void throwing(Throwable throwable)(Code)
PUBLIC:

Log a throwable at FINER level.


Parameters:
  throwable - a Throwable




translateLoggingLevelToString
public static String translateLoggingLevelToString(int loggingLevel)(Code)
INTERNAL: Translate the string value of the log level to the constant value. If value is null or invalid use the default.



translateStringToLoggingLevel
public static int translateStringToLoggingLevel(String loggingLevel)(Code)
INTERNAL: Translate the string value of the log level to the constant value. If value is null or invalid use the default.



warning
public void warning(String message)(Code)
PUBLIC:

This method is called when a warning level message needs to be logged. The message will be translated


Parameters:
  message - the message key




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.