Examples of ConnectionEvent


Examples of javax.resource.spi.ConnectionEvent

    public void setLogWriter(java.io.PrintWriter out) throws javax.resource.ResourceException {
        logWriter = out;
    }

    protected void localTransactionCommitted() {
        ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_COMMITTED);
        Object[] elements = listeners.toArray();
        for (int i = 0; i < elements.length; i++) {
            ConnectionEventListener eventListener = (ConnectionEventListener) elements[i];
            eventListener.localTransactionCommitted(event);
        }
View Full Code Here

Examples of javax.resource.spi.ConnectionEvent

            eventListener.localTransactionCommitted(event);
        }
    }

    protected void localTransactionRolledback() {
        ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK);
        Object[] elements = listeners.toArray();
        for (int i = 0; i < elements.length; i++) {
            ConnectionEventListener eventListener = (ConnectionEventListener) elements[i];
            eventListener.localTransactionRolledback(event);
        }
View Full Code Here

Examples of javax.resource.spi.ConnectionEvent

            eventListener.localTransactionRolledback(event);
        }
    }

    protected void localTransactionStarted() {
        ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_STARTED);
        Object[] elements = listeners.toArray();
        for (int i = 0; i < elements.length; i++) {
            ConnectionEventListener eventListener = (ConnectionEventListener) elements[i];
            eventListener.localTransactionStarted(event);
        }
View Full Code Here

Examples of javax.resource.spi.ConnectionEvent

            while ((temp = sqlE.getNextException()) != null) {
                temp.printStackTrace(logWriter);
            }
        }

        ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, sqlE);
        Object[] elements = listeners.toArray();
        for (int i = 0; i < elements.length; i++) {
            ConnectionEventListener eventListener = (ConnectionEventListener) elements[i];
            eventListener.connectionErrorOccurred(event);
        }
View Full Code Here

Examples of javax.resource.spi.ConnectionEvent

    protected void connectionClose(JdbcConnection jdbcConn) {
        synchronized (jdbcConnections) {
            jdbcConn.invalidate();
            jdbcConnections.remove(jdbcConn);
            ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
            Object[] elements = listeners.toArray();
            for (int i = 0; i < elements.length; i++) {
                ConnectionEventListener eventListener = (ConnectionEventListener) elements[i];
                eventListener.connectionClosed(event);
            }
View Full Code Here

Examples of javax.resource.spi.ConnectionEvent

    public boolean isDestroyed() {
        return destroyed;
    }

    public void closedEvent(MockConnection mockConnection) {
        ConnectionEvent connectionEvent = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
        connectionEvent.setConnectionHandle(mockConnection);
        for (Iterator iterator = new ArrayList(connectionEventListeners).iterator(); iterator.hasNext();) {
            ConnectionEventListener connectionEventListener = (ConnectionEventListener) iterator.next();
            connectionEventListener.connectionClosed(connectionEvent);
        }
    }
View Full Code Here

Examples of javax.resource.spi.ConnectionEvent

            connectionEventListener.connectionClosed(connectionEvent);
        }
    }

    public void errorEvent(MockConnection mockConnection) {
        ConnectionEvent connectionEvent = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED);
        connectionEvent.setConnectionHandle(mockConnection);
        for (Iterator iterator = new ArrayList(connectionEventListeners).iterator(); iterator.hasNext();) {
            ConnectionEventListener connectionEventListener = (ConnectionEventListener) iterator.next();
            connectionEventListener.connectionErrorOccurred(connectionEvent);
        }
    }
View Full Code Here

Examples of javax.resource.spi.ConnectionEvent

            connectionEventListener.connectionErrorOccurred(connectionEvent);
        }
    }

    public void localTransactionStartedEvent(MockConnection mockConnection) {
        ConnectionEvent connectionEvent = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_STARTED);
        connectionEvent.setConnectionHandle(mockConnection);
        for (Iterator iterator = new ArrayList(connectionEventListeners).iterator(); iterator.hasNext();) {
            ConnectionEventListener connectionEventListener = (ConnectionEventListener) iterator.next();
            connectionEventListener.localTransactionStarted(connectionEvent);
        }
    }
View Full Code Here

Examples of javax.sql.ConnectionEvent

      Iterator iter = listeners.iterator();
      while(iter.hasNext()){
        ConnectionEventListener listener = (ConnectionEventListener)iter.next();
        if(e == null){
          //no exception
          listener.connectionClosed(new ConnectionEvent(this));
        }else{
          //exception occurred
          listener.connectionErrorOccurred(new ConnectionEvent(this, e))
        }
      }
    } 
  }
View Full Code Here

Examples of javax.sql.ConnectionEvent

    /**
     * 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
TOP
Copyright © 2018 www.massapi.com. 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.