Package org.apache.activemq.command

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


        message.setPersistent(deliveryMode == DeliveryMode.PERSISTENT);
        return message;
    }

    protected LocalTransactionId createLocalTransaction(SessionInfo info) {
        LocalTransactionId id = new LocalTransactionId(info.getSessionId().getParentId(), ++txGenerator);
        return id;
    }
View Full Code Here

        ConsumerInfo consumerInfo = createConsumerInfo(sessionInfo, destination);
        consumerInfo.setPrefetchSize(1000);
        connection.send(consumerInfo);

        // Start the tx..
        LocalTransactionId txid = createLocalTransaction(sessionInfo);
        connection.send(createBeginTransaction(connectionInfo, txid));

        // m1 and m3 should not expire.. but the others should.
        Message m1 = createMessage(producerInfo, destination, deliveryMode);
        m1.setTransactionId(txid);
View Full Code Here

        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

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

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

public class LocalTransactionIdTest extends TransactionIdTestSupport {

    public static final LocalTransactionIdTest SINGLETON = new LocalTransactionIdTest();

    public Object createObject() throws Exception {
        LocalTransactionId info = new LocalTransactionId();
        populateObject(info);
        return info;
    }
View Full Code Here

        return info;
    }

    protected void populateObject(Object object) throws Exception {
        super.populateObject(object);
        LocalTransactionId info = (LocalTransactionId)object;
        info.setValue(1);
        info.setConnectionId(createConnectionId("ConnectionId:1"));

    }
View Full Code Here


    public static final LocalTransactionIdTest SINGLETON = new LocalTransactionIdTest();

    public Object createObject() throws Exception {
        LocalTransactionId info = new LocalTransactionId();
        populateObject(info);
        return info;
    }
View Full Code Here

        return info;
    }

    protected void populateObject(Object object) throws Exception {
        super.populateObject(object);
        LocalTransactionId info = (LocalTransactionId) object;

        info.setValue(1);
        info.setConnectionId(createConnectionId("ConnectionId:1"));
    }
View Full Code Here

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

        if (txid.isLocalTransaction()) {
            LocalTransactionId t = (LocalTransactionId) txid;
            KahaLocalTransactionId kahaTxId = new KahaLocalTransactionId();
            kahaTxId.setConnectionId(t.getConnectionId().getValue());
            kahaTxId.setTransactionId(t.getValue());
            rc.setLocalTransactionId(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.setXaTransactionId(kahaTxId);
        }
        return rc;
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.command.LocalTransactionId

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.