Class ExceptionHandlingSupport
Stores a group of ExceptionListener that, in whatever moment
could be notified a Throwable Java error or exception.
ExceptionHandlingSupport is useful to manage a set of listeners
that need to be executed when a particular error or exception in a object is produced. For
instance, when user drags the mouse over a geometrical object in a view, it's possible that
some ExceptionLister of that object and other nearby, must be notified. Using
ExceptionHandlingSupport the developer can manage easily a set of that kind of
listeners, that can change according to an external factor. (In the previous sample, for intance,
can change according the closed objects to the one which this ExceptionHandlingSupport
refers).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a newExceptionListenerfor adding support to it.booleanRemoves anExceptionListenerfor finishing the support to it.voidNotifies all registered listeners that an error or exception throwable by the Java Virtual Machine has been produced.
-
Constructor Details
-
ExceptionHandlingSupport
public ExceptionHandlingSupport()
-
-
Method Details
-
addExceptionListener
Adds a new
ExceptionListenerfor adding support to it.- Parameters:
o- listener adapted to be notified by theExceptionHandlingSupport
-
removeExceptionListener
Removes an
ExceptionListenerfor finishing the support to it.- Parameters:
o- listener adapted to be notified by theExceptionHandlingSupport- Returns:
trueif the list contained the specified element,falseotherwise
-
throwException
Notifies all registered listeners that an error or exception throwable by the Java Virtual Machine has been produced.
- Parameters:
t- an error or exception in the Java language
-