Package org.activemq.message

Examples of org.activemq.message.TransactionInfo


        if (format.isInTransaction())
        {
            return new PacketEnvelope(new KeepAlive(), headers);
        }
        TransactionInfo tx = new TransactionInfo();
        String tx_id = StompWireFormat.clientIds.generateId();
        format.setTransactionId(tx_id);
        tx.setTransactionId(tx_id);
        tx.setType(TransactionType.START);
        return new PacketEnvelope(tx, headers);
    }
View Full Code Here


        if (!format.isInTransaction())
        {
            throw new ProtocolException("Cannot COMMIT when not in a transaction");
        }
        TransactionInfo tx = new TransactionInfo();
        tx.setTransactionId(format.getTransactionId());
        tx.setType(TransactionType.COMMIT);
        format.clearTransactionId();
        return new PacketEnvelope(tx, headers);
    }
View Full Code Here

        if (!format.isInTransaction())
        {
            throw new ProtocolException("Cannot ABORT when not in a transaction");
        }
        TransactionInfo tx = new TransactionInfo();
        tx.setTransactionId(format.getTransactionId());
        tx.setType(TransactionType.ROLLBACK);
        format.clearTransactionId();
        return new PacketEnvelope(tx, headers);
    }
View Full Code Here

                            XATransactionInfo info = (XATransactionInfo) packet;
                            consumeXATransactionInfo(info);
                            break;
                        }
                        case Packet.TRANSACTION_INFO : {
                            TransactionInfo info = (TransactionInfo) packet;
                            consumeTransactionInfo(info);
                            break;
                        }
                        case Packet.CONSUMER_INFO : {
                            ConsumerInfo info = (ConsumerInfo) packet;
View Full Code Here

                            consumeXATransactionInfo(info);
                            receiptRequired=info.isReceiptRequired();
                            break;
                        }
                        case Packet.TRANSACTION_INFO : {
                            TransactionInfo info = (TransactionInfo) packet;
                            consumeTransactionInfo(info);
                            break;
                        }
                        case Packet.CONSUMER_INFO : {
                            ConsumerInfo info = (ConsumerInfo) packet;
View Full Code Here

        if( associatedXid!=null )
            throw new TransactionInProgressException("Cannot start local transction.  XA transaction is allready in progress.");       
       
        if( localTransactionId==null ) {        
            this.localTransactionId = localTransactionIdGenerator.generateId();
            TransactionInfo info = new TransactionInfo();
            info.setTransactionId((String)localTransactionId);
            info.setType(TransactionInfo.START);
            this.connection.asyncSendPacket(info);
           
            // Notify the listener that the tx was started.
            if (localTransactionEventListener != null) {
                localTransactionEventListener.beginEvent();
View Full Code Here

    public void rollback() throws JMSException {
        if( associatedXid!=null )
            throw new TransactionInProgressException("Cannot rollback() if an XA transaction is allready in progress ");
       
        if( localTransactionId!=null ) {           
            TransactionInfo info = new TransactionInfo();
            info.setTransactionId((String)localTransactionId);
            info.setType(TransactionInfo.ROLLBACK);
            //before we send, update the current transaction id
            this.localTransactionId = null;
            this.connection.asyncSendPacket(info);
            // Notify the listener that the tx was rolled back
            if (localTransactionEventListener != null) {
View Full Code Here

        if( associatedXid!=null )
            throw new TransactionInProgressException("Cannot commit() if an XA transaction is allready in progress ");

        // Only send commit if the transaction was started.
        if (localTransactionId!=null) {
            TransactionInfo info = new TransactionInfo();
            info.setTransactionId((String)localTransactionId);
            info.setType(TransactionInfo.COMMIT);
            //before we send, update the current transaction id
            this.localTransactionId = null;
            // Notify the listener that the tx was commited back
            this.connection.syncSendPacket(info);
            if (localTransactionEventListener != null) {
View Full Code Here

                            XATransactionInfo info = (XATransactionInfo) packet;
                            consumeXATransactionInfo(info);
                            break;
                        }
                        case Packet.TRANSACTION_INFO : {
                            TransactionInfo info = (TransactionInfo) packet;
                            consumeTransactionInfo(info);
                            break;
                        }
                        case Packet.CONSUMER_INFO : {
                            ConsumerInfo info = (ConsumerInfo) packet;
View Full Code Here

        if( associatedXid!=null )
            throw new TransactionInProgressException("Cannot start local transction.  XA transaction is allready in progress.");       
       
        if( localTransactionId==null ) {        
            this.localTransactionId = localTransactionIdGenerator.generateId();
            TransactionInfo info = new TransactionInfo();
            info.setTransactionId((String)localTransactionId);
            info.setType(TransactionInfo.START);
            this.connection.asyncSendPacket(info);
           
            // Notify the listener that the tx was started.
            if (localTransactionEventListener != null) {
                localTransactionEventListener.beginEvent();
View Full Code Here

TOP

Related Classes of org.activemq.message.TransactionInfo

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.