org.x4juli.global.components
Class AbstractExtendedLogRecord

java.lang.Object
  extended byjava.util.logging.LogRecord
      extended byorg.x4juli.global.components.AbstractExtendedLogRecord
All Implemented Interfaces:
ExtendedLogRecord, LogRecord, java.io.Serializable
Direct Known Subclasses:
ExtendedLogRecordImpl, ExtendedLogRecordWrapper

public abstract class AbstractExtendedLogRecord
extends java.util.logging.LogRecord
implements ExtendedLogRecord

An abstract class defining the missing methods for full featured logging. Specifies lazy load of an extend java.util.logging.LogRecord. Information are created just when they are needed and just once for each object.

Since:
0.5
Author:
Boris Unckel
See Also:
Serialized Form

Field Summary
protected  java.lang.String cachedFormattedMessage
          Represents the last formatted message.
private  LocationInfo locationInfo
          Location information for the caller.
private static long START_TIME
           
private  ThrowableInformation throwableInfo
          This variable contains information about this event's throwable.
 
Fields inherited from class java.util.logging.LogRecord
 
Constructor Summary
AbstractExtendedLogRecord(java.util.logging.Level level, java.lang.String msg)
          Constructs a new ExtendedLogRecord.
 
Method Summary
 java.lang.String getFormattedMessage()
          Returns the cached formatted message.
 LocationInfo getLocationInformation()
          Provide extended information about the caller's location. These information should respect the Logger class or any subclasses. (Make use of the correct, corresponding FQCN).
 long getStartTime()
          Provide the time since start of logging.
 ThrowableInformation getThrowableInformation()
          Provide extended information about the attached throwable. Returns null, if there was no throwable in the LogRecord attached.
 void setFormattedMessage(java.lang.String formattedMessage)
          Setup the cache for the formatted message.
 java.lang.String toString()
          
 
Methods inherited from class java.util.logging.LogRecord
getLevel, getLoggerName, getMessage, getMillis, getParameters, getResourceBundle, getResourceBundleName, getSequenceNumber, getSourceClassName, getSourceMethodName, getThreadID, getThrown, setLevel, setLoggerName, setMessage, setMillis, setParameters, setResourceBundle, setResourceBundleName, setSequenceNumber, setSourceClassName, setSourceMethodName, setThreadID, setThrown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.x4juli.global.spi.ExtendedLogRecord
getLevel, getLoggerName, getMessage, getMillis, getParameters, getResourceBundle, getResourceBundleName, getSequenceNumber, getSourceClassName, getSourceMethodName, getThreadID, getThrown, setLevel, setLoggerName, setMessage, setMillis, setParameters, setResourceBundle, setResourceBundleName, setSequenceNumber, setSourceClassName, setSourceMethodName, setThreadID, setThrown
 

Field Detail

START_TIME

private static final long START_TIME

cachedFormattedMessage

protected java.lang.String cachedFormattedMessage
Represents the last formatted message.


throwableInfo

private ThrowableInformation throwableInfo
This variable contains information about this event's throwable.


locationInfo

private LocationInfo locationInfo
Location information for the caller.

Constructor Detail

AbstractExtendedLogRecord

public AbstractExtendedLogRecord(java.util.logging.Level level,
                                 java.lang.String msg)
Constructs a new ExtendedLogRecord.

Parameters:
level - to log.
msg - to format and log.
Method Detail

getThrowableInformation

public ThrowableInformation getThrowableInformation()
Provide extended information about the attached throwable. Returns null, if there was no throwable in the LogRecord attached.

Specified by:
getThrowableInformation in interface ExtendedLogRecord
Returns:
internal representation of Juli for the Throwable
Since:
0.5

getLocationInformation

public LocationInfo getLocationInformation()
Provide extended information about the caller's location. These information should respect the Logger class or any subclasses. (Make use of the correct, corresponding FQCN).

Specified by:
getLocationInformation in interface ExtendedLogRecord
Returns:
internal representation of Juli for the Caller Location
Since:
0.5

getStartTime

public long getStartTime()
Provide the time since start of logging.

Specified by:
getStartTime in interface ExtendedLogRecord
Returns:
the start time of Juli, determined by the first use of the implementor
Since:
0.5

toString

public java.lang.String toString()

Since:
0.5

setFormattedMessage

public void setFormattedMessage(java.lang.String formattedMessage)
Setup the cache for the formatted message.

Specified by:
setFormattedMessage in interface ExtendedLogRecord
Parameters:
formattedMessage - current state of the formatted message.
Since:
0.6

getFormattedMessage

public java.lang.String getFormattedMessage()
Returns the cached formatted message.

Specified by:
getFormattedMessage in interface ExtendedLogRecord
Returns:
the cached formatted message, if cache is empty, returns the message.
Since:
0.6


${license_html}