Class ExceptionHandlingSupport

java.lang.Object
org.gvsig.utils.exceptionHandling.ExceptionHandlingSupport

public class ExceptionHandlingSupport extends 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 Details

    • ExceptionHandlingSupport

      public ExceptionHandlingSupport()
  • Method Details

    • addExceptionListener

      public void addExceptionListener(ExceptionListener o)

      Adds a new ExceptionListener for adding support to it.

      Parameters:
      o - listener adapted to be notified by the ExceptionHandlingSupport
    • removeExceptionListener

      public boolean removeExceptionListener(ExceptionListener o)

      Removes an ExceptionListener for finishing the support to it.

      Parameters:
      o - listener adapted to be notified by the ExceptionHandlingSupport
      Returns:
      true if the list contained the specified element, false otherwise
    • throwException

      public void throwException(Throwable t)

      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