Package com.sun.messaging.jmq.jmsserver.data

Examples of com.sun.messaging.jmq.jmsserver.data.TransactionState


    }

    //Caller must ensure this is the transaction home broker
    private void sendClusterTransactionInfo(TransactionUID tid, BrokerAddress to, Long xid) {
        TransactionList translist = Globals.getTransactionList();
        TransactionState ts =  translist.retrieveState(tid, true);

        BrokerAddress[] parties = null;
        BrokerAddress[] waitfor = null;
        TransactionBroker[] brokers = null;
        if (ts != null) {
        try {
            brokers = translist.getClusterTransactionBrokers(tid);
        } catch (Exception e) {
            logger.log(logger.WARNING, "Can't retrieve cluster transaction brokers:"+ e.getMessage());
        }
        if (brokers == null) {
            logger.log(logger.WARNING, "No cluster transaction brokers information for TID="+ tid);
        } else {
            parties = new BrokerAddress[brokers.length];
            ArrayList waits = new ArrayList();
            for (int i = 0; i < brokers.length; i++) {
                parties[i] = brokers[i].getBrokerAddress();
                if (!brokers[i].isCompleted()) waits.add(brokers[i].getBrokerAddress());
            }
            if (waits.size() > 0) waitfor = (BrokerAddress[])waits.toArray(new BrokerAddress[0]);
        }
        }

        ClusterTxnInfoInfo ii = ClusterTxnInfoInfo.newInstance(new Long(tid.longValue()),
                                        (ts == null ? TransactionState.NULL: ts.getState()),
                                                   parties, waitfor, Globals.getMyAddress(),
                                                   true, c, xid);
        if (DEBUG_CLUSTER_TXN) {
        logger.log(logger.INFO, Globals.getBrokerResources().getString(
                   BrokerResources.I_SEND_CLUSTER_TXN_INFO, to.toString(), ii.toString()));
View Full Code Here


        Long tid = ii.getTransactionID();
        TransactionUID tuid = new TransactionUID(tid.longValue());
        int s = ii.getTransactionState();

        if (!ii.isOwner() || (ii.isOwner() && from.equals(selfAddress))) {
            TransactionState mystate =  translist.retrieveState(tuid, true);
            if (mystate != null && mystate.getState() == TransactionState.COMMITTED) {
                if (translist.getClusterTransactionBroker(tuid, from) != null) {
                    if (s == TransactionState.COMMITTED ||
                        (!ii.isOwner() && s == TransactionState.NULL)) {
                        if (DEBUG_CLUSTER_TXN) {
                        logger.log(logger.INFO, "Update broker "+from+ " for committed cluster transaction "+tuid);  
View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.jmsserver.data.TransactionState

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.