Package javax.sql

Examples of javax.sql.ConnectionEvent


        if (logger.isDebugEnabled()) {
            logger.debug("Calling listeners to " + this);
        }
        if (!listeners.isEmpty()) {
            ConnectionEvent e = new ConnectionEvent(this);
            // Create a copy of the listeners list just in case the
            // connectionClosed method removes the listener.
            List list = new ArrayList(listeners);
            for (Iterator i = list.iterator(); i.hasNext();) {
                ((ConnectionEventListener) i.next()).connectionClosed(e);
View Full Code Here


                             + " as it is not " + logicalConnection);
            }
        }

        if (listeners.isEmpty()) {
            ConnectionEvent e = new ConnectionEvent(this, sqle);
            // Create a copy of the listeners list just in case the
            // connectionClosed method removes the listener.
            List list = new ArrayList(listeners);
            for (Iterator i = list.iterator(); i.hasNext();) {
                ((ConnectionEventListener) i.next()).
View Full Code Here

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

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

            // exceptionSorter.isExceptionFatal
View Full Code Here

        if (dataSource.isRemoveAbandoned()) {
            dataSource.removeActiveConnection(this);
        }

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

        PreparedStatementPool statementPool = holder.getStatementPool();
        if (statementPool != null) {
            for (List<PoolablePreparedStatement> stmtList : statementPool.getMap().values()) {
View Full Code Here

    /**
     * INTERNAL
     */
    void closedHandle() {
        debugCode("closedHandle();");
        ConnectionEvent event = new ConnectionEvent(this);
        // go backward so that a listener can remove itself
        // (otherwise we need to clone the list)
        for (int i = listeners.size() - 1; i >= 0; i--) {
            ConnectionEventListener listener = listeners.get(i);
            listener.connectionClosed(event);
View Full Code Here

      return;

    // tell my listeners an exception is about to be thrown
    if (eventListener != null && eventListener.size() > 0)
    {
      ConnectionEvent errorEvent = new ConnectionEvent(this, exception);

      for (Enumeration e = eventListener.elements();
         e.hasMoreElements(); )
      {
        ConnectionEventListener l =
View Full Code Here

  public synchronized void notifyClose()
  {
    // tell my listeners I am closed
    if (eventListener != null && eventListener.size() > 0)
    {
      ConnectionEvent closeEvent = new ConnectionEvent(this);

      for (Enumeration e = eventListener.elements();
         e.hasMoreElements(); )
      {
        ConnectionEventListener l =
View Full Code Here

      return;

    // tell my listeners an exception is about to be thrown
    if (eventListener != null && eventListener.size() > 0)
    {
      ConnectionEvent errorEvent = new ConnectionEvent(this, exception);

      for (Enumeration e = eventListener.elements();
         e.hasMoreElements(); )
      {
        ConnectionEventListener l =
View Full Code Here

  public synchronized void notifyClose()
  {
    // tell my listeners I am closed
    if (eventListener != null && eventListener.size() > 0)
    {
      ConnectionEvent closeEvent = new ConnectionEvent(this);

      for (Enumeration e = eventListener.elements();
         e.hasMoreElements(); )
      {
        ConnectionEventListener l =
View Full Code Here

      return;
    }

    Iterator<Map.Entry<ConnectionEventListener, ConnectionEventListener>> iterator = this.connectionEventListeners.entrySet().iterator();
   
    ConnectionEvent connectionevent = new ConnectionEvent(this,
        sqlException);

    while (iterator.hasNext()) {

      ConnectionEventListener connectioneventlistener = iterator.next().getValue();
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.