Package org.activemq.message

Examples of org.activemq.message.ActiveMQDestination


    public Map getLocalDestinations() {
        Map localDestinations = new HashMap();
        for (Iterator iter = subscriptions.values().iterator(); iter.hasNext();) {
            TransientSubscription sub = (TransientSubscription) 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() || destination.isTemporary() )
            return;
           
        DurableQueueBoundedMessageContainer container = (DurableQueueBoundedMessageContainer) containers
                .get(destination);
        if (container == null) {
            container = createContainer(destination,false);
        }
        if (log.isDebugEnabled()) {
            log.debug("Adding consumer: " + info);
        }
       
        DurableQueueSubscription 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() || destination.isTemporary() )
            return;
       
        for (Iterator i = containers.values().iterator();i.hasNext();) {
            DurableQueueBoundedMessageContainer container = (DurableQueueBoundedMessageContainer) i.next();
            if (container != null) {
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() || destination.isTemporary() || !message.isPersistent())
            return;

        if (queueManager.getCurrentCapacity() <= garbageCoolectionCapacityLimit) {
            doGarbageCollection();
        }
View Full Code Here

    public void testSuccessfulCreateQueueDestination() {
        activationSpec.setDestinationType(Queue.class.getName());
        activationSpec.setDestination(DESTINATION);
        assertActivationSpecValid();
        ActiveMQDestination destination = activationSpec.createDestination();
        assertNotNull("ActiveMQDestination not created", destination);
        assertEquals("Physical name not the same", activationSpec.getDestination(), destination.getPhysicalName());
        assertTrue("Destination is not a Queue", destination instanceof Queue);
    }
View Full Code Here

    public void testSuccessfulCreateTopicDestination() {
        activationSpec.setDestinationType(Topic.class.getName());
        activationSpec.setDestination(DESTINATION);
        assertActivationSpecValid();
        ActiveMQDestination destination = activationSpec.createDestination();
        assertNotNull("ActiveMQDestination not created", destination);
        assertEquals("Physical name not the same", activationSpec.getDestination(), destination.getPhysicalName());
        assertTrue("Destination is not a Topic", destination instanceof Topic);
    }
View Full Code Here

    }

    public void testCreateDestinationIncorrectType() {
        activationSpec.setDestinationType(null);
        activationSpec.setDestination(DESTINATION);
        ActiveMQDestination destination = activationSpec.createDestination();
        assertNull("ActiveMQDestination should not have been created", destination);
    }
View Full Code Here

    }

    public void testCreateDestinationIncorrectDestinationName() {
        activationSpec.setDestinationType(Topic.class.getName());
        activationSpec.setDestination(null);
        ActiveMQDestination destination = activationSpec.createDestination();
        assertNull("ActiveMQDestination should not have been created", destination);
    }
View Full Code Here

        }
        return retVal;
    }

    public ActiveMQDestination createDestination() {
        ActiveMQDestination dest = null;
        if (isValidDestinationType() && isValidDestination()) {
            if (Queue.class.getName().equals(destinationType)) {
                dest = new ActiveMQQueue(destination);
            } else if (Topic.class.getName().equals(destinationType)) {
                dest = new ActiveMQTopic(destination);
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

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.