Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.ActiveMQDestination


    }

    boolean matchProducer(ConsumerInfo advisory, ProducerInfo info) {
        boolean result = false;
        if (advisory != null && advisory.getDestination() != null && info != null && info.getDestination() != null) {
            ActiveMQDestination advisoryDestination = advisory.getDestination();
            ActiveMQDestination destination = info.getDestination();
            if (advisoryDestination.isProducerAdvisory()) {
                String pyhsicalName = advisory.getDestination().getPhysicalName();
                String matchName = pyhsicalName.substring(ActiveMQDestination.PRODUCER_ADVISORY_PREFIX.length(),
                        pyhsicalName.length());
                ActiveMQDestination match = ActiveMQDestination.createDestination(advisoryDestination
                        .getDestinationType(), matchName);
                return match.matches(destination) || matchGeneralAdvisory(advisory, destination);
            }
        }
        return result;
    }
View Full Code Here


        boolean result = advisory.getDestination() != null && advisory.getDestination().isAdvisory();
        if (result) {
            String pyhsicalName = advisory.getDestination().getPhysicalName();
            String matchName = pyhsicalName.substring(ActiveMQDestination.ADVISORY_PREFIX.length(), pyhsicalName
                    .length());
            ActiveMQDestination match = ActiveMQDestination.createDestination(advisory.getDestination()
                    .getDestinationType(), matchName);
            result = match.matches(destination);
        }
        return result;
    }
View Full Code Here

     * @param client
     * @param message
     * @throws javax.jms.JMSException
     */
    public void sendMessage(BrokerClient client, ActiveMQMessage message) throws JMSException {
        ActiveMQDestination dest = (ActiveMQDestination) message.getJMSDestination();
        if (dest != null && dest.isTopic() && message.getJMSDeliveryMode() == DeliveryMode.PERSISTENT) {
            MessageContainer container = getContainer(message.getJMSDestination().toString());

            // TODO note if we don't have any durable subscriptions then we might back up here
            container.addMessage(message);
            for (Iterator i = subscriptionContainer.subscriptionIterator(); i.hasNext();) {
View Full Code Here

     * @param client
     * @param message
     * @throws javax.jms.JMSException
     */
    public void sendMessage(BrokerClient client, ActiveMQMessage message) throws JMSException {
        ActiveMQDestination dest = (ActiveMQDestination) message.getJMSDestination();
        if (dest != null && dest.isTopic()) {
            MessageContainer container = null;
            if (log.isDebugEnabled()) {
                log.debug("Dispaching to " + subscriptionContainer + " subscriptions with message: " + message);
            }
            for (Iterator i = subscriptionContainer.subscriptionIterator(); i.hasNext();) {
View Full Code Here

     * @param client
     * @param message
     * @throws javax.jms.JMSException
     */
    public void sendMessage(BrokerClient client, ActiveMQMessage message) throws JMSException {
        ActiveMQDestination dest = (ActiveMQDestination) message.getJMSDestination();
        if (dest != null && dest.isQueue()) {
            if (log.isDebugEnabled()) {
                log.debug("Dispaching message: " + message);
            }
            QueueMessageContainer container = (QueueMessageContainer) getContainer(((ActiveMQDestination) message.getJMSDestination())
                    .getPhysicalName());
View Full Code Here

    public void addMessageConsumer(BrokerClient client, ConsumerInfo info) throws JMSException {
        super.addMessageConsumer(client, info);

        // lookup message for destination
        ActiveMQDestination destination = info.getDestination();
        if (isValid(destination)) {
            if (destination.isWildcard()) {
                DestinationFilter filter = DestinationFilter.parseFilter(destination);
                sendMatchingInitialImages(client, info, filter);
            }
            else {
                ActiveMQMessage message = null;
View Full Code Here

            }
        }
    }

    public void sendMessage(BrokerClient client, ActiveMQMessage message) throws JMSException {
        ActiveMQDestination destination = message.getJMSActiveMQDestination();
        if (isValid(destination)) {
            cache.put(destination, message);
        }
        super.sendMessage(client, message);
    }
View Full Code Here

     * @param info
     * @throws JMSException
     * @throws JMSSecurityException if client authentication fails for the Destination the Consumer applies for
     */
    public void registerMessageProducer(BrokerClient client, ProducerInfo info) throws JMSException {
        ActiveMQDestination dest = info.getDestination();
        if (dest != null && dest.isTemporary()) {
            //check to see if the client that is the target for the temporary destination still exists
            String clientId = ActiveMQDestination.getClientId(dest);
            if (clientId == null) {
                throw new InvalidDestinationException("Destination " + dest.getPhysicalName()
                        + " is a temporary destination with null clientId");
            }
            if (!clientIds.containsKey(clientId)) {
                throw new InvalidDestinationException("Destination " + dest.getPhysicalName()
                        + " is no longer valid because the client " + clientId + " no longer exists");
            }
        }
        producerInfos.put(info, client);
    }
View Full Code Here

     * @param client
     * @param message
     * @throws javax.jms.JMSException
     */
    public void sendMessage(final BrokerClient client, final ActiveMQMessage message) throws JMSException {
        ActiveMQDestination dest = (ActiveMQDestination) message.getJMSDestination();
        if (dest != null && dest.isTopic() && message.getJMSDeliveryMode() == DeliveryMode.PERSISTENT) {
            Set containers = destinationMap.get(dest);
            if (containers != null && !containers.isEmpty()) {
                // note that we still need to persist the message even if there are no matching
                // subscribers as they may come along later
                // plus we don't pre-load subscription information
View Full Code Here

    public Map getLocalDestinations() {
        Map localDestinations = new HashMap();
        for (Iterator iter = subscriptionContainer.subscriptionIterator(); iter.hasNext();) {
            Subscription sub = (Subscription) iter.next();
            if (sub.isLocalSubscription()) {
                final ActiveMQDestination dest = sub.getDestination();
                localDestinations.put(dest.getPhysicalName(), dest);
            }
        }
        return Collections.unmodifiableMap(localDestinations);
    }
View Full Code Here

TOP

Related Classes of org.codehaus.activemq.message.ActiveMQDestination

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.