Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.ActiveMQDestination


       
        //check producerKey is set (will not be set by most Junit tests)
        boolean externalMessageId = msg.isExternalMessageId() || msg.getProducerKey() == null || msg.getProducerKey().length() == 0;
        msg.setExternalMessageId(externalMessageId);
       
        ActiveMQDestination destination = msg.getJMSActiveMQDestination();
        ByteArray payload = msg.getBodyAsBytes();
        BitArray ba = msg.getBitArray();
        ba.reset();
        boolean cachingEnabled = wireFormat.isCachingEnabled();
        boolean cachingDestination = cachingEnabled && destination != null && !destination.isOrdered() && !destination.isExclusive();
        boolean longSequence = msg.getSequenceNumber() > Integer.MAX_VALUE;
       
        ba.set(AbstractPacket.RECEIPT_REQUIRED_INDEX, packet.isReceiptRequired());
        Object[] visited = msg.getBrokersVisited();
        boolean writeVisited = visited != null && visited.length > 0;
View Full Code Here


     * @param client
     * @param message
     * @throws javax.jms.JMSException
     */
    public void sendMessage(final BrokerClient client, final ActiveMQMessage message) throws JMSException {
        ActiveMQDestination dest = (ActiveMQDestination) message.getJMSDestination();
        if (dest == null || !dest.isTopic() || message.getJMSDeliveryMode() != DeliveryMode.PERSISTENT)
            return;
       
        // note that we still need to persist the message even if there are no matching
        // subscribers as they may come along later
        // plus we don't pre-load subscription information
View Full Code Here

    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

    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

     * @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);
        getBroker().sendMessage(client, message);
    }
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.