Package javax.resource.spi

Examples of javax.resource.spi.ConnectionEvent


    public WebdavResource getWebdavResource() {
        return webdavResource;
    }

    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);
        }
    }
View Full Code Here


            id = txn.getId();
        } catch (DatabaseException DE) {
            throw new ResourceException("During begin: " + DE.toString());
        }

        ConnectionEvent connEvent = new ConnectionEvent
            (mgdConn, ConnectionEvent.LOCAL_TRANSACTION_STARTED);
        connEvent.setConnectionHandle(mgdConn);
        mgdConn.sendConnectionEvent(connEvent);

        if (DEBUG) {
            System.out.println("JELocalTransaction.begin " + id);
        }
View Full Code Here

            throw ret;
        } finally {
            env.setThreadTransaction(null);
        }

        ConnectionEvent connEvent = new ConnectionEvent
            (mgdConn, ConnectionEvent.LOCAL_TRANSACTION_COMMITTED);
        connEvent.setConnectionHandle(mgdConn);
        mgdConn.sendConnectionEvent(connEvent);

        if (DEBUG) {
            System.out.println("JELocalTransaction.commit");
        }
View Full Code Here

            throw ret;
        } finally {
            env.setThreadTransaction(null);
        }

        ConnectionEvent connEvent = new ConnectionEvent
            (mgdConn, ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK);
        connEvent.setConnectionHandle(mgdConn);
        mgdConn.sendConnectionEvent(connEvent);

        if (DEBUG) {
            System.out.println("JELocalTransaction.rollback");
        }
View Full Code Here

    public PrintWriter getLogWriter() {
        return null;
    }

    protected void close() {
        ConnectionEvent connEvent =
            new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
        connEvent.setConnectionHandle(conn);
        sendConnectionEvent(connEvent);
    }
View Full Code Here

     * Close handle
     *
     * @param handle The handle
     */
    public void closeHandle(ValidConnection handle) {
        ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
        event.setConnectionHandle(handle);
        for (ConnectionEventListener cel : listeners) {
            cel.connectionClosed(event);
        }
    }
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

    /**
     * Send event.
     */
    private void sendEvent(int type, Object handle, Exception cause) {
        ConnectionEvent event = new ConnectionEvent(this, type, cause);
        if (handle != null) {
            event.setConnectionHandle(handle);
        }

        sendEvent(event);
    }
View Full Code Here

    /**
     * Send event.
     */
    private void sendEvent(int type, Object handle, Exception cause) {
        ConnectionEvent event = new ConnectionEvent(this, type, cause);
        if (handle != null) {
            event.setConnectionHandle(handle);
        }

        sendEvent(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

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.