Package com.sun.messaging.jmq.jmsserver.multibroker

Examples of com.sun.messaging.jmq.jmsserver.multibroker.BrokerInfo


            conn.close();
            return;
        }

        BrokerInfo bi = (BrokerInfo)parent.receivePacket(remote, p, getRealRemoteString(), this);
        if (bi == null) {
            logger.log(logger.DEBUG, "Link = " + this + ", BROKER_INFO rejected");
            throw new IOException("BrokerInfo rejected");
        }

        expectBrokerInfoPkt = false;

        Integer v = bi.getClusterProtocolVersion();
        if (v != null && v.intValue() >= ProtocolGlobals.VERSION_400) {
            com.sun.messaging.jmq.jmsserver.core.BrokerAddress configServer = null;
            try {
                configServer = parent.getConfigServer();
            } catch (Exception e) {
                conn.close();
                logger.log(logger.DEBUG,
                "Exception in getConfigServer: "+e.getMessage()+", link "+this);
                return;
            }
            if (parent.waitForConfigSync() &&
                !configServer.equals(bi.getBrokerAddr())) {
                if (ClusterManagerImpl.DEBUG_CLUSTER_CONN || ClusterManagerImpl.DEBUG_CLUSTER_PACKET || DEBUG) {
                logger.log(logger.INFO, "Waiting for sync with master broker "+configServer+", Please retry  "+this);
                }
                conn.close();
                return;
View Full Code Here


                res.brokerRemoved(broker);
            }
        }

        if (brokerInfoEx == null) return;
        BrokerInfo brokerInfo = brokerInfoEx.getBrokerInfo();

        try {

        if (brokerInfoEx.getBrokerInfo().getBrokerAddr().getHAEnabled()) {
           Globals.getClusterManager().deactivateBroker(
                   brokerInfo.getBrokerAddr().getBrokerID(),
                   brokerInfo.getBrokerAddr().getBrokerSessionUID());
        } else {
           Globals.getClusterManager().deactivateBroker(
                   brokerInfo.getBrokerAddr().getMQAddress(),
                   brokerInfo.getBrokerAddr().getBrokerSessionUID());
        }
        logger.log(Logger.INFO, br.getKString(br.I_CLUSTER_DEACTIVATED_BROKER, brokerInfo));

        } catch (NoSuchElementException e) { /* Ignore */
        if (DEBUG) {
View Full Code Here

    /**
     * Construct the Packet.BROKER_INFO packet.
     */
    protected Packet getBrokerInfoPkt() {
        // Get the BrokerInfo object from MessageBus...
        BrokerInfo selfInfo = cb.getBrokerInfo();

        ByteArrayOutputStream bos = new ByteArrayOutputStream();

        try {
            ObjectOutputStream oos = new ObjectOutputStream(bos);
View Full Code Here

    /**
     * Receive and process the BROKER_INFO packet.
     */
    private BrokerInfo receiveBrokerInfo(BrokerAddressImpl sender, byte[] pkt, String realRemote, BrokerLink l) {
        ByteArrayInputStream bis = new ByteArrayInputStream(pkt);
        BrokerInfo info = null;

        try {
            ObjectInputStream ois = new ObjectInputStream(bis);
            info = (BrokerInfo) ois.readObject();
            info.setRealRemoteString(realRemote);
        }
        catch (Exception e) {
            logger.log(Logger.WARNING, br.W_MBUS_SERIALIZATION, sender);

            if (l != null) l.shutdown();
            return null;
        }

        Integer v = info.getClusterProtocolVersion();
        if (v != null && v.intValue() >= ProtocolGlobals.VERSION_400) return info;

        if (l != null) l.handshakeSent();

        int status = cb.addBrokerInfo(info);
View Full Code Here

        return null;

    }

    private void receiveBrokerInfoReply(BrokerAddressImpl sender, GPacket gp, String realRemote) {
        BrokerInfo info = null;
        try {
            ClusterBrokerInfoReply cbi = ClusterBrokerInfoReply.newInstance(gp);
            info = cbi.getBrokerInfo();
            info.setRealRemoteString(realRemote);
            if (DEBUG) {
            logger.log(Logger.DEBUG, "Received BROKER_INFO_REPLY from "+sender);
            }
            if (!info.getBrokerAddr().equals(sender)) {
                logger.log(Logger.ERROR, BrokerResources.E_INTERNAL_BROKER_ERROR,
                       "mismatched BROKER_INFO ("+info.getBrokerAddr()+") from "+sender);
                throw new BrokerException("mismatched BROKER_INFO");
            }
            if (Globals.getHAEnabled() && cbi.isTakingover()) {
                String msg = br.getKString(BrokerResources.E_CLUSTER_TAKINGOVER_NOTIFY_RESTART, sender);
                BrokerException ex = new BrokerException(msg);
View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.jmsserver.multibroker.BrokerInfo

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.