Package org.firebirdsql.gds.ng.listeners
Class ExceptionListenerDispatcher
- java.lang.Object
- 
- org.firebirdsql.gds.ng.listeners.ExceptionListenerDispatcher
 
- 
- All Implemented Interfaces:
- java.lang.Iterable<ExceptionListener>,- ExceptionListener
 
 public final class ExceptionListenerDispatcher extends java.lang.Object implements java.lang.Iterable<ExceptionListener>, ExceptionListener Listener dispatcher forExceptionListener.This implementation uses WeakReference(or more specificallyWeakHashMap. Therefor listeners without a strong reference may be removed an no longer notified at any time.- Since:
- 3.0
- Author:
- Mark Rotteveel
 
- 
- 
Constructor SummaryConstructors Constructor Description ExceptionListenerDispatcher(java.lang.Object source)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(ExceptionListener listener)Adds the supplied listener to this dispatcher.voiderrorOccurred(java.lang.Object source, java.sql.SQLException exception)Notify about a SQLExceptionvoiderrorOccurred(java.sql.SQLException exception)booleanisShutdown()java.util.Iterator<ExceptionListener>iterator()voidremoveAllListeners()Removes all listeners from this dispatcher.voidremoveListener(ExceptionListener listener)Removes the supplied listener from this dispatcher.voidshutdown()Shuts down this dispatcher and removes all listeners.
 
- 
- 
- 
Method Detail- 
errorOccurredpublic void errorOccurred(java.lang.Object source, java.sql.SQLException exception)Description copied from interface:ExceptionListenerNotify about a SQLException- Specified by:
- errorOccurredin interface- ExceptionListener
- Parameters:
- source- The source of the event; note for caller: this should be the object this listener is registered at.
- exception- error that occurred.
 
 - 
errorOccurredpublic void errorOccurred(java.sql.SQLException exception) 
 - 
addListenerpublic void addListener(ExceptionListener listener) Adds the supplied listener to this dispatcher.A call to this method has no effect after shutdown()has been called.- Parameters:
- listener- Listener object
 
 - 
removeListenerpublic void removeListener(ExceptionListener listener) Removes the supplied listener from this dispatcher.- Parameters:
- listener- Listener object
 
 - 
removeAllListenerspublic void removeAllListeners() Removes all listeners from this dispatcher.
 - 
shutdownpublic void shutdown() Shuts down this dispatcher and removes all listeners.After shutdown calls to addListener(ExceptionListener)are ignored.
 - 
isShutdownpublic boolean isShutdown() - Returns:
- truewhen this dispatcher has been shut down.
 
 - 
iteratorpublic java.util.Iterator<ExceptionListener> iterator() - Specified by:
- iteratorin interface- java.lang.Iterable<ExceptionListener>
 
 
- 
 
-