Search in sources :

Example 11 with ConnectionEvent

use of javax.resource.spi.ConnectionEvent in project Payara by payara.

the class ManagedConnectionImpl method connectionErrorOccurred.

/**
 * This method is called by the <code>ConnectionHolder30</code> when it detects a connecion
 * related error.
 *
 * @param e                Exception that has occurred during an operation on the physical connection
 * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
 *                         connection error
 */
void connectionErrorOccurred(Exception e, ConnectionHolder connHolderObject) {
    ConnectionEventListener cel = this.listener;
    ConnectionEvent ce = null;
    ce = e == null ? new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED) : new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, e);
    if (connHolderObject != null) {
        ce.setConnectionHandle(connHolderObject);
    }
    cel.connectionErrorOccurred(ce);
    isUsable = false;
}
Also used : ConnectionEvent(javax.resource.spi.ConnectionEvent) BadConnectionEventListener(com.sun.appserv.connectors.internal.spi.BadConnectionEventListener) ConnectionEventListener(javax.resource.spi.ConnectionEventListener)

Example 12 with ConnectionEvent

use of javax.resource.spi.ConnectionEvent in project tomee by apache.

the class SampleManagedConnection method closeHandle.

void closeHandle(SampleConnection handle) {
    ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
    event.setConnectionHandle(handle);
    for (ConnectionEventListener cel : listeners) {
        cel.connectionClosed(event);
    }
}
Also used : ConnectionEvent(javax.resource.spi.ConnectionEvent) ConnectionEventListener(javax.resource.spi.ConnectionEventListener)

Example 13 with ConnectionEvent

use of javax.resource.spi.ConnectionEvent in project tomee by apache.

the class SampleManagedConnection method closeHandle.

void closeHandle(SampleConnection handle) {
    ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
    event.setConnectionHandle(handle);
    for (ConnectionEventListener cel : listeners) {
        cel.connectionClosed(event);
    }
}
Also used : ConnectionEvent(javax.resource.spi.ConnectionEvent) ConnectionEventListener(javax.resource.spi.ConnectionEventListener)

Example 14 with ConnectionEvent

use of javax.resource.spi.ConnectionEvent in project wildfly by wildfly.

the class AnnoManagedConnection method closeHandle.

/**
     * Close handle
     *
     * @param handle The handle
     */
void closeHandle(AnnoConnection handle) {
    ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
    event.setConnectionHandle(handle);
    for (ConnectionEventListener cel : listeners) {
        cel.connectionClosed(event);
    }
}
Also used : ConnectionEvent(javax.resource.spi.ConnectionEvent) ConnectionEventListener(javax.resource.spi.ConnectionEventListener)

Example 15 with ConnectionEvent

use of javax.resource.spi.ConnectionEvent in project wildfly by wildfly.

the class ValidManagedConnection1 method closeHandle.

/**
     * Close handle
     *
     * @param handle The handle
     */
public void closeHandle(ValidConnection1 handle) {
    ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
    event.setConnectionHandle(handle);
    for (ConnectionEventListener cel : listeners) {
        cel.connectionClosed(event);
    }
}
Also used : ConnectionEvent(javax.resource.spi.ConnectionEvent) ConnectionEventListener(javax.resource.spi.ConnectionEventListener)

Aggregations

ConnectionEvent (javax.resource.spi.ConnectionEvent)24 ConnectionEventListener (javax.resource.spi.ConnectionEventListener)21 Test (org.junit.Test)5 BadConnectionEventListener (com.sun.appserv.connectors.internal.spi.BadConnectionEventListener)1 GFConnectionImpl (org.apache.geode.internal.ra.GFConnectionImpl)1