Example usage for javax.resource.spi ConnectionEvent CONNECTION_CLOSED

List of usage examples for javax.resource.spi ConnectionEvent CONNECTION_CLOSED

Introduction

In this page you can find the example usage for javax.resource.spi ConnectionEvent CONNECTION_CLOSED.

Prototype

int CONNECTION_CLOSED

To view the source code for javax.resource.spi ConnectionEvent CONNECTION_CLOSED.

Click Source Link

Document

Event notification that an application component has closed the connection

Usage

From source file:com.googlecode.cassandra.jca.managed.connection.CassandraManagedConnection.java

@Override
public void close() {
    //        logger.info("void close()");
    //        logger.info("this = " + this);
    ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
    event.setConnectionHandle(cassandraConnection);

    for (ConnectionEventListener cel : listeners) {
        cel.connectionClosed(event);//from w  w w. ja va  2s . co  m
    }
}

From source file:eu.luminis.httpjca.HttpManagedConnection.java

/**
 * Close handle//from  w w w  . ja v  a  2s. c  o  m
 *
 * @param handle The handle
 */
void closeHandle(HttpConnection handle) {
    ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
    event.setConnectionHandle(handle);
    for (ConnectionEventListener cel : listeners) {
        cel.connectionClosed(event);
    }

}

From source file:org.apache.webdav.connector.WebDAVManagedConnection.java

public void close() {
    ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
    event.setConnectionHandle(connection);
    for (Iterator it = listeners.iterator(); it.hasNext();) {
        ((ConnectionEventListener) it.next()).connectionClosed(event);
    }/*from w  ww.  j a v  a 2 s. c  om*/
}

From source file:org.eclipse.ecr.core.storage.sql.ra.ManagedConnectionImpl.java

private void sendClosedEvent(ConnectionImpl connection) {
    sendEvent(ConnectionEvent.CONNECTION_CLOSED, connection, null);
}

From source file:org.eclipse.ecr.core.storage.sql.ra.ManagedConnectionImpl.java

/**
 * Notifies the application server, through the
 * {@link ConnectionEventListener}s it has registered with us, of what
 * happens with this connection./*from   w ww  .  j a  va  2 s  . c o m*/
 */
private void sendEvent(ConnectionEvent event) {
    for (Object object : listeners.getListeners()) {
        ConnectionEventListener listener = (ConnectionEventListener) object;
        switch (event.getId()) {
        case ConnectionEvent.CONNECTION_CLOSED:
            listener.connectionClosed(event);
            break;
        case ConnectionEvent.LOCAL_TRANSACTION_STARTED:
            listener.localTransactionStarted(event);
            break;
        case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED:
            listener.localTransactionCommitted(event);
            break;
        case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK:
            listener.localTransactionRolledback(event);
            break;
        case ConnectionEvent.CONNECTION_ERROR_OCCURRED:
            listener.connectionErrorOccurred(event);
            break;
        }
    }
}

From source file:org.nuxeo.ecm.core.jca.JCAManagedConnection.java

/**
 * Send event.//from  ww  w  . j a va 2s.  c  o  m
 */
private void sendEvent(ConnectionEvent event) {
    Object[] listenersArray = listeners.getListenersCopy();
    for (Object object : listenersArray) {
        ConnectionEventListener listener = (ConnectionEventListener) object;

        switch (event.getId()) {
        case ConnectionEvent.CONNECTION_CLOSED:
            listener.connectionClosed(event);
            break;
        case ConnectionEvent.CONNECTION_ERROR_OCCURRED:
            listener.connectionErrorOccurred(event);
            break;
        case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED:
            listener.localTransactionCommitted(event);
            break;
        case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK:
            listener.localTransactionRolledback(event);
            break;
        case ConnectionEvent.LOCAL_TRANSACTION_STARTED:
            listener.localTransactionStarted(event);
            break;
        }
    }
}

From source file:org.nuxeo.ecm.core.jca.JCAManagedConnection.java

/**
 * Send connection closed event.
 */
public void sendClosedEvent(JCAConnection handle) {
    sendEvent(ConnectionEvent.CONNECTION_CLOSED, handle, null);
}

From source file:org.nuxeo.ecm.core.storage.sql.ra.ManagedConnectionImpl.java

private void sendClosedEvent(ConnectionImpl connection) {
    log.debug("closing a connection " + connection);
    sendEvent(ConnectionEvent.CONNECTION_CLOSED, connection, null);
}

From source file:pl.psnc.synat.dsa.DataStorageManagedConnection.java

/**
 * Releases connection. Normal behavior.
 *//*from w ww  . j  a  v  a 2s  .  co m*/
public void release() {
    logger.debug("releasing");
    sender.sendEvent(ConnectionEvent.CONNECTION_CLOSED, null, connection);
}