use of javax.sql.ConnectionEvent in project voltdb by VoltDB.
the class LifeTimeConnectionWrapper method fireSqlExceptionEvent.
protected void fireSqlExceptionEvent(SQLException e) {
ConnectionEvent event = new ConnectionEvent(this.pooledConnection, e);
for (Iterator iterator = connectionListeners.iterator(); iterator.hasNext(); ) {
ConnectionEventListener connectionEventListener = (ConnectionEventListener) iterator.next();
connectionEventListener.connectionErrorOccurred(event);
}
}
use of javax.sql.ConnectionEvent in project spanner-jdbc by olavloite.
the class CloudSpannerPooledConnection method fireConnectionClosed.
/**
* Used to fire a connection closed event to all listeners.
*/
void fireConnectionClosed() {
ConnectionEvent evt = null;
// Copy the listener list so the listener can remove itself during this
// method call
ConnectionEventListener[] local = listeners.toArray(new ConnectionEventListener[listeners.size()]);
for (ConnectionEventListener listener : local) {
if (evt == null) {
evt = createConnectionEvent(null);
}
listener.connectionClosed(evt);
}
}
Aggregations