org.fjank.jcache
Class DefaultCacheLogger

java.lang.Object
  extended by javax.util.jcache.CacheLogger
      extended by org.fjank.jcache.DefaultCacheLogger

public final class DefaultCacheLogger
extends CacheLogger

Logs all messages to System.out for the moment. Reprogram to log to a file later. Does not implement loggerSeverity.

Author:
Frank Karlstrøm

Field Summary
 
Fields inherited from class javax.util.jcache.CacheLogger
DEBUG, DEFAULT, ERROR, FATAL, INFO, OFF, TRACE, WARNING
 
Constructor Summary
DefaultCacheLogger()
          Creates new DefaultCacheLogger
 
Method Summary
 void flush()
          log messages are buffered by the cache.
 void init(String fileName, int severity)
          is called by the caching system when the CacheLogger is instanciated to complete any initialization requirements.
 void log(String message)
          application writers can implement this method and provide their own mechanism to log a message.
 void log(String message, Throwable cause)
          application writers can implement this method and provide their own mechanism to log a message.
 
Methods inherited from class javax.util.jcache.CacheLogger
getSeverity, setSeverity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCacheLogger

public DefaultCacheLogger()
Creates new DefaultCacheLogger

Method Detail

log

public void log(String message,
                Throwable cause)
application writers can implement this method and provide their own mechanism to log a message.

Specified by:
log in class CacheLogger
Parameters:
message - the message to log.
cause - the Exception responsible for causing an log event to happen.

flush

public void flush()
log messages are buffered by the cache. This method will force the messages to be written out the destination and the buffer is reset.

Specified by:
flush in class CacheLogger

log

public void log(String message)
application writers can implement this method and provide their own mechanism to log a message.

Specified by:
log in class CacheLogger
Parameters:
message - the message to log.

init

public void init(String fileName,
                 int severity)
is called by the caching system when the CacheLogger is instanciated to complete any initialization requirements.

Specified by:
init in class CacheLogger
Parameters:
fileName - the value from the CacheAttribute
severity - the value from the CacheAttributes.


Copyright © 2002-2009 Hosted by SourceForge. All Rights Reserved.