Examples of LocalTransactionId


Examples of com.taobao.metamorphosis.transaction.LocalTransactionId

    @Override
    @Before
    public void setUp() {
        super.setUp();
        this.txMap = new ConcurrentHashMap<TransactionId, Transaction>();
        this.xid = new LocalTransactionId("test", 99);
        this.context = EasyMock.createMock(SessionContext.class);
        EasyMock.expect(this.context.getTransactions()).andReturn(this.txMap).anyTimes();
        this.localTransaction =
                new LocalTransaction(this.transactionStore, (LocalTransactionId) this.xid, this.context);
        this.txMap.put(this.xid, this.localTransaction);
View Full Code Here

Examples of io.fabric8.gateway.handlers.detecting.protocol.openwire.command.LocalTransactionId

   
    /**
     * @return a new object instance
     */
    public DataStructure createObject() {
        return new LocalTransactionId();
    }
View Full Code Here

Examples of org.apache.activemq.apollo.openwire.command.LocalTransactionId

    /**
     * @return a new object instance
     */
    public DataStructure createObject() {
        return new LocalTransactionId();
    }
View Full Code Here

Examples of org.apache.activemq.command.LocalTransactionId

            throw new TransactionInProgressException("Cannot start local transaction.  XA transaction is already in progress.");
        }
       
        if (transactionId == null) {
            synchornizations = null;
            this.transactionId = new LocalTransactionId(connectionId, localTransactionIdGenerator.getNextSequenceId());
            TransactionInfo info = new TransactionInfo(getConnectionId(), transactionId, TransactionInfo.BEGIN);
            this.connection.ensureConnectionInfoSent();
            this.connection.asyncSendPacket(info);

            // Notify the listener that the tx was started.
View Full Code Here

Examples of org.apache.activemq.command.LocalTransactionId

        if (transactions.get(stompTx) != null) {
            throw new ProtocolException("The transaction was allready started: " + stompTx);
        }

        LocalTransactionId activemqTx = new LocalTransactionId(connectionId, transactionIdGenerator.getNextSequenceId());
        transactions.put(stompTx, activemqTx);

        TransactionInfo tx = new TransactionInfo();
        tx.setConnectionId(connectionId);
        tx.setTransactionId(activemqTx);
View Full Code Here

Examples of org.apache.activemq.command.LocalTransactionId

        }
       
        if (transactionId == null) {
            synchronizations = null;
            beforeEndIndex = 0;
            this.transactionId = new LocalTransactionId(connectionId, localTransactionIdGenerator.getNextSequenceId());
            TransactionInfo info = new TransactionInfo(getConnectionId(), transactionId, TransactionInfo.BEGIN);
            this.connection.ensureConnectionInfoSent();
            this.connection.asyncSendPacket(info);

            // Notify the listener that the tx was started.
View Full Code Here

Examples of org.apache.activemq.command.LocalTransactionId

    }

    private TransactionId key(KahaTransactionInfo transactionInfo) {
        if (transactionInfo.hasLocalTransacitonId()) {
            KahaLocalTransactionId tx = transactionInfo.getLocalTransacitonId();
            LocalTransactionId rc = new LocalTransactionId();
            rc.setConnectionId(new ConnectionId(tx.getConnectionId()));
            rc.setValue(tx.getTransacitonId());
            return rc;
        } else {
            KahaXATransactionId tx = transactionInfo.getXaTransacitonId();
            XATransactionId rc = new XATransactionId();
            rc.setBranchQualifier(tx.getBranchQualifier().toByteArray());
            rc.setGlobalTransactionId(tx.getGlobalTransactionId().toByteArray());
            rc.setFormatId(tx.getFormatId());
            return rc;
        }
    }
View Full Code Here

Examples of org.apache.activemq.command.LocalTransactionId

            return null;
        }
        KahaTransactionInfo rc = new KahaTransactionInfo();

        if (txid.isLocalTransaction()) {
            LocalTransactionId t = (LocalTransactionId) txid;
            KahaLocalTransactionId kahaTxId = new KahaLocalTransactionId();
            kahaTxId.setConnectionId(t.getConnectionId().getValue());
            kahaTxId.setTransacitonId(t.getValue());
            rc.setLocalTransacitonId(kahaTxId);
        } else {
            XATransactionId t = (XATransactionId) txid;
            KahaXATransactionId kahaTxId = new KahaXATransactionId();
            kahaTxId.setBranchQualifier(new Buffer(t.getBranchQualifier()));
            kahaTxId.setGlobalTransactionId(new Buffer(t.getGlobalTransactionId()));
            kahaTxId.setFormatId(t.getFormatId());
            rc.setXaTransacitonId(kahaTxId);
        }
        return rc;
    }
View Full Code Here

Examples of org.apache.activemq.command.LocalTransactionId

    protected BrokerId createBrokerId(String text) {
        return new BrokerId(text);
    }

    protected TransactionId createTransactionId(String string) {
        return new LocalTransactionId(createConnectionId(string), ++counter);
    }
View Full Code Here

Examples of org.apache.activemq.command.LocalTransactionId

      

        // Now get the messages.
        for (int i = 0; i < 4; i++) {
            // Begin the transaction.
            LocalTransactionId txid = createLocalTransaction(sessionInfo1);
            connection1.send(createBeginTransaction(connectionInfo1, txid));
            Message m1 = receiveMessage(connection1);
            assertNotNull(m1);
            MessageAck ack = createAck(consumerInfo1, m1, 1, MessageAck.STANDARD_ACK_TYPE);
            ack.setTransactionId(txid);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.