|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.EventObject
org.apache.commons.configuration.event.ConfigurationEvent
org.apache.commons.configuration.event.ConfigurationErrorEvent
public class ConfigurationErrorEvent
An event class that is used for reporting errors that occurred while processing configuration properties.
Some configuration implementations (e.g.
or DatabaseConfiguration
use an underlying storage that can throw an exception on each property
access. In earlier versions of this library such exceptions were logged and
then silently ignored. This makes it impossible for a client to find out that
something went wrong.
JNDIConfiguration
To give clients better control over the handling of errors that occur during access of a configuration object a new event listener mechanism specific for exceptions is introduced: Clients can register itself at a configuration object as an error listener and are then notified about all internal errors related to the source configuration object.
By inheriting from ConfigurationEvent
this event class
supports all properties that describe an operation on a configuration
instance. In addition a Throwable
object is available
representing the occurred error. The event's type determines the operation
that caused the error. Note that depending on the event type and the occurred
exception not all of the other properties (e.g. name of the affected property
or its value) may be available.
ConfigurationEvent
,
Serialized FormField Summary | |
---|---|
private java.lang.Throwable |
cause
Stores the exception that caused this event. |
private static long |
serialVersionUID
The serial version UID. |
Fields inherited from class java.util.EventObject |
---|
source |
Constructor Summary | |
---|---|
ConfigurationErrorEvent(java.lang.Object source,
int type,
java.lang.String propertyName,
java.lang.Object propertyValue,
java.lang.Throwable cause)
Creates a new instance of ConfigurationErrorEvent and
initializes it. |
Method Summary | |
---|---|
java.lang.Throwable |
getCause()
Returns the cause of this error event. |
Methods inherited from class org.apache.commons.configuration.event.ConfigurationEvent |
---|
getPropertyName, getPropertyValue, getType, isBeforeUpdate |
Methods inherited from class java.util.EventObject |
---|
getSource, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private java.lang.Throwable cause
Constructor Detail |
---|
public ConfigurationErrorEvent(java.lang.Object source, int type, java.lang.String propertyName, java.lang.Object propertyValue, java.lang.Throwable cause)
ConfigurationErrorEvent
and
initializes it.
source
- the event sourcetype
- the event's typepropertyName
- the name of the affected propertypropertyValue
- the value of the affected propertycause
- the exception object that caused this eventMethod Detail |
---|
public java.lang.Throwable getCause()
Throwable
object that caused this event to be fired.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |