Package org.apache.activemq.command

Examples of org.apache.activemq.command.BrokerInfo


        return new JMSException("Unknown destination type: " + destination.getDestinationType());
    }

    @Override
    public synchronized void addBroker(Connection connection, BrokerInfo info) {
        BrokerInfo existing = brokerInfos.get(info.getBrokerId());
        if (existing == null) {
            existing = info.copy();
            existing.setPeerBrokerInfos(null);
            brokerInfos.put(info.getBrokerId(), existing);
        }
        existing.incrementRefCount();
        LOG.debug("{} addBroker: {} brokerInfo size: {}", new Object[]{ getBrokerName(), info.getBrokerName(), brokerInfos.size() });
        addBrokerInClusterUpdate(info);
    }
View Full Code Here


    }

    @Override
    public synchronized void removeBroker(Connection connection, BrokerInfo info) {
        if (info != null) {
            BrokerInfo existing = brokerInfos.get(info.getBrokerId());
            if (existing != null && existing.decrementRefCount() == 0) {
                brokerInfos.remove(info.getBrokerId());
            }
            LOG.debug("{} removeBroker: {} brokerInfo size: {}", new Object[]{ getBrokerName(), info.getBrokerName(), brokerInfos.size()});
            // When stopping don't send cluster updates since we are the one's tearing down
            // our own bridges.
View Full Code Here

            }

            // Replay network bridges
            if (AdvisorySupport.isNetworkBridgeAdvisoryTopic(info.getDestination())) {
                for (Iterator<BrokerInfo> iter = networkBridges.keySet().iterator(); iter.hasNext(); ) {
                    BrokerInfo key = iter.next();
                    ActiveMQTopic topic = AdvisorySupport.getNetworkBridgeAdvisoryTopic();
                    fireAdvisory(context, topic, key, null, networkBridges.get(key));
                }
            }
        }
View Full Code Here

    public void oneway(Object object) throws IOException {
        if (object instanceof Command) {
            Command command = (Command)object;

            if (command instanceof BrokerInfo) {
                BrokerInfo brokerInfo = (BrokerInfo)command;

                brokerId = brokerInfo.getBrokerId().toString();
                from = brokerInfo.getBrokerName();
                try {
                    writeOpenStream(brokerId, from);
                } catch (XMLStreamException e) {
                    throw IOExceptionSupport.create(e);
                }
View Full Code Here

        super(configuration, localBroker, remoteBroker);
    }

    protected void serviceRemoteBrokerInfo(Command command) throws IOException {
        synchronized (brokerInfoMutex) {
            BrokerInfo remoteBrokerInfo = (BrokerInfo)command;
            remoteBrokerId = remoteBrokerInfo.getBrokerId();
            remoteBrokerPath[0] = remoteBrokerId;
            remoteBrokerName = remoteBrokerInfo.getBrokerName();
            if (localBrokerId != null) {
                if (localBrokerId.equals(remoteBrokerId)) {
                    if (LOG.isTraceEnabled()) {
                        LOG.trace(configuration.getBrokerName() + " disconnecting remote loop back connection: " + remoteBrokerName);
                    }
View Full Code Here

        remoteBrokerNameKnownLatch.countDown();
    }

    protected void serviceRemoteBrokerInfo(Command command) throws IOException {
        synchronized (brokerInfoMutex) {
            BrokerInfo remoteBrokerInfo = (BrokerInfo)command;
            BrokerId remoteBrokerId = remoteBrokerInfo.getBrokerId();

            // lets associate the incoming endpoint with a broker ID so we can
            // refer to it later
            Endpoint from = command.getFrom();
            if (from == null) {
View Full Code Here

     * @deprecated use the {@link #setBrokerService(BrokerService)} method instead.
     */
    @Deprecated
    public void setBrokerName(String name) {
        if (this.brokerInfo==null) {
            this.brokerInfo=new BrokerInfo();
        }
        this.brokerInfo.setBrokerName(name);
    }
View Full Code Here

            if (LOG.isTraceEnabled()) {
                LOG.trace(configuration.getBrokerName() + " starting remote Bridge, localBroker=" + localBroker);
            }
            synchronized (this) {
                if (!isCreatedByDuplex()) {
                    BrokerInfo brokerInfo = new BrokerInfo();
                    brokerInfo.setBrokerName(configuration.getBrokerName());
                    brokerInfo.setNetworkConnection(true);
                    brokerInfo.setDuplexConnection(configuration.isDuplex());
                    // set our properties
                    Properties props = new Properties();
                    IntrospectionSupport.getProperties(configuration, props, null);
                    String str = MarshallingSupport.propertiesToString(props);
                    brokerInfo.setNetworkProperties(str);
                    brokerInfo.setBrokerId(this.localBrokerId);
                    remoteBroker.oneway(brokerInfo);
                }
                if (remoteConnectionInfo != null) {
                    remoteBroker.oneway(remoteConnectionInfo.createRemoveCommand());
                }
View Full Code Here

public class BrokerInfoTest extends BaseCommandTestSupport {

    public static final BrokerInfoTest SINGLETON = new BrokerInfoTest();

    public Object createObject() throws Exception {
        BrokerInfo info = new BrokerInfo();
        populateObject(info);
        return info;
    }
View Full Code Here

        return info;
    }

    protected void populateObject(Object object) throws Exception {
        super.populateObject(object);
        BrokerInfo info = (BrokerInfo)object;

        info.setBrokerId(createBrokerId("BrokerId:1"));
        info.setBrokerURL("BrokerURL:2");
        {
            BrokerInfo value[] = new BrokerInfo[0];
            for (int i = 0; i < 0; i++) {
                value[i] = createBrokerInfo("PeerBrokerInfos:3");
            }
            info.setPeerBrokerInfos(value);
        }
View Full Code Here

TOP

Related Classes of org.apache.activemq.command.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.