Examples of DestinationFilter


Examples of org.apache.activemq.filter.DestinationFilter

          } else {
            return configuration.isBridgeTempDestinations();
          }
        }

        final DestinationFilter filter = DestinationFilter.parseFilter(destination);
       
        ActiveMQDestination[] dests = excludedDestinations;
        if (dests != null && dests.length > 0) {
            for (int i = 0; i < dests.length; i++) {
                DestinationFilter exclusionFilter = filter;
                ActiveMQDestination match = dests[i];
                if (exclusionFilter instanceof org.apache.activemq.filter.SimpleDestinationFilter) {
                    DestinationFilter newFilter = DestinationFilter.parseFilter(match);
                    if (!(newFilter instanceof org.apache.activemq.filter.SimpleDestinationFilter)) {
                        exclusionFilter = newFilter;
                        match = destination;
                    }
                }
                if (match != null && exclusionFilter.matches(match) && dests[i].getDestinationType() == destination.getDestinationType()) {
                    return false;
                }
            }
        }
        dests = dynamicallyIncludedDestinations;
        if (dests != null && dests.length > 0) {
            for (int i = 0; i < dests.length; i++) {
                DestinationFilter inclusionFilter = filter;
                ActiveMQDestination match = dests[i];
                if (inclusionFilter instanceof org.apache.activemq.filter.SimpleDestinationFilter) {
                    DestinationFilter newFilter = DestinationFilter.parseFilter(match);
                    if (!(newFilter instanceof org.apache.activemq.filter.SimpleDestinationFilter)) {
                        inclusionFilter = newFilter;
                        match = destination;
                    }
                }
View Full Code Here

Examples of org.apache.activemq.filter.DestinationFilter

    protected boolean addToAlreadyInterestedConsumers(ConsumerInfo info) {
        // search through existing subscriptions and see if we have a match
        boolean matched = false;
        for (Iterator i = subscriptionMapByLocalId.values().iterator(); i.hasNext();) {
            DemandSubscription ds = (DemandSubscription)i.next();
            DestinationFilter filter = DestinationFilter.parseFilter(ds.getLocalInfo().getDestination());
            if (filter.matches(info.getDestination())) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug(configuration.getBrokerName() + " matched (add interest) to exsting sub for: " + ds.getRemoteInfo()
                            + " with sub: " + info);
                }
                // add the interest in the subscription
View Full Code Here

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

Examples of org.apache.activemq.filter.DestinationFilter

     * @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

Examples of org.apache.activemq.filter.DestinationFilter

        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

Examples of org.apache.activemq.filter.DestinationFilter

        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

Examples of org.apache.activemq.filter.DestinationFilter

        }

        ActiveMQDestination[] dests = staticallyIncludedDestinations;
        if (dests != null && dests.length > 0) {
            for (ActiveMQDestination dest : dests) {
                DestinationFilter inclusionFilter = DestinationFilter.parseFilter(dest);
                if (dest != null && inclusionFilter.matches(destination) && dest.getDestinationType() == destination.getDestinationType()) {
                    return true;
                }
            }
        }

        dests = excludedDestinations;
        if (dests != null && dests.length > 0) {
            for (ActiveMQDestination dest : dests) {
                DestinationFilter exclusionFilter = DestinationFilter.parseFilter(dest);
                if (dest != null && exclusionFilter.matches(destination) && dest.getDestinationType() == destination.getDestinationType()) {
                    return false;
                }
            }
        }

        dests = dynamicallyIncludedDestinations;
        if (dests != null && dests.length > 0) {
            for (ActiveMQDestination dest : dests) {
                DestinationFilter inclusionFilter = DestinationFilter.parseFilter(dest);
                if (dest != null && inclusionFilter.matches(destination) && dest.getDestinationType() == destination.getDestinationType()) {
                    return true;
                }
            }

            return false;
View Full Code Here

Examples of org.apache.activemq.filter.DestinationFilter

    protected boolean addToAlreadyInterestedConsumers(ConsumerInfo info) {
        // search through existing subscriptions and see if we have a match
        boolean matched = false;

        for (DemandSubscription ds : subscriptionMapByLocalId.values()) {
            DestinationFilter filter = DestinationFilter.parseFilter(ds.getLocalInfo().getDestination());
            if (filter.matches(info.getDestination())) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug(configuration.getBrokerName() + " matched (add interest) to exsting sub for: " +
                              ds.getRemoteInfo() + " with sub: " + info.getConsumerId());
                }
                // add the interest in the subscription
View Full Code Here

Examples of org.apache.activemq.filter.DestinationFilter

    }
   

    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

Examples of org.apache.activemq.filter.DestinationFilter

        }

        ActiveMQDestination[] dests = staticallyIncludedDestinations;
        if (dests != null && dests.length > 0) {
            for (ActiveMQDestination dest : dests) {
                DestinationFilter inclusionFilter = DestinationFilter.parseFilter(dest);
                if (dest != null && inclusionFilter.matches(destination) && dest.getDestinationType() == destination.getDestinationType()) {
                    return true;
                }
            }
        }

        dests = excludedDestinations;
        if (dests != null && dests.length > 0) {
            for (ActiveMQDestination dest : dests) {
                DestinationFilter exclusionFilter = DestinationFilter.parseFilter(dest);
                if (dest != null && exclusionFilter.matches(destination) && dest.getDestinationType() == destination.getDestinationType()) {
                    return false;
                }
            }
        }

        dests = dynamicallyIncludedDestinations;
        if (dests != null && dests.length > 0) {
            for (ActiveMQDestination dest : dests) {
                DestinationFilter inclusionFilter = DestinationFilter.parseFilter(dest);
                if (dest != null && inclusionFilter.matches(destination) && dest.getDestinationType() == destination.getDestinationType()) {
                    return true;
                }
            }

            return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.