Package javax.sql

Examples of javax.sql.ConnectionEvent


        synchronized (connectionEventListeners) {
            if (connectionEventListeners.size() == 0)
                return;

            ConnectionEvent closedEvent = new ConnectionEvent(this, exception);
            Iterator listeners = connectionEventListeners.iterator();
            while (listeners.hasNext()) {
                ConnectionEventListener nextListener = (ConnectionEventListener) listeners
                        .next();
                nextListener.connectionErrorOccurred(closedEvent);
View Full Code Here


    protected void connectionClosedNotification() {
        synchronized (connectionEventListeners) {
            if (connectionEventListeners.size() == 0)
                return;

            ConnectionEvent closedEvent = new ConnectionEvent(this);
            Iterator listeners = connectionEventListeners.iterator();

            while (listeners.hasNext()) {
                ConnectionEventListener nextListener = (ConnectionEventListener) listeners
                        .next();
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 (Iterator it = eventListener.iterator(); it.hasNext();) {
                    ConnectionEventListener l =
                            (ConnectionEventListener) it.next();
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

      return;
    }

    Iterator iterator = this.connectionEventListeners.entrySet().iterator();
   
    ConnectionEvent connectionevent = new ConnectionEvent(this,
        sqlException);

    while (iterator.hasNext()) {

      ConnectionEventListener connectioneventlistener = (ConnectionEventListener) ((Map.Entry)iterator
View Full Code Here

    /**
     * sends a connectionClosed event.
     */
    void notifyListeners() {
        ConnectionEvent event = new ConnectionEvent(this);
        Iterator i = eventListeners.iterator();
        while (i.hasNext()) {
            ((ConnectionEventListener) i.next()).connectionClosed(event);
        }
    }
View Full Code Here

        synchronized (connectionEventListeners) {
            if (connectionEventListeners.size() == 0)
                return;

            ConnectionEvent closedEvent = new ConnectionEvent(this, exception);
            Iterator listeners = connectionEventListeners.iterator();
            while (listeners.hasNext()) {
                ConnectionEventListener nextListener = (ConnectionEventListener) listeners
                        .next();
                nextListener.connectionErrorOccurred(closedEvent);
View Full Code Here

    protected void connectionClosedNotification() {
        synchronized (connectionEventListeners) {
            if (connectionEventListeners.size() == 0)
                return;

            ConnectionEvent closedEvent = new ConnectionEvent(this);
            Iterator listeners = connectionEventListeners.iterator();

            while (listeners.hasNext()) {
                ConnectionEventListener nextListener = (ConnectionEventListener) listeners
                        .next();
View Full Code Here

   
    /**
     * sends a connectionClosed event to listeners.
     */
    void notifyListeners() {
        ConnectionEvent event = new ConnectionEvent(this);
        Object[] listeners = eventListeners.toArray();
        for (int i = 0; i < listeners.length; i++) {
            ((ConnectionEventListener) listeners[i]).connectionClosed(event);
        }
    }
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.