Package javax.sql

Examples of javax.sql.ConnectionEvent


   
    /**
     * Generate a connection error event
     */
    public void throwConnectionError() {
        ConnectionEvent event = new ConnectionEvent(this);
        connectionErrorOccurred(event);
    }
View Full Code Here


     * @param exception the exception that caused the event, or {@code null} if
     * it is a close event
     */
    private void fireConnectionEventListeners(SQLException exception) {
        if (eventListener != null && !eventListener.isEmpty()) {
            ConnectionEvent event = new ConnectionEvent(this, exception);
            eventIterators++;
            try {
                for (ConnectionEventListener l : eventListener) {
                    if (exception == null) {
                        l.connectionClosed(event);
View Full Code Here

    private void fireCloseEvent() {
        if (log.isDebugEnabled()) { log.debug("notifying " + connectionEventListeners.size() + " connectionEventListeners(s) about closing of " + this); }
        for (int i = 0; i < connectionEventListeners.size(); i++) {
            ConnectionEventListener connectionEventListener = connectionEventListeners.get(i);
            connectionEventListener.connectionClosed(new ConnectionEvent((PooledConnection) delegate));
        }
    }
View Full Code Here

//#endif JAVA6
    // ------------------------ internal implementation ------------------------
    synchronized public void connectionClosed() {

        ConnectionEvent event = new ConnectionEvent(this);

        userConnection = null;

        release();
View Full Code Here

        }
    }

    synchronized public void connectionErrorOccured(SQLException e) {

        ConnectionEvent event = new ConnectionEvent(this, e);

        release();

        for (int i = 0; i < listeners.size(); i++) {
            ConnectionEventListener connectionEventListener =
View Full Code Here

            LOG.error("dup close");
            return;
        }

        for (ConnectionEventListener listener : holder.getConnectionEventListeners()) {
            listener.connectionClosed(new ConnectionEvent(this));
        }

        holder.getDataSource().recycle(this);

        this.holder = null;
View Full Code Here

        if (t instanceof SQLException) {
            SQLException sqlEx = (SQLException) t;

            // broadcastConnectionError
            ConnectionEvent event = new ConnectionEvent(pooledConnection, sqlEx);
            for (ConnectionEventListener eventListener : holder.getConnectionEventListeners()) {
                eventListener.connectionErrorOccurred(event);
            }

            // exceptionSorter.isExceptionFatal
View Full Code Here

  /**
   * 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 = (ConnectionEventListener[]) connectionListeners.toArray(new ConnectionEventListener[connectionListeners.size()]);
    for (int i = 0; i < local.length; i++) {
      ConnectionEventListener listener = local[i];
      if (evt == null) {
View Full Code Here

  /**
   * Used to fire a connection error event to all listeners.
   */
  void fireConnectionFatalError(SQLException e) {
    ConnectionEvent evt = null;
    // Copy the listener list so the listener can remove itself during this method call
    ConnectionEventListener[] local = (ConnectionEventListener[])connectionListeners.toArray(new ConnectionEventListener[connectionListeners.size()]);
    for (int i = 0; i < local.length; i++) {
      ConnectionEventListener listener = local[i];
      if (evt == null) {
View Full Code Here

      listener.connectionErrorOccurred(evt);
    }
  }

  protected ConnectionEvent createConnectionEvent(SQLException sqle) {
    return new ConnectionEvent(this, sqle);
  }
View Full Code Here

TOP

Related Classes of javax.sql.ConnectionEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.