public class ExceptionHandlingSupport
extends java.lang.Object
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 and Description |
---|
ExceptionHandlingSupport() |
Modifier and Type | Method and Description |
---|---|
void |
addExceptionListener(ExceptionListener o)
Adds a new
ExceptionListener for adding support to it. |
boolean |
removeExceptionListener(ExceptionListener o)
Removes an
ExceptionListener for finishing the support to it. |
void |
throwException(java.lang.Throwable t)
Notifies all registered listeners that an error or exception
throwable by the Java Virtual Machine has been produced.
|
public void addExceptionListener(ExceptionListener o)
Adds a new ExceptionListener
for adding support to it.
o
- listener adapted to be notified by the ExceptionHandlingSupport
public boolean removeExceptionListener(ExceptionListener o)
Removes an ExceptionListener
for finishing the support to it.
o
- listener adapted to be notified by the ExceptionHandlingSupport
true
if the list contained the specified element, false
otherwisepublic void throwException(java.lang.Throwable t)
Notifies all registered listeners that an error or exception throwable by the Java Virtual Machine has been produced.
t
- an error or exception in the Java language