|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.fhg.igd.logging.AbstractWrapper
This is an abstract wrapper class for a logger instance of the underlying
logging mechanism. On configuration change requests, updates of output
destinations and log levels will be performed on all affected instances
through a bunch of (hidden) static methods, implicitly called by the
LoggingConfiguration
.
Specific operations like actually posting log messages or dealing
with Forwarder
objects are defined here but yet need to be
implemented by subclasses for each specific underlying logging system.
Field Summary | |
private static Set |
cache_
The storage for all deployed target loggers |
private int |
cnt_
The reference counter |
private static Set |
forwarders_
Storage for references of deployed Forwarder objects |
protected LogLevel |
level_
The log level |
protected String |
lname_
The log level name |
protected String |
name_
The name of the wrapped target logger |
protected String |
oname_
The output destination name |
Constructor Summary | |
protected |
AbstractWrapper(String name,
LoggerImpl ref)
Hidden construction. |
Method Summary | |
protected static void |
addForwarder(Forwarder forwarder)
Register a Forwarder to be updated in case of buffer
configuration changes. |
protected abstract void |
addForwarderFor(URL url)
Add a new Forwarder for the given URL to the
wrapped logger. |
(package private) static void |
addLogLevel(String name,
LogLevel level)
Add a log level definition for the given name and update all wrappers whose best log level names match the given name. |
(package private) static void |
addOutput(String name,
URL output)
Add a new output destination for the given name and update all wrappers whose current output names match the given name. |
(package private) static void |
changeBuffer(URL output,
Integer buffersize)
Change the buffer size of affected Forwarder instances (that
have been registered before). |
(package private) static void |
changeLogLevel(String name,
LogLevel level)
Change the log level definition for the given name and update all wrappers whose current log level name match the given name. |
protected static Chronometer |
chronometerFor(URL url)
This method allows subclasses to access the protected Chronometer.instanceFor(de.fhg.igd.util.URL) to request Chronometer
objects. |
(package private) static void |
deleteOutput(String name)
After deleting all output destinations of the given name, update all wrappers whose output name matches the given name and replace their output destinations by the best matching substitutes. |
void |
dismiss()
This method will be called in case the corresponding instance of the implementing class will not be used anymore. |
boolean |
equals(Object obj)
|
LogLevel |
getLogLevel()
Get the log level of the wrapped logger. |
String |
getName()
Get the name of the wrapped logger, which automatically is also the name of the corresponding LoggerImpl object. |
int |
hashCode()
|
(package private) static void |
initOutput(String name,
URL output)
After adding the first output destination for the given name, update all wrappers whose best output names match the given name. |
protected abstract void |
initTarget(LoggerImpl ref)
Initialize the implementation specific logger target. |
protected abstract void |
removeAllForwarders()
Remove all Forwarder and similar objects (e.g. |
protected static void |
removeForwarder(Forwarder forwarder)
Deregister a Forwarder from buffer configuration change
updates. |
protected abstract void |
removeForwarderFor(URL url)
Remove a Forwarder for the given URL from the
wrapped logger. |
(package private) static void |
removeLogLevel(String name)
Remove the log level definition for the given name and replace it by the best matching substitute. |
(package private) static void |
removeOutput(String name,
URL output)
Remove an output destination for the given name and update all wrappers whose current output name match the given name. |
(package private) static AbstractWrapper |
requestFor(String name,
Class wclazz,
LoggerImpl ref)
Request an AbstractWrapper for a given name. |
protected abstract void |
setLogLevel(LogLevel level)
Set the log level of the wrapped logger. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.fhg.igd.logging.Wrapper |
postLogEntry |
Field Detail |
private static Set forwarders_
Forwarder
objects
private static Set cache_
private int cnt_
protected String name_
protected String oname_
protected String lname_
protected LogLevel level_
Constructor Detail |
protected AbstractWrapper(String name, LoggerImpl ref)
name
- The name of the wrapped loggerref
- A reference to the requesting instanceMethod Detail |
protected abstract void initTarget(LoggerImpl ref)
ref
- The Logger
implementation that originally
requested this wrapperstatic AbstractWrapper requestFor(String name, Class wclazz, LoggerImpl ref)
AbstractWrapper
for a given name.
name
- The name of the requested wrapperwclazz
- The Wrapper
implementation class of the
requested wrapperref
- A reference to the requesting instance
LoggingException
- in case the requested wrapper could
not be createdpublic String getName()
Wrapper
LoggerImpl
object.
getName
in interface Wrapper
public LogLevel getLogLevel()
Wrapper
getLogLevel
in interface Wrapper
static void initOutput(String name, URL output)
name
- The name to initialize the output destinations foroutput
- The new output destinationstatic void addOutput(String name, URL output)
name
- The name to add the new output destination foroutput
- The new output destinationstatic void removeOutput(String name, URL output)
name
- The name to remove the output destination foroutput
- The output destination to removestatic void deleteOutput(String name)
name
- The name to delete the output destinations forprotected abstract void addForwarderFor(URL url)
Forwarder
for the given URL
to the
wrapped logger.
url
- The new output destination to be added to the wrapped loggerprotected abstract void removeForwarderFor(URL url)
Forwarder
for the given URL
from the
wrapped logger.
url
- The output destination to be removed from the wrapped loggerprotected abstract void removeAllForwarders()
Forwarder
and similar objects (e.g.
Handler
instances for the Sun
logging system) for the given URL
.
static void addLogLevel(String name, LogLevel level)
name
- The name to add the log level forlevel
- The log level for the given namestatic void changeLogLevel(String name, LogLevel level)
name
- The name to change the log level forlevel
- The new log level of the given namestatic void removeLogLevel(String name)
name
- The name to add the log level forprotected abstract void setLogLevel(LogLevel level)
level
- The new log levelpublic void dismiss()
Wrapper
dismiss
in interface Wrapper
protected static Chronometer chronometerFor(URL url)
Chronometer.instanceFor(de.fhg.igd.util.URL)
to request Chronometer
objects.
url
- The URL
to get the Chronometer
instance for
Chronometer
protected static void addForwarder(Forwarder forwarder)
Forwarder
to be updated in case of buffer
configuration changes.
protected static void removeForwarder(Forwarder forwarder)
Forwarder
from buffer configuration change
updates.
static void changeBuffer(URL output, Integer buffersize)
Forwarder
instances (that
have been registered before).
output
- The output destination of affected
Forwarder
instancesbuffersize
- The new buffer sizeaddForwarder(de.fhg.igd.logging.Forwarder)
public boolean equals(Object obj)
public int hashCode()
public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |