Package com.sun.messaging.jmq.jmsserver.core

Examples of com.sun.messaging.jmq.jmsserver.core.BrokerAddress


        if (ts == null || ts.getState() != TransactionState.ROLLEDBACK) {
            throw new BrokerException(Globals.getBrokerResources().E_INTERNAL_BROKER_ERROR,
            "Unexpected broker state "+ts+ " for processing Rolledback remote transaction "+tid);
        }
        TransactionBroker ba = translist.getRemoteTransactionHomeBroker(tid);
        BrokerAddress currba = (ba == null) ? null: ba.getCurrentBrokerAddress();
        if (currba == null || !currba.equals(from)) {
            logger.log(logger.WARNING, "Rolledback remote transaction "+tid+" home broker "+ba+ " not "+from);
        }
        RemoteTransactionAckEntry[] tae = translist.getRecoveryRemoteTransactionAcks(tid);
        if (tae == null) {
            logger.log(logger.WARNING,
View Full Code Here


                 throws BrokerException {
        logger.log(logger.INFO,"Committing recovery remote transaction " + tid + " from "+from);

        TransactionList translist = Globals.getTransactionList();
        TransactionBroker ba = translist.getRemoteTransactionHomeBroker(tid);
        BrokerAddress currba = (ba == null) ? null: ba.getCurrentBrokerAddress();
        if (currba == null || !currba.equals(from)) {
            logger.log(logger.WARNING, "Committed remote transaction "+tid+" home broker "+ba+ " not "+from);
        }
        RemoteTransactionAckEntry[] tae = translist.getRecoveryRemoteTransactionAcks(tid);
        if (tae == null) {
            logger.log(logger.WARNING,
View Full Code Here

        }

        boolean exists = false;
        PacketReference ref = Destination.get(p.getSysMessageID());
        if (ref != null) {
            BrokerAddress addr = ref.getAddress();
            if (addr == null || !addr.equals(sender)) {
                if (DEBUG) {
                logger.log(Logger.INFO,
                "Remote message "+ref.getSysMessageID()+ " home broker "+addr+" changed to "+sender);
                }
                Destination.remoteCheckMessageHomeChange(ref, sender);
View Full Code Here

  boolean updateTransactionBrokerState(TransactionBroker txnBkr,
      ClusterTransaction clusterTxn) {
    TransactionBroker[] txnBrokers = clusterTxn.getTransactionBrokers();
    TransactionBroker result = null;

    BrokerAddress b = txnBkr.getBrokerAddress();
    boolean allComplete = true;
    for (int i = 0; i < txnBrokers.length; i++) {
      BrokerAddress ba = txnBrokers[i].getCurrentBrokerAddress();
      if (ba == null)
        continue;
      if (ba.equals(b))
        result = txnBrokers[i];
      else {
        allComplete &= txnBrokers[i].isCompleted();
      }
    }
View Full Code Here

     * @throws BrokerException
     */
    public BrokerAddress getTransactionHomeBroker( Connection conn,
        TransactionUID txnUID ) throws BrokerException {

        BrokerAddress txnHomeBroker = null;
        long id = txnUID.longValue();

        boolean myConn = false;
        PreparedStatement pstmt = null;
        ResultSet rs = null;
View Full Code Here

                    (TransactionState)Util.readObject( rs, 3 );

                // update state in TransactionState object
                txnState.setState( state );

                BrokerAddress txnHomeBroker =
                    (BrokerAddress)Util.readObject( rs, 4 );
                TransactionBroker[] txnBrokers =
                    (TransactionBroker[])Util.readObject( rs, 5 );

                txnInfo = new TransactionInfo( txnState, txnHomeBroker,
View Full Code Here

                }
                try {
                    TransactionBroker[] brokers = translist.getClusterTransactionBrokers(cpcTid);
                    if (brokers == null) continue;
                    boolean completed = true;
                    BrokerAddress to = null;
                    for (int j = 0; j < brokers.length; j++) {
                        if (!brokers[j].isCompleted()) {
                            completed = false;
                            to = brokers[j].getCurrentBrokerAddress();
                            if (to != null) {
                                if (to.equals(Globals.getMyAddress()) && to.equals(brokers[j].getBrokerAddress())) {
                                    try {
                                        translist.completeClusterTransactionBrokerState(cpcTid,
                                                          TransactionState.COMMITTED, to, true);
                                    } catch (Exception e) {
                                        logger.logStack(logger.WARNING,
                                        "Unable to update transaction broker state for "+to+", TUID="+cpcTid, e);
                                    }
                                    if (!Globals.getHAEnabled()) {
                                        continue;
                                    }
                                 }

                                 if (activatedBrokers.size() == 0 &&
                                     processState != null && processState == ClusterPCommittedState.PROCCESSED) {
                                    continue;
                                 }

                                 if (activatedBrokers.size() == 0 && !to.equals(Globals.getMyAddress()) &&
                                     processState != null && processState != ClusterPCommittedState.TAKEOVER) {
                                    continue;
                                 }

                                 if (activatedBrokers.size() > 0 &&
                                     !activatedBrokers.contains(to.getMQAddress()) &&
                                     !to.equals(Globals.getMyAddress()) &&
                                     processState != null && processState != ClusterPCommittedState.TAKEOVER) {
                                     continue;
                                 }

                                if (TransactionList.DEBUG_CLUSTER_TXN) {
View Full Code Here

        }
        destIds[i] = destID;
      }
      TransactionBroker txnBroker = transactionList
          .getRemoteTransactionHomeBroker(txid);
      BrokerAddress txnHomeBroker = txnBroker.getBrokerAddress();

      RemoteTransaction remoteTxn = new RemoteTransaction(txid, newState,
          txnAcks, destIds, txnHomeBroker);

      store.logTxn(remoteTxn);
View Full Code Here

                        if (c == null) continue;
                        ConsumerUID sid = c.getStoredConsumerUID();
                        if (sid == null || sid.equals(cids[i])) {
                            continue;
                        }
                        BrokerAddress ba = (ref == null ? null: ref.getAddress());
                        BrokerAddress rba = ((BrokerException)thr).getRemoteBrokerAddress();
                        if (c != null && ref != null &&
                            ba != null && rba != null && ba.equals(rba)) {
                            cidstr = String.valueOf(c.getConsumerUID().longValue());
                            if (!remoteConsumerUIDa.contains(cidstr)) {
                                remoteConsumerUIDa.add(cidstr);
View Full Code Here

                if (DEBUG) {
                logger.log(logger.INFO, "handleTransaction.addAck["+i+", "+ids.length+"]:tid="+tid+
                           ", sysid="+ids[i]+", cid="+cids[i]+", sid="+sid+" on connection "+con);
                }
                boolean isxa = translist.addAcknowledgement(tid, ids[i], cids[i], sid);
                BrokerAddress addr = s.acknowledgeInTransaction(cids[i], ids[i], tid, isxa);
                if (addr != null && addr != Globals.getMyAddress()) {
                    translist.setAckBrokerAddress(tid, ids[i], cids[i], addr);
                }
                if (fi.FAULT_INJECTION) {
                    if (fi.checkFault(fi.FAULT_TXN_ACK_1_5, null)) {
View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.jmsserver.core.BrokerAddress

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.