S- the base type of objects that emit warnings (the source).
public interface WarningListener<S> extends EventListener
DataStoreor other SIS objects. Warnings are encapsulated in
LogRecordobjects and logged at
Level.WARNINGif the emitter does not have registered any
WarningListener. This listener allows applications to intercept warning records for displaying them in a dialog (or any other action that the application may choose) instead than logging them.
Handlerto the logger. But
Handlerinstances are registered on a per-logger basis and receive all messages sent to that logger regardless their emitter. By contrast,
WarningListenerinstances are registered on a per-
DataStorebasis (or any other emitter) and receive all messages sent by that emitter regardless the destination logger. The emitter is part of the information given to the
warningOccured(Object, LogRecord)method, in addition to the log record.
Defined in the
LogRecord.getSourceClassName(), or one of its parent classes.
DataStorein the midst of a reading process) will continue following the call to this method.
LogRecord provides the warning message together with
programmatic information like the source class name and
method name where the warning occurred. The log record
may optionally contains the exception which has been thrown.
Applications may choose to ignore the warning, display a dialog or take any other action they choose. Applications do not need to log the warning, since logging will be done automatically if the emitter has no registered warning listeners.
source- the object that emitted a warning, or
nullif not available.
warning- the warning message together with programmatic information.
Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.