Package org.activemq.message

Examples of org.activemq.message.IntResponseReceipt


            if (info.getType() == XATransactionInfo.PRE_COMMIT) {
                int rc = this.brokerConnector.prepareTransaction(this, info.getXid());
                // We will be sending our own receipt..
                info.setReceiptRequired(false);
                // Send the receipt..
                IntResponseReceipt receipt = new IntResponseReceipt();
                receipt.setId(this.packetIdGenerator.getNextShortSequence());
                receipt.setCorrelationId(info.getId());
                receipt.setResult(rc);
                send(receipt);
            }
            else if (info.getType() == XATransactionInfo.ROLLBACK) {
                this.brokerConnector.rollbackTransaction(this, info.getXid());
            }
View Full Code Here


                int rc = this.brokerConnector.prepareTransaction(this, info.getXid());
                // We will be sending our own receipt..
                if( info.isReceiptRequired()) {
                    info.setReceiptRequired(false);
                    // Send the receipt..
                    IntResponseReceipt receipt = new IntResponseReceipt();
                    receipt.setId(this.packetIdGenerator.getNextShortSequence());
                    receipt.setCorrelationId(info.getId());
                    receipt.setResult(rc);
                    send(receipt);
                }
            }
            else if (info.getType() == XATransactionInfo.ROLLBACK) {
                this.brokerConnector.rollbackTransaction(this, info.getXid());
View Full Code Here

        try {
            if( log.isDebugEnabled() )
                log.debug("Preparing XA transaction: "+x);
           
            // Find out if the server wants to commit or rollback.
            IntResponseReceipt receipt = (IntResponseReceipt) this.connection.syncSendRequest(info);
            return receipt.getResult();
        } catch (JMSException e) {
            throw toXAException(e);
        }
    }
View Full Code Here

        XATransactionInfo info = new XATransactionInfo();
        info.setType(XATransactionInfo.GET_TX_TIMEOUT);

        try {
            // get the tx timeout that was set.
            IntResponseReceipt receipt = (IntResponseReceipt) this.connection.syncSendRequest(info);
            return receipt.getResult();
        } catch (JMSException e) {
            throw toXAException(e);
        }
    }
View Full Code Here

            if (info.getType() == XATransactionInfo.PRE_COMMIT) {
                int rc = this.brokerConnector.prepareTransaction(this, info.getXid());
                // We will be sending our own receipt..
                info.setReceiptRequired(false);
                // Send the receipt..
                IntResponseReceipt receipt = new IntResponseReceipt();
                receipt.setId(this.packetIdGenerator.getNextShortSequence());
                receipt.setCorrelationId(info.getId());
                receipt.setResult(rc);
                send(receipt);
            }
            else if (info.getType() == XATransactionInfo.ROLLBACK) {
                this.brokerConnector.rollbackTransaction(this, info.getXid());
            }
View Full Code Here

    /**
     * @return a new Packet instance
     */

    public Packet createPacket() {
        return new IntResponseReceipt();
    }
View Full Code Here

     * @throws IOException
     */

    public void buildPacket(Packet packet, DataInput dataIn) throws IOException {
        super.buildPacket(packet, dataIn);
        IntResponseReceipt info = (IntResponseReceipt) packet;
        info.setResult(dataIn.readInt());
    }
View Full Code Here

        info.setXid(x);
        info.setType(XATransactionInfo.PRE_COMMIT);

        try {
            // Find out if the server wants to commit or rollback.
            IntResponseReceipt receipt = (IntResponseReceipt) this.connection.syncSendRequest(info);
            return receipt.getResult();
        } catch (JMSException e) {
            throw toXAException(e);
        }
    }
View Full Code Here

        XATransactionInfo info = new XATransactionInfo();
        info.setType(XATransactionInfo.GET_TX_TIMEOUT);

        try {
            // get the tx timeout that was set.
            IntResponseReceipt receipt = (IntResponseReceipt) this.connection.syncSendRequest(info);
            return receipt.getResult();
        } catch (JMSException e) {
            throw toXAException(e);
        }
    }
View Full Code Here

     * @throws IOException thrown if an error occurs
     */

    public void writePacket(Packet packet, DataOutput dataOut) throws IOException {
        super.writePacket(packet, dataOut);
        IntResponseReceipt info = (IntResponseReceipt) packet;
        dataOut.writeInt(info.getResult());
    }
View Full Code Here

TOP

Related Classes of org.activemq.message.IntResponseReceipt

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.