Search in sources :

Example 16 with ConnectionEventListener

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

the class MultipleManagedConnection1 method closeHandle.

/**
     * Close handle
     *
     * @param handle The handle
     */
public void closeHandle(MultipleConnection1 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 17 with ConnectionEventListener

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

the class ConfigPropertyManagedConnection method closeHandle.

/**
     * Close handle
     *
     * @param handle The handle
     */
public void closeHandle(ConfigPropertyConnection 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 18 with ConnectionEventListener

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

the class LazyManagedConnection method closeHandle.

void closeHandle(LazyConnection 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 19 with ConnectionEventListener

use of javax.resource.spi.ConnectionEventListener in project cxf by apache.

the class ManagedConnectionImplTest method testClose.

@Test
public void testClose() throws Exception {
    final Object o = new Object();
    ConnectionEventListener listener = EasyMock.createMock(ConnectionEventListener.class);
    listener.connectionClosed(EasyMock.isA(ConnectionEvent.class));
    EasyMock.expectLastCall();
    EasyMock.replay(listener);
    mc.addConnectionEventListener(listener);
    mc.close(o);
    EasyMock.verify(listener);
}
Also used : ConnectionEvent(javax.resource.spi.ConnectionEvent) ConnectionEventListener(javax.resource.spi.ConnectionEventListener) Test(org.junit.Test)

Example 20 with ConnectionEventListener

use of javax.resource.spi.ConnectionEventListener in project cxf by apache.

the class ManagedConnectionImplTest method testSendEventError.

@Test
public void testSendEventError() throws Exception {
    ConnectionEvent event = new ConnectionEvent(mc, ConnectionEvent.CONNECTION_ERROR_OCCURRED);
    ConnectionEventListener listener = EasyMock.createMock(ConnectionEventListener.class);
    mc.addConnectionEventListener(listener);
    listener.connectionErrorOccurred(EasyMock.isA(ConnectionEvent.class));
    EasyMock.expectLastCall();
    EasyMock.replay(listener);
    mc.sendEvent(event);
    EasyMock.verify(listener);
}
Also used : ConnectionEvent(javax.resource.spi.ConnectionEvent) ConnectionEventListener(javax.resource.spi.ConnectionEventListener) Test(org.junit.Test)

Aggregations

ConnectionEvent (javax.resource.spi.ConnectionEvent)22 ConnectionEventListener (javax.resource.spi.ConnectionEventListener)22 Test (org.junit.Test)7 BadConnectionEventListener (com.sun.appserv.connectors.internal.spi.BadConnectionEventListener)1 NotSupportedException (javax.resource.NotSupportedException)1 GFConnectionImpl (org.apache.geode.internal.ra.GFConnectionImpl)1