de.fhg.igd.logging.sun
Class SunWrapper

java.lang.Object
  extended byde.fhg.igd.logging.AbstractWrapper
      extended byde.fhg.igd.logging.sun.SunWrapper
All Implemented Interfaces:
Wrapper

public class SunWrapper
extends AbstractWrapper

This class is a wrapper for a Logger object. It is responsible for the proper initialization of its target and the handling of configuration change requests. Furthermore, this is the point where log messages are leaving the scope of the Logging Framework since they are being handed over to the underlying Sun logging mechanism.

Version:
"$Id: SunWrapper.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Matthias Pressfreund

Field Summary
protected  Logger logger_
          The wrapped logger object
static String LOGGER_CLASS
          The name of the target logger class
 
Fields inherited from class de.fhg.igd.logging.AbstractWrapper
level_, lname_, name_, oname_
 
Constructor Summary
SunWrapper(String name, LoggerImpl ref)
          Create a SunTargetWrapper object.
 
Method Summary
protected  void addForwarderFor(URL url)
          Add a new Forwarder for the given URL to the wrapped logger.
protected  void initTarget(LoggerImpl ref)
          Initialize the implementation specific logger target.
 void postLogEntry(LogLevel level, String msg)
          Post a log entry into the underlying logging mechanism by means of the wrapped logger.
protected  void removeAllForwarders()
          Remove all Forwarder and similar objects (e.g.
protected  void removeForwarderFor(URL url)
          Remove a Forwarder for the given URL from the wrapped logger.
protected  void setLogLevel(LogLevel level)
          Set the log level of the wrapped logger.
 String toString()
           
 
Methods inherited from class de.fhg.igd.logging.AbstractWrapper
addForwarder, chronometerFor, dismiss, equals, getLogLevel, getName, hashCode, removeForwarder
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LOGGER_CLASS

public static final String LOGGER_CLASS
The name of the target logger class

See Also:
Constant Field Values

logger_

protected Logger logger_
The wrapped logger object

Constructor Detail

SunWrapper

public SunWrapper(String name,
                  LoggerImpl ref)
Create a SunTargetWrapper object.

Parameters:
name - The name of the wrapped logger
ref - A reference to the requesting instance
Method Detail

initTarget

protected void initTarget(LoggerImpl ref)
Description copied from class: AbstractWrapper
Initialize the implementation specific logger target.

Specified by:
initTarget in class AbstractWrapper
Parameters:
ref - The Logger implementation that originally requested this wrapper

postLogEntry

public void postLogEntry(LogLevel level,
                         String msg)
Description copied from interface: Wrapper
Post a log entry into the underlying logging mechanism by means of the wrapped logger.

Parameters:
level - The log level to be used
msg - The message to be posted by the wrapped logger

addForwarderFor

protected void addForwarderFor(URL url)
Description copied from class: AbstractWrapper
Add a new Forwarder for the given URL to the wrapped logger.

Specified by:
addForwarderFor in class AbstractWrapper
Parameters:
url - The new output destination to be added to the wrapped logger

removeForwarderFor

protected void removeForwarderFor(URL url)
Description copied from class: AbstractWrapper
Remove a Forwarder for the given URL from the wrapped logger.

Specified by:
removeForwarderFor in class AbstractWrapper
Parameters:
url - The output destination to be removed from the wrapped logger

removeAllForwarders

protected void removeAllForwarders()
Description copied from class: AbstractWrapper
Remove all Forwarder and similar objects (e.g. Handler instances for the Sun logging system) for the given URL.

Specified by:
removeAllForwarders in class AbstractWrapper

setLogLevel

protected void setLogLevel(LogLevel level)
Description copied from class: AbstractWrapper
Set the log level of the wrapped logger.

Specified by:
setLogLevel in class AbstractWrapper
Parameters:
level - The new log level

toString

public String toString()
Overrides:
toString in class AbstractWrapper


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.