org.pf.util
Class ExceptionIgnorer

java.lang.Object
  extended by org.pf.util.ExceptionIgnorer
Direct Known Subclasses:
ConnectionPool, PortListener, RequestServer, SocketConnection

public class ExceptionIgnorer
extends java.lang.Object

An abstract superclass that provides an instance variable to hold an optional ExceptionHandler. It also implements a method handleException() that uses the exception handler, if it is not null.

Version:
1.1
Author:
Manfred Duchrow

Constructor Summary
ExceptionIgnorer()
          Initialize the new instance with default values.
ExceptionIgnorer(ExceptionHandler handler)
          Initialize the new instance with an exception handler.
 
Method Summary
 void exceptionOccurred(java.lang.Throwable exception)
          Can be called for all exceptions that should be handled in the same way.
 ExceptionHandler getExceptionHandler()
          Returns the exception handler currently in use.
 void setExceptionHandler(ExceptionHandler exHandler)
          Sets the exception handler.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionIgnorer

public ExceptionIgnorer()
Initialize the new instance with default values.


ExceptionIgnorer

public ExceptionIgnorer(ExceptionHandler handler)
Initialize the new instance with an exception handler.

Method Detail

getExceptionHandler

public ExceptionHandler getExceptionHandler()
Returns the exception handler currently in use. Might be null.


setExceptionHandler

public void setExceptionHandler(ExceptionHandler exHandler)
Sets the exception handler.

Parameters:
exHandler - The new exception handler (might be null)

exceptionOccurred

public void exceptionOccurred(java.lang.Throwable exception)
Can be called for all exceptions that should be handled in the same way. If an exception handler is available the exception will be passed to it.

Parameters:
exception - The occurred exception to be handled somehow