Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.ActiveMQDestination


    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


     * @param message
     * @throws javax.jms.JMSException
     */
    public void sendMessage(final BrokerClient client, final ActiveMQMessage message) throws JMSException {

        ActiveMQDestination dest = (ActiveMQDestination) message.getJMSDestination();
      // Are we not intrested in handling that destination?
        if( !isManagerFor(dest, message.getJMSDeliveryMode()==DeliveryMode.PERSISTENT) ) {
          return;
        }
       
View Full Code Here

            else {
                updateActiveSubscriptions(container, sub);
            }
        }
       
        ActiveMQDestination key = new ActiveMQQueue(destinationName);
        destinationMap.put(key, container);
        return container;
    }
View Full Code Here

    }

    private void startSubscriptions(Map destinations, boolean durableTopic) {
        if (destinations != null) {
            for (Iterator i = destinations.values().iterator();i.hasNext();) {
                ActiveMQDestination dest = (ActiveMQDestination) i.next();
                addConsumerInfo(dest, durableTopic);
            }
        }
    }
View Full Code Here

     * @param client
     * @param message
     * @throws javax.jms.JMSException
     */
    public void sendMessage(final BrokerClient client, final ActiveMQMessage message) throws JMSException {
        final ActiveMQDestination destination = message.getJMSActiveMQDestination();
        if (destination == null || !destination.isTopic()) {
            return;
        }
       
        TransactionManager.getContexTransaction().addPostCommitTask(new TransactionTask(){
            public void execute() throws Throwable {
View Full Code Here

            throw new JMSException("No messageID specified for the Message");
        }
       
        associateTransaction(message);
        try {       
          ActiveMQDestination destination = message.getJMSActiveMQDestination();
          if (destination.isComposite()) {
              boolean first = true;
 
              for (Iterator iter = destination.getChildDestinations().iterator(); iter.hasNext();) {
                  ActiveMQDestination childDestination = (ActiveMQDestination) iter.next();
 
                  // lets shallow copy just in case
                  if (first) {
                      first = false;
                  }
View Full Code Here

        if (matchConsumer(advisory, info)) {
            //find the client for ther advisory
            BrokerClient client = (BrokerClient) advisoryConsumers.get(advisory);
            String suffix = info.isStarted() ? "started" : "stopped";
            String destName = ActiveMQDestination.CONSUMER_ADVISORY_PREFIX + info.getDestination() + suffix;
            ActiveMQDestination dest = ActiveMQDestination.createDestination(advisory.getDestination()
                    .getDestinationType(), destName);
            generateAdvisoryMessage(advisory, client, info, dest);
        }
    }
View Full Code Here

        if (matchProducer(advisory, info)) {
            //find the client for ther advisory
            BrokerClient client = (BrokerClient) advisoryConsumers.get(advisory);
            String suffix = info.isStarted() ? "started" : "stopped";
            String destName = ActiveMQDestination.CONSUMER_ADVISORY_PREFIX + info.getDestination() + suffix;
            ActiveMQDestination dest = ActiveMQDestination.createDestination(advisory.getDestination()
                    .getDestinationType(), destName);
            generateAdvisoryMessage(advisory, client, info, dest);
        }
    }
View Full Code Here

        if (matchConnection(advisory, info)) {
            //find the client for ther advisory
            BrokerClient client = (BrokerClient) advisoryConsumers.get(advisory);
            String suffix = info.isStarted() ? "started" : "stopped";
            String destName = advisory.getDestination().getPhysicalName() + suffix;
            ActiveMQDestination dest = ActiveMQDestination.createDestination(advisory.getDestination()
                    .getDestinationType(), destName);
            generateAdvisoryMessage(advisory, client, info, dest);
        }
    }
View Full Code Here

    }

    boolean matchConsumer(ConsumerInfo advisory, ConsumerInfo 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.isConsumerAdvisory()) {
                String pyhsicalName = advisory.getDestination().getPhysicalName();
                String matchName = pyhsicalName.substring(ActiveMQDestination.CONSUMER_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

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.