Package javax.resource.spi

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


            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

    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

    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

            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

            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

            connectionEventListener.localTransactionStarted(connectionEvent);
        }
    }

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

            connectionEventListener.localTransactionCommitted(connectionEvent);
        }
    }

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

      catch (JMSException e)
      {
         HornetQRAManagedConnection.log.debug("Unable to unset exception listener", e);
      }

      ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, exception);
      sendEvent(event);
   }
View Full Code Here

               i.remove();
            }
         }

         mc.removeHandle(this);
         ConnectionEvent ev = new ConnectionEvent(mc, ConnectionEvent.CONNECTION_CLOSED);
         ev.setConnectionHandle(this);
         mc.sendEvent(ev);
         mc = null;
      }
   }
View Full Code Here

TOP

Related Classes of javax.resource.spi.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.