|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.logging.Handler
java.util.logging.StreamHandler
de.fhg.igd.logging.sun.AsynchronousStreamHandler
This Handler
is intended to be used for logging across slow
or instable network connections. Because of the contained
AbstractAsynchronousMessageDispatcher
implementation,
publish(java.util.logging.LogRecord)
will always return immediately, to make sure the delay of
the main thread caused by the logging mechanism is minimized even under
unfavorable network conditions.
Nested Class Summary | |
private static class |
AsynchronousStreamHandler.SunMessageDispatcher
This is the dispatcher implementation for the Sun logging mechanism. |
Field Summary | |
protected boolean |
closed_
This flag will be set to true once close()
has been called |
protected AbstractAsynchronousMessageDispatcher |
dispatcher_
The Asynchronous Message Dispatcher thread |
Fields inherited from class java.util.logging.StreamHandler |
|
Fields inherited from class java.util.logging.Handler |
|
Constructor Summary | |
AsynchronousStreamHandler(OutputStream output,
Formatter formatter,
int maxbuf)
Create an AsynchronousStreamHandler . |
Method Summary | |
void |
close()
This method will close underlying streams and free used resources. |
void |
post(Object record)
Actually post a message into the underlying logging system. |
void |
publish(LogRecord record)
Hand over a log record to be posted as soon as possible. |
String |
toString()
|
Methods inherited from class java.util.logging.StreamHandler |
flush, isLoggable, setEncoding, setOutputStream |
Methods inherited from class java.util.logging.Handler |
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, reportError, setErrorManager, setFilter, setFormatter, setLevel |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected AbstractAsynchronousMessageDispatcher dispatcher_
protected boolean closed_
true
once close()
has been called
Constructor Detail |
public AsynchronousStreamHandler(OutputStream output, Formatter formatter, int maxbuf)
AsynchronousStreamHandler
.
output
- The underlying output streamformatter
- The log record formattermaxbuf
- The maximum number of messages that can be stored in
the internal buffer (must be at least 1)
IllegalArgumentException
- if the maximum buffer size is less
than 1Method Detail |
public void publish(LogRecord record)
record
- The log record to be publishedpublic void post(Object record)
Messenger
post
in interface Messenger
record
- The message to postpublic void close()
AbstractAsynchronousMessageDispatcher
.
public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |