Package org.apache.activemq.broker.region

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


        connection.close();
        connection = null;
        Thread.sleep(1000);

        Destination d = broker.getDestination(topic);
        assertEquals("Subscription is missing.", 1, d.getConsumers().size());

        MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
        ObjectName[] subNames = broker.getAdminView().getInactiveDurableTopicSubscribers();
        mbs.invoke(subNames[0], "destroy", new Object[0], new String[0]);

        assertEquals("Subscription exists.", 0, d.getConsumers().size());
    }
View Full Code Here


                if (!msg.isPersistent()) {
                    nonPersistent.addMessageLast(node);
                }
            }
            if (msg.isPersistent()) {
                Destination dest = msg.getRegionDestination();
                TopicStorePrefetch tsp = topics.get(dest);
                if (tsp != null) {
                    tsp.addMessageLast(node);
                    if (prioritizedMessages && immediatePriorityDispatch && tsp.isPaging()) {
                        if (msg.getPriority() > tsp.getLastRecoveredPriority()) {
View Full Code Here

        if (node != null) {
            Message msg = node.getMessage();
            if (!msg.isPersistent()) {
                nonPersistent.addMessageFirst(node);
            } else {
                Destination dest = msg.getRegionDestination();
                TopicStorePrefetch tsp = topics.get(dest);
                if (tsp != null) {
                    tsp.addMessageFirst(node);
                }
            }
View Full Code Here

        }
    }

    @Override
    public Destination addDestination(ConnectionContext context, ActiveMQDestination destination,boolean create) throws Exception {
        Destination answer = super.addDestination(context, destination,create);
        if (!AdvisorySupport.isAdvisoryTopic(destination)) {
            DestinationInfo info = new DestinationInfo(context.getConnectionId(), DestinationInfo.ADD_OPERATION_TYPE, destination);
            DestinationInfo previous = destinations.putIfAbsent(destination, info);
            if( previous==null ) {
                ActiveMQTopic topic = AdvisorySupport.getDestinationAdvisoryTopic(destination);
View Full Code Here

                if (!msg.isPersistent()) {
                    nonPersistent.addMessageLast(node);
                }
            }
            if (msg.isPersistent()) {
                Destination dest = msg.getRegionDestination();
                TopicStorePrefetch tsp = topics.get(dest);
                if (tsp != null) {
                    // cache can become high priority cache for immediate dispatch
                    final int priority = msg.getPriority();
                    if (isStarted() && this.prioritizedMessages && immediatePriorityDispatch && !tsp.isCacheEnabled()) {
View Full Code Here

        if (node != null) {
            Message msg = node.getMessage();
            if (!msg.isPersistent()) {
                nonPersistent.addMessageFirst(node);
            } else {
                Destination dest = msg.getRegionDestination();
                TopicStorePrefetch tsp = topics.get(dest);
                if (tsp != null) {
                    tsp.addMessageFirst(node);
                }
            }
View Full Code Here

    public Destination intercept(final Destination destination) {
        if (destination.getActiveMQDestination().isQueue()) {
            if (!destination.getActiveMQDestination().isTemporary() || brokerService.isUseTempMirroredQueues()) {
                try {
                    final Destination mirrorDestination = getMirrorDestination(destination);
                    if (mirrorDestination != null) {
                        return new DestinationFilter(destination) {
                            public void send(ProducerBrokerExchange context, Message message) throws Exception {
                                message.setDestination(mirrorDestination.getActiveMQDestination());
                                mirrorDestination.send(context, message);
   
                                if (isCopyMessage()) {
                                    message = message.copy();
                                }
                                message.setDestination(destination.getActiveMQDestination());
View Full Code Here

    public synchronized Destination intercept(Destination destination) {
        Set virtualDestinations = destinationMap.get(destination.getActiveMQDestination());
        List<Destination> destinations = new ArrayList<Destination>();
        for (Iterator iter = virtualDestinations.iterator(); iter.hasNext();) {
            VirtualDestination virtualDestination = (VirtualDestination)iter.next();
            Destination newDestination = virtualDestination.intercept(destination);
            destinations.add(newDestination);
        }
        if (!destinations.isEmpty()) {
            if (destinations.size() == 1) {
                return destinations.get(0);
View Full Code Here

    protected Destination createCompositeDestination(Destination destination, final List<Destination> destinations) {
        return new DestinationFilter(destination) {
            public void send(ProducerBrokerExchange context, Message messageSend) throws Exception {
                for (Iterator<Destination> iter = destinations.iterator(); iter.hasNext();) {
                    Destination destination = iter.next();
                    destination.send(context, messageSend);
                }
            }
        };
    }
View Full Code Here

        }
    }

    @Override
    public Destination addDestination(ConnectionContext context, ActiveMQDestination destination,boolean createIfTemporary) throws Exception {
        Destination result = next.addDestination(context, destination,createIfTemporary);
        Broker brokers[] = getListeners();
        for (int i = 0; i < brokers.length; i++) {
            brokers[i].addDestination(context, destination,createIfTemporary);
        }
        return result;
View Full Code Here

TOP

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

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.