Package org.apache.activemq.filter

Examples of org.apache.activemq.filter.DestinationFilter


    }

    protected void startVirtualConsumerDestinations() throws Exception {
        ConnectionContext adminConnectionContext = getAdminConnectionContext();
        Set<ActiveMQDestination> destinations = destinationFactory.getDestinations();
        DestinationFilter filter = getVirtualTopicConsumerDestinationFilter();
        if (!destinations.isEmpty()) {
            for (ActiveMQDestination destination : destinations) {
                if (filter.matches(destination) == true) {
                    broker.addDestination(adminConnectionContext, destination, false);
                }
            }
        }
    }
View Full Code Here


        String subscriberName = DURABLE_SUB_PREFIX + configuration.getBrokerName() + "_" + dest.getPhysicalName();
        return subscriberName;
    }

    protected boolean doesConsumerExist(ActiveMQDestination dest) {
        DestinationFilter filter = DestinationFilter.parseFilter(dest);
        for (DemandSubscription ds : subscriptionMapByLocalId.values()) {
            if (filter.matches(ds.getLocalInfo().getDestination())) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

    }

    public Message[] browse(ActiveMQDestination destination) throws Exception {
        List<Message> result = new ArrayList<Message>();
        ArrayList<TimestampWrapper> copy = new ArrayList<TimestampWrapper>(buffer);
        DestinationFilter filter = DestinationFilter.parseFilter(destination);
        for (Iterator<TimestampWrapper> iter = copy.iterator(); iter.hasNext();) {
            TimestampWrapper timestampWrapper = iter.next();
            MessageReference ref = timestampWrapper.message;
            Message message = ref.getMessage();
            if (filter.matches(message.getDestination())) {
                result.add(message);
            }
        }
        return result.toArray(new Message[result.size()]);
    }
View Full Code Here

        return getList();
    }

    public Message[] browse(ActiveMQDestination destination) {
        List<Message> result = new ArrayList<Message>();
        DestinationFilter filter = DestinationFilter.parseFilter(destination);
        synchronized (lock) {
            for (Iterator<MessageReference> i = list.iterator(); i.hasNext();) {
                MessageReference ref = i.next();
                Message msg;
                msg = ref.getMessage();
                if (filter.matches(msg.getDestination())) {
                    result.add(msg);
                }

            }
        }
View Full Code Here

    }

    public Message[] browse(ActiveMQDestination destination) throws Exception {
        final List<Message> result = new ArrayList<Message>();
        if (retainedMessage != null) {
            DestinationFilter filter = DestinationFilter.parseFilter(destination);
            if (filter.matches(retainedMessage.getMessage().getDestination())) {
                result.add(retainedMessage.getMessage());
            }
        }
        Message[] messages = result.toArray(new Message[result.size()]);
        if (wrapped != null) {
View Full Code Here

    }

    public Message[] browse(ActiveMQDestination destination) throws Exception {
        List<Message> result = new ArrayList<Message>();
        if (lastImage != null) {
            DestinationFilter filter = DestinationFilter.parseFilter(destination);
            if (filter.matches(lastImage.getMessage().getDestination())) {
                result.add(lastImage.getMessage());
            }
        }
        return result.toArray(new Message[result.size()]);
    }
View Full Code Here

        this.maximumSize = maximumSize;
    }

    public synchronized Message[] browse(ActiveMQDestination destination) throws Exception {
        List<Message> result = new ArrayList<Message>();
        DestinationFilter filter = DestinationFilter.parseFilter(destination);
        int t = tail;
        if (messages[t] == null) {
            t = 0;
        }
        if (messages[t] != null) {
            do {
                MessageReference ref = messages[t];
                Message message = ref.getMessage();
                if (filter.matches(message.getDestination())) {
                    result.add(message);
                }
                t++;
                if (t >= messages.length) {
                    t = 0;
View Full Code Here

    }
   

    public void create(Broker broker, ConnectionContext context, ActiveMQDestination destination) throws Exception {
        if (destination.isQueue() && destination.isPattern() && broker.getDestinations(destination).isEmpty()) {
            DestinationFilter filter = DestinationFilter.parseFilter(new ActiveMQQueue(prefix + DestinationFilter.ANY_DESCENDENT));
            if (filter.matches(destination)) {
                broker.addDestination(context, destination, false);
            }
        }
    }
View Full Code Here

     * @param destination the destination to compare against
     * @return true if this subscription matches the given destination
     */
    public boolean matchesDestination(ActiveMQDestination destination) {
        ActiveMQDestination subscriptionDestination = subscription.getActiveMQDestination();
        DestinationFilter filter = DestinationFilter.parseFilter(subscriptionDestination);
        return filter.matches(destination);
    }
View Full Code Here

        return getList();
    }

    public Message[] browse(ActiveMQDestination destination) {
        List<Message> result = new ArrayList<Message>();
        DestinationFilter filter = DestinationFilter.parseFilter(destination);
        synchronized (lock) {
            for (Iterator<MessageReference> i = list.iterator(); i.hasNext();) {
                MessageReference ref = i.next();
                Message msg;
                try {
                    msg = ref.getMessage();
                    if (filter.matches(msg.getDestination())) {
                        result.add(msg);
                    }
                } catch (IOException e) {
                    LOG.error("Failed to get Message from MessageReference: " + ref, e);
                }
View Full Code Here

TOP

Related Classes of org.apache.activemq.filter.DestinationFilter

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.