Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.ActiveMQDestination


     * @param client
     * @param info
     * @throws JMSException
     */
    public synchronized void removeMessageConsumer(BrokerClient client, ConsumerInfo info) throws JMSException {
        ActiveMQDestination destination = info.getDestination();
        if (destination.isTopic()) {
            TransientTopicBoundedMessageContainer container = (TransientTopicBoundedMessageContainer) containers
                    .get(client);
            if (container != null) {
                container.removeConsumer(info);
                if (container.isInactive()) {
                    containers.remove(client);
                    container.close();
                    destinationMap.remove(destination, container);
                }

                // lets check if we've no more consumers for this destination
                if (!hasConsumerFor(destination)) {
                    destinations.remove(destination.getPhysicalName());
                }
            }
        }
    }
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();
        checkTempDestinationExistance(dest);
        getBroker().addMessageProducer(client, info);

        producerInfos.put(info, client);
    }
View Full Code Here

     * @param client
     * @param message
     * @throws JMSException
     */
    public void sendMessage(BrokerClient client, ActiveMQMessage message) throws JMSException {
        ActiveMQDestination dest = message.getJMSActiveMQDestination();       
        checkTempDestinationExistance(dest);
        broker.sendMessage(client, message);
    }
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.isTopic()) {
            TransientTopicBoundedMessageContainer container = (TransientTopicBoundedMessageContainer) containers
                    .get(client);
            if (container != null) {
                container.removeConsumer(info);
                if (container.isInactive()) {
                    containers.remove(client);
                    container.close();
                    destinationMap.remove(destination, container);
                }

                // lets check if we've no more consumers for this destination
                //As the destinations are used for generating
                //subscriptions for NetworkConnectors etc.,
                //we should not count durable topic subscribers
                if (!info.isDurableTopic() && !hasConsumerFor(destination)) {
                    destinations.remove(destination.getPhysicalName());
                }
            }
            subscriptions.remove(info.getConsumerId());
        }
    }
View Full Code Here

    public Map getLocalDestinations() {
        Map localDestinations = new HashMap();
        for (Iterator iter = subscriptions.values().iterator(); iter.hasNext();) {
            TransientTopicSubscription sub = (TransientTopicSubscription) iter.next();
            if (sub.isLocalSubscription() && !sub.isDurableTopic()) {
                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();
                }
            }
            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(BrokerClient client, ActiveMQMessage message) throws JMSException {
        ActiveMQDestination destination = message.getJMSActiveMQDestination();
        if (destination.isQueue() && message.isTemporary()) {
            if (queueManager.getCurrentCapacity() <= garbageCoolectionCapacityLimit) {
                doGarbageCollection();
            }
            TransientQueueBoundedMessageContainer container = (TransientQueueBoundedMessageContainer) containers
                    .get(destination);
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.isTopic()) {
            TransientTopicBoundedMessageContainer container = (TransientTopicBoundedMessageContainer) containers
                    .get(client);
            if (container == null) {
                MemoryBoundedQueue queue = queueManager.getMemoryBoundedQueue(client.toString());
                container = new TransientTopicBoundedMessageContainer(this,client, queue);
                containers.put(client, container);
                if (started.get()) {
                    container.start();
                }
            }
            container.addConsumer(createFilter(info), info);
            destinationMap.put(destination,container);
            String name = destination.getPhysicalName();
            //As the destinations are used for generating
            //subscriptions for NetworkConnectors etc.,
            //we should not generate duplicates by adding in
            //durable topic subscribers
            if (!info.isDurableTopic() && !destinations.containsKey(name)) {
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.isTopic()) {
            TransientTopicBoundedMessageContainer container = (TransientTopicBoundedMessageContainer) containers
                    .get(client);
            if (container != null) {
                container.removeConsumer(info);
                if (container.isInactive()) {
                    containers.remove(client);
                    container.close();
                    destinationMap.remove(destination, container);
                }

                // lets check if we've no more consumers for this destination
                //As the destinations are used for generating
                //subscriptions for NetworkConnectors etc.,
                //we should not count durable topic subscribers
                if (!info.isDurableTopic() && !hasConsumerFor(destination)) {
                    destinations.remove(destination.getPhysicalName());
                }
            }
        }
    }
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.