Package org.activemq.message

Examples of org.activemq.message.ActiveMQXid


              case TxCommand.LOCAL_COMMIT:
              case TxCommand.LOCAL_ROLLBACK:
                  os.writeUTF( (String) command.getTransactionId() );
                  break;
              default:
                  ActiveMQXid xid = (ActiveMQXid) command.getTransactionId();
                xid.write(os);
                break;
            }
            os.close();
            return journal.write(pos.getPacket(), sync);
        }
View Full Code Here


              case TxCommand.LOCAL_COMMIT:
              case TxCommand.LOCAL_ROLLBACK:
                  os.writeUTF( (String) command.getTransactionId() );
                  break;
              default:
                  ActiveMQXid xid = (ActiveMQXid) command.getTransactionId();
                xid.write(os);
                break;
            }
            os.close();
            return journal.write(pos.getPacket(), sync);
        }
View Full Code Here

              case TxCommand.LOCAL_COMMIT:
              case TxCommand.LOCAL_ROLLBACK:
                  os.writeUTF( (String) command.getTransactionId() );
                  break;
              default:
                  ActiveMQXid xid = (ActiveMQXid) command.getTransactionId();
                xid.write(os);
                break;
            }
            os.close();
            return journal.write(pos.getPacket(), sync);
        }
View Full Code Here

            if (ba.get(ActiveMQMessage.REPLY_TO_INDEX)) {
                ActiveMQDestination.writeToStream((ActiveMQDestination) msg.getJMSReplyTo(), dataOut);
            }
            if (ba.get(ActiveMQMessage.TRANSACTION_ID_INDEX)) {
                if( ba.get(ActiveMQMessage.XA_TRANS_INDEX) ) {
                    ActiveMQXid xid = (ActiveMQXid) msg.getTransactionId();
                    xid.write(dataOut);
                } else {
                    super.writeUTF((String) msg.getTransactionId(), dataOut);
                }           
            }
        }
View Full Code Here

    private void consumeXATransactionInfo(XATransactionInfo info) throws JMSException, XAException {
        if (info.getType() == XATransactionInfo.START) {
            this.brokerConnector.startTransaction(this, info.getXid());
        }
        else if (info.getType() == XATransactionInfo.XA_RECOVER) {
            ActiveMQXid rc[] = this.brokerConnector.getPreparedTransactions(this);
            // We will be sending our own receipt..
            info.setReceiptRequired(false);
            // Send the receipt..
            ResponseReceipt receipt = new ResponseReceipt();
            receipt.setCorrelationId(info.getId());
View Full Code Here

    private void consumeXATransactionInfo(XATransactionInfo info) throws JMSException, XAException {
        if (info.getType() == XATransactionInfo.START) {
            this.brokerConnector.startTransaction(this, info.getXid());
        }
        else if (info.getType() == XATransactionInfo.XA_RECOVER) {
            ActiveMQXid rc[] = this.brokerConnector.getPreparedTransactions(this);
            if( info.isReceiptRequired()) {
                // We will be sending our own receipt..
                info.setReceiptRequired(false);
                // Send the receipt..
                ResponseReceipt receipt = new ResponseReceipt();
View Full Code Here

    public int prepare(Xid xid) throws XAException {

        // We allow interleaving multiple transactions, so
        // we don't limit prepare to the associated xid.
        ActiveMQXid x;
        //THIS SHOULD NEVER HAPPEN because end(xid, TMSUCCESS) should have been called first
        if (ActiveMQXid.equals(associatedXid,xid)) {
            throw new XAException(XAException.XAER_PROTO);
        } else {
            //TODO cache the known xids so we don't keep recreating this one??
            x = new ActiveMQXid(xid);
        }

        XATransactionInfo info = new XATransactionInfo();
        info.setXid(x);
        info.setType(XATransactionInfo.PRE_COMMIT);
View Full Code Here

    public void rollback(Xid xid) throws XAException {

        // We allow interleaving multiple transactions, so
        // we don't limit rollback to the associated xid.
        ActiveMQXid x;
        if (ActiveMQXid.equals(associatedXid,xid)) {
            //I think this can happen even without an end(xid) call.  Need to check spec.
            x = activeXid;
        } else {
            x = new ActiveMQXid(xid);
        }

        XATransactionInfo info = new XATransactionInfo();
        info.setXid(x);
        info.setType(XATransactionInfo.ROLLBACK);
View Full Code Here

    // XAResource interface
    public void commit(Xid xid, boolean onePhase) throws XAException {

        // We allow interleaving multiple transactions, so
        // we don't limit commit to the associated xid.
        ActiveMQXid x;
        if (ActiveMQXid.equals(associatedXid,xid)) {
            //should never happen, end(xid,TMSUCCESS) must have been previously called
            throw new XAException(XAException.XAER_PROTO);
        } else {
            x = new ActiveMQXid(xid);
        }

        XATransactionInfo info = new XATransactionInfo();
        info.setXid(x);
        info.setType(onePhase ? XATransactionInfo.COMMIT_ONE_PHASE : XATransactionInfo.COMMIT);
View Full Code Here

    public void forget(Xid xid) throws XAException {

        // We allow interleaving multiple transactions, so
        // we don't limit forget to the associated xid.
        ActiveMQXid x;
        if (ActiveMQXid.equals(associatedXid,xid)) {
            //TODO determine if this can happen... I think not.
            x = activeXid;
        } else {
            x = new ActiveMQXid(xid);
        }

        XATransactionInfo info = new XATransactionInfo();
        info.setXid(x);
        info.setType(XATransactionInfo.FORGET);
View Full Code Here

TOP

Related Classes of org.activemq.message.ActiveMQXid

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.