Package org.apache.activemq.broker.region

Examples of org.apache.activemq.broker.region.RegionBroker


       
        verifyStats(true);
    }

    private void verifyStats(boolean brokerRestarts) throws Exception {
        RegionBroker regionBroker = (RegionBroker) broker.getRegionBroker();
       
        for (Destination dest : regionBroker.getQueueRegion().getDestinationMap().values()) {
            DestinationStatistics stats = dest.getDestinationStatistics();
            if (brokerRestarts) {
                // all bets are off w.r.t stats as there may be duplicate sends and duplicate
                // dispatches, all of which will be suppressed - either by the reference store
                // not allowing duplicate references or consumers acking duplicates
View Full Code Here


    }

    @SuppressWarnings("unchecked")
    private ConcurrentHashMap<SubscriptionKey, DurableTopicSubscription> getDurableSubscriptions() throws NoSuchFieldException, IllegalAccessException {
        if(durableSubscriptions!=null) return durableSubscriptions;
        RegionBroker regionBroker=(RegionBroker)service.getRegionBroker();
        TopicRegion region=(TopicRegion)regionBroker.getTopicRegion();
        Field field=TopicRegion.class.getDeclaredField("durableSubscriptions");
        field.setAccessible(true);
        durableSubscriptions=(ConcurrentHashMap<SubscriptionKey, DurableTopicSubscription>)field.get(region);
        return durableSubscriptions;
    }
View Full Code Here

        return result;
    }

    private static Map<ActiveMQDestination, org.apache.activemq.broker.region.Destination> getDestinationMap(BrokerService target,
            ActiveMQDestination destination) {
        RegionBroker regionBroker = (RegionBroker) target.getRegionBroker();
        if (destination.isTemporary()) {
            return destination.isQueue() ? regionBroker.getTempQueueRegion().getDestinationMap() :
                    regionBroker.getTempTopicRegion().getDestinationMap();
        }
        return destination.isQueue() ?
                    regionBroker.getQueueRegion().getDestinationMap() :
                        regionBroker.getTopicRegion().getDestinationMap();
    }
View Full Code Here

        session2.close();
    }

    private boolean destinationExists(Destination dest) throws Exception {
        RegionBroker rb = (RegionBroker) embeddedBroker.getBroker().getAdaptor(RegionBroker.class);
        return rb.getTopicRegion().getDestinationMap().containsKey(dest) || rb.getQueueRegion().getDestinationMap().containsKey(dest)
                || rb.getTempTopicRegion().getDestinationMap().containsKey(dest) || rb.getTempQueueRegion().getDestinationMap().containsKey(dest);
    }
View Full Code Here

        sendConnection.close();

        LOG.info("checking for dangling temp destinations");
        // ensure all temp dests get cleaned up on all brokers
        for (BrokerService brokerService : brokers) {
            final RegionBroker regionBroker = (RegionBroker) brokerService.getRegionBroker();
            assertTrue("all temps are gone on " + regionBroker.getBrokerName(), Wait.waitFor(new Wait.Condition(){
                @Override
                public boolean isSatisified() throws Exception {
                    Map tempTopics = regionBroker.getTempTopicRegion().getDestinationMap();
                    LOG.info("temp topics on " + regionBroker.getBrokerName() + ", " + tempTopics);
                    Map tempQ = regionBroker.getTempQueueRegion().getDestinationMap();
                    LOG.info("temp queues on " + regionBroker.getBrokerName() + ", " + tempQ);
                    return tempQ.isEmpty() && tempTopics.isEmpty();
                }
            }));
        }
    }
View Full Code Here

        assertTrue(ab.getAdvisoryDestinations().size() == 0);
        assertTrue(ab.getAdvisoryConsumers().size() == 0);
        assertTrue(ab.getAdvisoryProducers().size() == 0);

        RegionBroker rb = (RegionBroker) broker.getBroker().getAdaptor(RegionBroker.class);

        for (Destination dest : rb.getDestinationMap().values()) {
            LOG.debug("Destination: {}", dest);
        }

        // there should be at least 2 destinations - advisories -
        // 1 for the connection + 1 generic ones
        assertTrue("Should be at least 2 destinations", rb.getDestinationMap().size() > 2);
    }
View Full Code Here

        AdvisoryBroker ab = (AdvisoryBroker) broker.getBroker().getAdaptor(
                AdvisoryBroker.class);
        assertTrue(ab.getAdvisoryDestinations().size() == 0);
        assertTrue(ab.getAdvisoryConsumers().size() == 0);
        assertTrue(ab.getAdvisoryProducers().size() == 0);
        RegionBroker rb = (RegionBroker) broker.getBroker().getAdaptor(
                RegionBroker.class);

        for (Destination dest : rb.getDestinationMap().values()) {
            LOG.debug("Destination: {}", dest);
        }

        // there should be at least 2 destinations - advisories -
        // 1 for the connection + 1 generic ones
        assertTrue("Should be at least 2 destinations", rb.getDestinationMap().size() > 2);
    }
View Full Code Here

        assertFalse(destinationExists(advisoryTopic));
    }

    private boolean destinationExists(Destination dest) throws Exception {
        RegionBroker rb = (RegionBroker)broker.getBroker().getAdaptor(RegionBroker.class);
        return rb.getTopicRegion().getDestinationMap().containsKey(dest) || rb.getQueueRegion().getDestinationMap().containsKey(dest)
               || rb.getTempTopicRegion().getDestinationMap().containsKey(dest) || rb.getTempQueueRegion().getDestinationMap().containsKey(dest);
    }
View Full Code Here

     */
    public TransportConnection(TransportConnector connector, final Transport transport, Broker broker,
                               TaskRunnerFactory taskRunnerFactory, TaskRunnerFactory stopTaskRunnerFactory) {
        this.connector = connector;
        this.broker = broker;
        RegionBroker rb = (RegionBroker) broker.getAdaptor(RegionBroker.class);
        brokerConnectionStates = rb.getConnectionStates();
        if (connector != null) {
            this.statistics.setParent(connector.getStatistics());
            this.messageAuthorizationPolicy = connector.getMessageAuthorizationPolicy();
        }
        this.taskRunnerFactory = taskRunnerFactory;
View Full Code Here

       
        verifyStats(true);
    }

    private void verifyStats(boolean brokerRestarts) throws Exception {
        RegionBroker regionBroker = (RegionBroker) broker.getRegionBroker();
       
        for (Destination dest : regionBroker.getQueueRegion().getDestinationMap().values()) {
            DestinationStatistics stats = dest.getDestinationStatistics();
            if (brokerRestarts) {
                // all bets are off w.r.t stats as there may be duplicate sends and duplicate
                // dispatches, all of which will be suppressed - either by the reference store
                // not allowing duplicate references or consumers acking duplicates
View Full Code Here

TOP

Related Classes of org.apache.activemq.broker.region.RegionBroker

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.