|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--net.larsan.urd.util.ErrorHandler
|
+--net.larsan.urd.impl.DefaultErrorHandler
A default error handler class. This class wraps the log service and buffers log calls if the log service is unavailable. The buffer may contain 100 records after which it starts to drop them.
| Field Summary |
| Fields inherited from interface net.larsan.norna.service.log.LogHandle |
NAMESPACE_ID |
| Constructor Summary | |
DefaultErrorHandler(javax.naming.Context context)
Create new error handler |
|
| Method Summary | |
void |
addFilter(Filter filter)
Add a log filter to the handle. |
boolean |
checkAccess(Level level)
Check if the handle would accept a log record based on a level. |
boolean |
checkAccess(Level level,
Type type)
Check if the handle would accept a log record with a level and type. |
void |
destroy()
Destroy component. |
void |
flush()
Flush this log handle to make sure no log records are cached. |
Status |
getStatus()
Get the status of the service. |
void |
handleException(java.lang.String msg,
java.lang.Object src,
java.lang.Throwable th)
Handle exception with a source and a message. |
void |
log(Record record)
Log a record. |
void |
logError(java.lang.String id,
java.lang.String msg,
java.lang.Throwable th)
|
void |
receiveRegistryEvent(RegistryEvent e)
Receive registry event. |
void |
removeFilter(Filter filter)
Remove a log filter to the handle. |
| Methods inherited from class net.larsan.urd.util.ErrorHandler |
handleException, handleException, handleException |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DefaultErrorHandler(javax.naming.Context context)
throws javax.naming.NamingException
context - Context to get real log from
javax.naming.NamingException - If the service registry cannot be found| Method Detail |
public boolean checkAccess(Level level,
Type type)
LogHandle
checkAccess in interface LogHandlelevel - Log level to checktype - Log record type
public boolean checkAccess(Level level)
LogHandle
checkAccess in interface LogHandlelevel - Log level to check
public void log(Record record)
LogHandle
log in interface LogHandlerecord - Log record, must not be nullpublic void addFilter(Filter filter)
LogHandle
addFilter in interface LogHandlefilter - Log filter to add to chain, must not be nullpublic void removeFilter(Filter filter)
LogHandle
removeFilter in interface LogHandlefilter - Log filter to remove from chain, must not be nullpublic void flush()
LogHandle
flush in interface LogHandlepublic Status getStatus()
ServiceHandlestatus of the service. The service is free to do a security check before
returning the status, but must never return null.
getStatus in interface ServiceHandlepublic void receiveRegistryEvent(RegistryEvent e)
RegistryListener
receiveRegistryEvent in interface RegistryListenerpublic void destroy()
Destroyable
destroy in interface Destroyable
public void logError(java.lang.String id,
java.lang.String msg,
java.lang.Throwable th)
public void handleException(java.lang.String msg,
java.lang.Object src,
java.lang.Throwable th)
ErrorHandler
handleException in class ErrorHandlermsg - Error to msg, may be nullsrc - Roor source object, may be nullth - Error to handle, may be null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||