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

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


                    args ), Status.CONFLICT);
            }

            // Update the participant broker state
            for ( int i = 0, len = txnBrokers.length; i < len; i++ ) {
                TransactionBroker bkr = txnBrokers[i];
                if ( bkr.equals( txnBkr ) ) {
                    bkr.copyState( txnBkr );
                    break; // done
                }
            }

            // Now update the DB entry
View Full Code Here


    public boolean isWaitedfor(BrokerAddress me) throws Exception {
        List waitfor = getWaitfor();
        if (waitfor == null) return false;
        BrokerAddress b = null;
        TransactionBroker tb = null;
        Iterator itr = waitfor.iterator();
        while (itr.hasNext()) {
            tb = new TransactionBroker((BrokerAddress)itr.next());
            if (tb.getCurrentBrokerAddress().equals(me)) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

        TransactionList translist = Globals.getTransactionList();
        ArrayList tids = translist.getPreparedRemoteTransactions();
        TransactionUID tid = null;
        Iterator itr = tids.iterator();
        ClusterTxnInquiryInfo cii = null;
        TransactionBroker txnhome = null;
        while ( itr.hasNext()) {
            tid = (TransactionUID)itr.next();
            txnhome = translist.getRemoteTransactionHomeBroker(tid);
            cii = ClusterTxnInquiryInfo.newInstance(Long.valueOf(tid.longValue()),
                              ((txnhome == null) ? null:txnhome.getBrokerAddress()), null);
            if (DEBUG_CLUSTER_TXN) {
            logger.log(Logger.INFO, "Sending transaction inquiry: " + cii + " to "+broker);
            }
            try {
View Full Code Here

        logger.log(logger.INFO, "Received transaction inquiry "+cii.toString()+ " from "+from);
        }

        TransactionUID tid = new TransactionUID(cii.getTransactionID().longValue());
        BrokerAddress txnHomeBroker = cii.getTransactionHome();
        TransactionBroker thb = null;
        if (txnHomeBroker != null) {
            thb = new TransactionBroker(txnHomeBroker);
        }

        TransactionList translist = Globals.getTransactionList();
        TransactionState ts =  translist.retrieveState(tid, true);
        if (ts == null && DEBUG_CLUSTER_TXN) {
            logger.log(logger.INFO, "Transaction "+ tid+ " not found in local transaction");
        }
        if (ts != null) {
            BrokerAddress currba = (thb == null ? null:thb.getCurrentBrokerAddress());
            if (currba != null && !currba.equals(Globals.getMyAddress())) {
            logger.log(logger.WARNING,
            "Incorrect transaction home broker info:"+txnHomeBroker+" from "+from + " TID="+tid);
            }
            sendClusterTransactionInfo(tid, from, cii.getXid());
            return;
        }
        if (ts == null && thb != null) {
            BrokerAddress currba = thb.getCurrentBrokerAddress();
            if (currba != null && Globals.getMyAddress().equals(currba)) {
                sendClusterTransactionInfo(tid, from, cii.getXid());
                return;
            }
        }
View Full Code Here

                          ts.getState() != TransactionState.COMMITTED) {
            return;
        }

        int s  = (ts == null ? TransactionState.NULL:ts.getState());
        TransactionBroker txnhome = null;
        if (s ==  TransactionState.ROLLEDBACK || s ==  TransactionState.COMMITTED) {
            txnhome = translist.getRemoteTransactionHomeBroker(tid);
        }
        ClusterTxnInfoInfo ii = ClusterTxnInfoInfo.newInstance(new Long(tid.longValue()),
                 s, null, null, (txnhome == null)? null:txnhome.getBrokerAddress(), false, c, xid);
        if (DEBUG_CLUSTER_TXN) {
            logger.log(logger.INFO,
            Globals.getBrokerResources().getString(BrokerResources.I_SEND_REMOTE_TXN_INFO, to, ii.toString()));
        }
        try {
View Full Code Here

TOP

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

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.