|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecttuwien.auto.calimero.log.ErrorHandler
public class ErrorHandler
An error handler is invoked on problems of a log writer which are not handled by the writer itself.
Such problems shouldn't get logged using another log writer, to prevent the possibility
of a fault / failure chain, and shouldn't lead to disruption of the logging system at a
whole.
Moreover, log writer errors most certainly can't be returned back to the owner of the
writer responsible for handling the errors. And handling errors directly in log
services can rarely be done in a satisfying way.
So the associated error handler is used for such error events.
The handler itself might be adapted to the application needs. For example, an
overridden error(LogWriter, String, Exception) might close the log writer the
error originated from.
LogWriter| Field Summary | |
|---|---|
protected int |
invocations
Counter how often error() was called (without abort). |
protected int |
maxInvocations
Sets the maximum number error(LogWriter, String, Exception) should handle
error events. |
| Constructor Summary | |
|---|---|
ErrorHandler()
Creates a new error handler. |
|
| Method Summary | |
|---|---|
void |
error(LogWriter source,
java.lang.String msg,
java.lang.Exception e)
Invoked on a log writer error event. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int invocations
protected int maxInvocations
error(LogWriter, String, Exception) should handle
error events.
The number should be set reasonably low to prevent a continued handling of repeated
errors of the same source.
Initialized to 5 by default.
| Constructor Detail |
|---|
public ErrorHandler()
| Method Detail |
|---|
public void error(LogWriter source,
java.lang.String msg,
java.lang.Exception e)
The default behavior used here prints the logging source and the error message to
the system standard error stream (System.err). If an exception object is given, the
exception and the last method calls of the log writer leading to the error are also
printed.
Only predefined maximum invocations are handled, subsequent calls are ignored.
source - the log writer the error originated frommsg - message describing the errore - exception related to the error, may be null
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||