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

     */
    protected void updateAcknowledgeStats(BrokerClient client, Subscription subscription) {
        if (isMaintainDestinationStats()) {
            // lets lookup the destination which has the stats hanging off it
            String name = subscription.getDestination().getPhysicalName();
            ActiveMQDestination destination = (ActiveMQDestination) destinations.get(name);
            destination.getStats().onMessageAck();
        }
    }
View Full Code Here

     */
    protected void updateSendStats(BrokerClient client, ActiveMQMessage message) throws JMSException {
        if (isMaintainDestinationStats()) {
            // lets lookup the destination which has the stats hanging off it
            String name = message.getJMSActiveMQDestination().getPhysicalName();
            ActiveMQDestination destination = (ActiveMQDestination) destinations.get(name);
            if (destination != null){
                destination.getStats().onMessageSend(message);
            }
        }
    }
View Full Code Here

    public void sendMessage(BrokerClient client, ActiveMQMessage message) throws JMSException {
        checkValid();
        if (message.getJMSMessageID() == null) {
            throw new JMSException("No messageID specified for the Message");
        }
        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

     * @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");
            }
        }
        getBroker().addMessageProducer(client, info);

View Full Code Here

  static private String getDestinationPoicyContextId(BrokerClient client, ActiveMQDestination destination) {
    return getDestinationPoicyContextId(getBrokerName(client), destination);
  }
 
  static private String getDestinationPoicyContextId(String brokerName, ActiveMQDestination destination) {
    ActiveMQDestination activeMQDestination = ((ActiveMQDestination)destination);
    return (activeMQDestination.isTopic()?"org.codehaus.activemq.topic:":"org.codehaus.activemq.queue:")+brokerName+":"+activeMQDestination.getPhysicalName();
  }
View Full Code Here

    public synchronized Set get(ActiveMQDestination key) {
        if (key.isComposite()) {
            List childDestinations = key.getChildDestinations();
            Set answer = new HashSet(childDestinations.size());
            for (Iterator iter = childDestinations.iterator(); iter.hasNext();) {
                ActiveMQDestination childDestination = (ActiveMQDestination) iter.next();
                Object value = get(childDestination);
                if (value instanceof Set) {
                    answer.addAll((Set) value);
                }
                else if (value != null) {
View Full Code Here

    public synchronized void put(ActiveMQDestination key, Object value) {
        if (key.isComposite()) {
            List childDestinations = key.getChildDestinations();
            for (Iterator iter = childDestinations.iterator(); iter.hasNext();) {
                ActiveMQDestination childDestination = (ActiveMQDestination) iter.next();
                put(childDestination, value);
            }
            return;
        }
        String[] paths = key.getDestinationPaths();
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.