Package javax.resource.spi

Examples of javax.resource.spi.ConnectionEventListener


        if (connectionHandle != null) {
            ce.setConnectionHandle(connectionHandle);
        }
         int size = list.size();
        for (int i=0; i<size; i++) {
            ConnectionEventListener l =
                (ConnectionEventListener) list.elementAt(i);
            switch (eventType) {
            case ConnectionEvent.CONNECTION_CLOSED:
                l.connectionClosed(ce);
                break;
            case ConnectionEvent.LOCAL_TRANSACTION_STARTED:
                l.localTransactionStarted(ce);
                break;
            case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED:
                l.localTransactionCommitted(ce);
                break;
            case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK:
                l.localTransactionRolledback(ce);
                break;
            case ConnectionEvent.CONNECTION_ERROR_OCCURRED:
                l.connectionErrorOccurred(ce);
                break;
            default:
                throw new IllegalArgumentException("Illegal eventType: " +
                                                   eventType);
            }
View Full Code Here


      return;

    ConnectionEvent event =
      new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED);

    ConnectionEventListener listener;
    for (int i = 0; i < listeners.size(); i++) {
      listener = (ConnectionEventListener) listeners.get(i);
      listener.connectionErrorOccurred(event);
    }

    try {
      cleanup();
    } catch (ResourceException e) {
View Full Code Here

                                          + "already begun.");

    ConnectionEvent event =
      new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_STARTED);

    ConnectionEventListener listener;
    for (int i = 0; i < listeners.size(); i++) {
      listener = (ConnectionEventListener) listeners.get(i);
      listener.localTransactionStarted(event);
    }

    startedLocalTx = true;
  }
View Full Code Here

    }

    ConnectionEvent event =
      new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_COMMITTED);

    ConnectionEventListener listener;
    for (int i = 0; i < listeners.size(); i++) {
      listener = (ConnectionEventListener) listeners.get(i);
      listener.localTransactionCommitted(event);
    }

    startedLocalTx = false;
  }
View Full Code Here

    }

    ConnectionEvent event =
      new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK);

    ConnectionEventListener listener;
    for (int i = 0; i < listeners.size(); i++) {
      listener = (ConnectionEventListener) listeners.get(i);
      listener.localTransactionRolledback(event);
    }

    startedLocalTx = false;
  }
View Full Code Here

    ConnectionEvent event =
      new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
    event.setConnectionHandle(handle);

    ConnectionEventListener listener;
    for (int i = 0; i < listeners.size(); i++) {
      listener = (ConnectionEventListener) listeners.get(i);
      listener.connectionClosed(event);
    }
  }
View Full Code Here

        if (connectionHandle != null) {
            ce.setConnectionHandle(connectionHandle);
        }
        int size = list.size();
        for (int i=0; i<size; i++) {
            ConnectionEventListener l =
                (ConnectionEventListener) list.elementAt(i);
            switch (eventType) {
            case ConnectionEvent.CONNECTION_CLOSED:
                l.connectionClosed(ce);
                break;
            case ConnectionEvent.LOCAL_TRANSACTION_STARTED:
                l.localTransactionStarted(ce);
                break;
            case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED:
                l.localTransactionCommitted(ce);
                break;
            case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK:
                l.localTransactionRolledback(ce);
                break;
            case ConnectionEvent.CONNECTION_ERROR_OCCURRED:
                l.connectionErrorOccurred(ce);
                break;
            default:
                throw new IllegalArgumentException("Illegal eventType: " +
                                                   eventType);
            }
View Full Code Here

        ConnectionEvent ev = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
        ev.setConnectionHandle(impl);
        Vector list = (Vector) listeners.clone();
        int size = list.size();
        for (int i=0; i<size; i++) {
            ConnectionEventListener l =
                (ConnectionEventListener) list.elementAt(i);
            l.connectionClosed(ev);
        }
    }
View Full Code Here

        else
            ev = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED);
        Vector list = (Vector) listeners.clone();
        int size = list.size();
        for (int i=0; i<size; i++) {
            ConnectionEventListener l =
                (ConnectionEventListener) list.elementAt(i);
            l.connectionErrorOccurred(ev);
        }
    }
View Full Code Here

      begin();
      ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_STARTED);
      Collection copy = new ArrayList(listeners);
      for (Iterator i = copy.iterator(); i.hasNext(); )
      {
         ConnectionEventListener cel = (ConnectionEventListener)i.next();
         try
         {
            cel.localTransactionStarted(event);
         }
         catch (Throwable ignored)
         {
            log.warn("Ignored", ignored);
         }
View Full Code Here

TOP

Related Classes of javax.resource.spi.ConnectionEventListener

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.