Package org.activemq.message

Examples of org.activemq.message.ActiveMQDestination


    }

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


        return ActiveMQDestination.createDestination(type, text);
    }

    protected String toString(Destination destination) {
        if (destination instanceof ActiveMQDestination) {
            ActiveMQDestination activeDestination = (ActiveMQDestination) destination;
            String physicalName = activeDestination.getPhysicalName();
            switch (activeDestination.getDestinationType()) {
                case ActiveMQDestination.ACTIVEMQ_QUEUE:
                    return QUEUE_PREFIX + physicalName;

                case ActiveMQDestination.ACTIVEMQ_TEMPORARY_QUEUE:
                    return TEMP_QUEUE_PREFIX + physicalName;
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.activemq.topic:":"org.activemq.queue:")+brokerName+":"+activeMQDestination.getPhysicalName();
  }
View Full Code Here

     * @param ack
     * @throws JMSException
     */
    public void acknowledgeMessage(final BrokerClient client, final MessageAck ack) throws JMSException {
       
        ActiveMQDestination destination = ack.getDestination();
        if (destination == null) {
            log.warn("Ignoring acknowledgeMessage() on null destination: " + ack);
            return;
        }
        if (!destination.isQueue() || destination.isTemporary() || !ack.isPersistent())
            return;

        final DurableQueueSubscription ts = (DurableQueueSubscription) subscriptions.get(ack.getConsumerId());
        if (ts == null)
            return;
View Full Code Here

     * @param physicalName
     * @return MessageContainer
     * @throws JMSException
     */
    public MessageContainer getContainer(String physicalName) throws JMSException {
        ActiveMQDestination key = (ActiveMQDestination) destinations.get(physicalName);
        if (key != null) {
            return (MessageContainer) containers.get(key);
        }
        return null;
    }
View Full Code Here

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

     * @param client
     * @param info
     * @throws JMSException
     */
    public synchronized void addMessageConsumer(BrokerClient client, ConsumerInfo info) throws JMSException {
        ActiveMQDestination destination = info.getDestination();
        if (destination.isQueue()) {
            TransientQueueBoundedMessageContainer container = (TransientQueueBoundedMessageContainer) containers
                    .get(destination);
            if (container == null) {
                MemoryBoundedQueue queue = queueManager.getMemoryBoundedQueue(client.toString());
                container = new TransientQueueBoundedMessageContainer(threadPool, queueManager, destination,
                        redeliveryPolicy, deadLetterPolicy);
                addContainer(container);
                if (started.get()) {
                    container.start();
                }
            }
            if (log.isDebugEnabled()) {
                log.debug("Adding consumer: " + info);
            }
           
            TransientQueueSubscription ts = container.addConsumer(createFilter(info), info, client);
            if (ts != null) {
                subscriptions.put(info.getConsumerId(), ts);
            }
            String name = destination.getPhysicalName();
            if (!destinations.containsKey(name)) {
                destinations.put(name, destination);
            }
        }
    }
View Full Code Here

     * @param client
     * @param info
     * @throws JMSException
     */
    public synchronized void removeMessageConsumer(BrokerClient client, ConsumerInfo info) throws JMSException {
        ActiveMQDestination destination = info.getDestination();
        if (destination.isQueue()) {
            for (Iterator i = containers.values().iterator();i.hasNext();) {
                TransientQueueBoundedMessageContainer container = (TransientQueueBoundedMessageContainer) i.next();
                if (container != null) {
                    container.removeConsumer(info);
                }
View Full Code Here

     * @param client
     * @param message
     * @throws JMSException
     */
    public void sendMessage(final BrokerClient client, final ActiveMQMessage message) throws JMSException {
        ActiveMQDestination destination = message.getJMSActiveMQDestination();
        if ( !destination.isQueue() || !message.isTemporary() )
            return;

        // If there is no transaction.. then this executes directly.
        TransactionManager.getContexTransaction().addPostCommitTask(new TransactionTask(){
            public void execute() throws Throwable {
View Full Code Here

     * @param message
     * @throws JMSException
     */
    private void doSendMessage(BrokerClient client, ActiveMQMessage message) throws JMSException {

        ActiveMQDestination destination = message.getJMSActiveMQDestination();
        if (queueManager.getCurrentCapacity() <= garbageCoolectionCapacityLimit) {
            doGarbageCollection();
        }
        TransientQueueBoundedMessageContainer container = (TransientQueueBoundedMessageContainer) containers
                .get(destination);
View Full Code Here

TOP

Related Classes of org.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.