Class WarningEvent
Object
EventObject
StoreEvent
WarningEvent
- All Implemented Interfaces:
Serializable, Localized
Describes non-fatal errors that occurred in a resource or a data store.
The warning message is encapsulated in a
LogRecord object, which allows the storage of various information
(stack trace, thread identifier,
log time, etc.) in addition of warning message.- Since:
- 1.0
- See Also:
-
Field Summary
Fields inherited from class EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionWarningEvent(Resource source, LogRecord description) Constructs an event for a warning that occurred in the given resource. -
Method Summary
Modifier and TypeMethodDescriptionReturns the warning message together with stack trace (if any) and other information.getMessage(Locale locale) Returns the warning message, preferably in the given locale.Returns a string representation of this warning for debugging purpose.Methods inherited from class StoreEvent
consume, getLocale, getSource, isConsumedModifier and TypeMethodDescriptionvoidconsume(boolean later) Marks this event as consumed.Returns the locale associated with this event, ornullif unspecified.Returns the resource where the event occurred.final booleanIndicates whether this event has been consumed by any listener.
-
Constructor Details
-
WarningEvent
Constructs an event for a warning that occurred in the given resource.- Parameters:
source- the resource on which the warning initially occurred.description- log record containing warning message, stack trace (if any) and other information.- Throws:
IllegalArgumentException- if the given source is null.NullPointerException- if the given description is null.
-
-
Method Details
-
getDescription
Returns the warning message together with stack trace (if any) and other information.- Returns:
- the log record containing warning message, stack trace and other information.
-
getMessage
Returns the warning message, preferably in the given locale. The locale is used on a best-effort basis and may be ignored if unsupported.- Parameters:
locale- the desired locale, ornullfor the default locale.- Returns:
- the warning message, preferably in the given locale.
- Since:
- 1.7
-
toString
Returns a string representation of this warning for debugging purpose.- Overrides:
toStringin classEventObject- Returns:
- a string representation of this warning.
-