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

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


                            hasconsumer = true;
                            Iterator itrr = d.getAllActiveConsumers().iterator();
                            while (itrr.hasNext()) {
                                Consumer c = (Consumer)itrr.next();
                                IMQConnection conn = (IMQConnection)cm.getConnection(c.getConnectionUID());
                                BrokerAddress ba = c.getConsumerUID().getBrokerAddress();
                                if ((conn != null && conn.isConnectionStarted()) ||
                                     (ba != null && ba != Globals.getMyAddress())) {
                                    notifications.put(d.getDestinationUID(),
                                                      new ConsumerInfoNotification(
                                                      d.getDestinationUID(),
                                                      d.getType(), CONSUMER_READY,
                                                      ((ConsumerInfoRequestEvent)o).infoType, true));
                                    notifyadded = true;
                                    break;
                                }
                            }
                            break;
                        }
                        if (e.duid.isWildcard() && DestinationUID.match(d.getDestinationUID(), e.duid)) {
                            foundmatch = true;
                            if (d.getAllActiveConsumerCount() == 0) {
                                continue;
                            }
                            hasconsumer = true;
                            Iterator itrr = d.getAllActiveConsumers().iterator();
                            while (itrr.hasNext()) {
                                Consumer c = (Consumer)itrr.next();
                                IMQConnection conn = (IMQConnection)cm.getConnection(c.getConnectionUID());
                                BrokerAddress ba = c.getConsumerUID().getBrokerAddress();
                                if ((conn != null && conn.isConnectionStarted()) ||
                                     (ba != null && ba != Globals.getMyAddress())) {
                                    notifications.put(d.getDestinationUID(),
                                                  new ConsumerInfoNotification(
                                                  d.getDestinationUID(),
View Full Code Here


                            logger.logStack((DEBUG_CLUSTER_TXN ? Logger.WARNING:Logger.DEBUG),
                                            "Unable to cleanup orphaned remote message "+
                                            "[" + cid + "," + sid + "," + sysid+"]"+
                                            " on rollback transaction " +id, ex);
                        }
                        BrokerAddress addr = translist.getAckBrokerAddress(id, sysid, cid);
                        try {
                            HashMap prop = new HashMap();
                            prop.put(ClusterBroadcast.RB_RELEASE_MSG_ORPHAN, id.toString());
                            Globals.getClusterBroadcast().acknowledgeMessage(
                                                          addr, sysid, cid,
View Full Code Here

                        logger.logStack((DEBUG_CLUSTER_TXN ? Logger.WARNING:Logger.DEBUG),
                                        "Unable to cleanup remote message "+
                                        "[" + intid + "," + storedID + "," + sysid+"]"+
                                        " on rollback transaction " +tid+" for inactive consumer.", ex);
                    }
                    BrokerAddress addr = null;
                    if (tid != null && translist != null) {
                        addr = translist.getAckBrokerAddress(tid, sysid, intid);
                    } else {
                        addr = ref.getAddress();
                    }
View Full Code Here

                for (int i = 0; i < bas.length; i++) {
                    buf.append("\n\t"+bas[i]);
                }
                logger.log(logger.INFO, buf.toString());
            }
            BrokerAddress addr =  null;
            for (int i = 0; i < bas.length; i++) {
                if (bas[i].getBrokerAddress() == Globals.getMyAddress()) continue;
                addr = bas[i].getCurrentBrokerAddress();
                if (addr == Globals.getMyAddress()) {
                    if (DEBUG_CLUSTER_TXN) {
View Full Code Here

      if (ref == null) {
                throw new BrokerException(
                Globals.getBrokerResources().getKString(
                BrokerResources.X_MESSAGE_REF_GONE, sysid)+", TUID="+id, Status.CONFLICT);
            }
            BrokerAddress ba = ref.getAddress();
            if (ba == null) ba = Globals.getMyAddress();
            if (ba != Globals.getMyAddress() && !hasRemote) {
                hasRemote = true;
                if (checkOnly) return new HashMap();
            }
View Full Code Here

    private boolean checkRefRequeued(TransactionUID id,
                    PacketReference ref, SysMessageID sysid)
                    throws BrokerException {
        HashMap addrmap = translist.retrieveAckBrokerAddresses(id);
        BrokerAddress oldAddr = (BrokerAddress)addrmap.get(sysid);
        if (ref == null && Destination.isLocked(sysid)) {
        logger.log(logger.WARNING, "Message "+sysid+
        ((oldAddr==null)? "":" ("+oldAddr+")")+" is in takeover, TUID="+id);
        return true;
        }
        if (ref == null) {
        logger.log(logger.WARNING,
        Globals.getBrokerResources().getKString(
                BrokerResources.X_MESSAGE_REF_GONE, sysid)+
                " "+((oldAddr==null)? "":" ("+oldAddr+")")+", TUID="+id);
        return false;
        }
        if (ref.isOverrided()) return true;

        BrokerAddress currAddr = ref.getAddress();
        if (oldAddr == null && currAddr == null) return false;
        if ((oldAddr == null && currAddr != null) ||
            (oldAddr != null && currAddr == null)) return true;
        if (!oldAddr.equals(currAddr)) return true;
        UID oldUID = oldAddr.getBrokerSessionUID();
        UID currUID = currAddr.getBrokerSessionUID();
        if (oldUID == null || currUID == null) return false;
        if (!oldUID.equals(currUID)) return true;
        return false;
    }
View Full Code Here

      if (brokers != null)  {
    for  (int i = 0; i < brokers.length; ++i)  {
              TransactionBroker oneBroker = brokers[i];
       
        BrokerAddress addr = oneBroker.getBrokerAddress();

        if (allBrokers.length() != 0)  {
            allBrokers += ", ";
        }
        allBrokers += addr.toString();

        if (oneBroker.isCompleted())  {
      continue;
        }

        if (pendingBrokers.length() != 0)  {
            pendingBrokers += ", ";
        }
        pendingBrokers += addr.toString();
    }
      }

      table.put("allbrokers", allBrokers);
      table.put("pendingbrokers", pendingBrokers);
View Full Code Here

         * very wrong with the configuration. Log an
         * error and stop talking to that broker (i.e.
         * kill this BrokerLink).
         */
        try {
            BrokerAddress mymaster = cl.getConfigServer();
            BrokerAddress remotemaster = li.getConfigServer();
           
            if (((mymaster == null || remotemaster == null) &&
                 mymaster != remotemaster)
                 ||
                ((mymaster != null && remotemaster != null) &&
                 !(mymaster.getMQAddress().equals(
                                        remotemaster.getMQAddress())))) {

                String[] args = new String[] { b.toString(),
                    (mymaster == null ? "null":mymaster.getMQAddress().toString()),
                    (remotemaster == null ? "null":remotemaster.getMQAddress().toString()) };
                logger.log(Logger.ERROR, br.getKString(
                           BrokerResources.E_MBUS_CONFIG_MISMATCH1, args));

                if (l == nulls.close(); else l.shutdown();
                return null;
View Full Code Here

    }

    public synchronized void setAckBrokerAddress(SysMessageID sysid,
        ConsumerUID id, BrokerAddress addr) throws BrokerException {

        BrokerAddress ba = (BrokerAddress)sysidToAddr.get(sysid);
        if (ba != null && (!ba.equals(addr) ||
            !ba.getBrokerSessionUID().equals(addr.getBrokerSessionUID()))) {
            BrokerException bex = new BrokerException(
                "Message requeued:"+sysid, Status.GONE);
            bex.setRemoteConsumerUIDs(String.valueOf(id.longValue()));
            bex.setRemote(true);
            throw bex;
View Full Code Here

    public synchronized TransactionBroker getClusterTransactionBroker(
        BrokerAddress b) {

        if (brokers == null) return null;
        BrokerAddress ba = null;
        for (int i = 0; i < brokers.length; i++) {
            ba = brokers[i].getCurrentBrokerAddress();
            if (ba == null) continue;
            if (ba.equals(b)) return brokers[i];
        }
        return 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.