Package org.activemq.message

Examples of org.activemq.message.ActiveMQDestination


     * @param info
     */
    void removeConnection(BrokerClient sender, ConnectionInfo info) {
        connections.remove(info);
        removeAllTempDestinations(sender, info.getClientId());
        ActiveMQDestination dest = ActiveMQDestination.createDestination(ActiveMQDestination.ACTIVEMQ_TOPIC,
                ActiveMQDestination.CONNECTION_ADVISORY_PREFIX);
        dispatchToBroker(sender, generateAdvisoryMessage(info, dest));
    }
View Full Code Here


     * @return an advisory message or null
     */
    private ActiveMQMessage generateAdvisory(ConsumerInfo advisory, ConnectionInfo info) {
        if (matchConnection(advisory, info)) {
            String destName = advisory.getDestination().getPhysicalName();
            ActiveMQDestination dest = ActiveMQDestination.createDestination(advisory.getDestination()
                    .getDestinationType(), destName);
            return generateAdvisoryMessage(advisory, info, dest);
        }
        return null;
    }
View Full Code Here

    }

    boolean matchConsumer(ConsumerInfo advisory, ConsumerInfo info) {
        boolean result = false;
        if (advisory != null && advisory.getDestination() != null && info != null && info.getDestination() != null) {
            ActiveMQDestination advisoryDestination = advisory.getDestination();
            ActiveMQDestination destination = info.getDestination();
            if (advisoryDestination.isConsumerAdvisory()) {
                ActiveMQDestination match = advisoryDestination.getDestinationBeingAdvised();
                return match.matches(destination) || matchGeneralAdvisory(advisory, destination);
            }
        }
        return result;
    }
View Full Code Here

    }

    boolean matchProducer(ConsumerInfo advisory, ProducerInfo info) {
        boolean result = false;
        if (advisory != null && advisory.getDestination() != null && info != null && info.getDestination() != null) {
            ActiveMQDestination advisoryDestination = advisory.getDestination();
            ActiveMQDestination destination = info.getDestination();
            if (advisoryDestination.isProducerAdvisory()) {
                ActiveMQDestination match = advisoryDestination.getDestinationBeingAdvised();
                return match.matches(destination) || matchGeneralAdvisory(advisory, destination);
            }
        }
        return result;
    }
View Full Code Here

     * @return true if a general 'catch-all' advisory subscriber
     */
    private boolean matchGeneralAdvisory(ConsumerInfo advisory, ActiveMQDestination destination) {
        boolean result = advisory.getDestination() != null && advisory.getDestination().isAdvisory();
        if (result) {
            ActiveMQDestination match = advisory.getDestination().getDestinationBeingAdvised();
            result = match.matches(destination);
        }
        return result;
    }
View Full Code Here

    }

    boolean matchTempDestinationAdvisory(ConsumerInfo advisory, ActiveMQDestination destination) {
        boolean result = false;
        if (advisory != null && advisory.getDestination() != null) {
            ActiveMQDestination advisoryDestination = advisory.getDestination();
            if (advisoryDestination.isTempDestinationAdvisory()) {
                ActiveMQDestination match = advisoryDestination.getDestinationBeingAdvised();
                return match.matches(destination) || matchGeneralAdvisory(advisory, destination);
            }
        }
        return result;
    }
View Full Code Here

    /**
     * send a message to the broker
     */
    public void sendMessage(BrokerClient client, ActiveMQMessage message) throws JMSException {
        checkValid();
        ActiveMQDestination destination = message.getJMSActiveMQDestination();
        if (destination == null) {
            throw new JMSException("No destination specified for the Message");
        }
        if (message.getJMSMessageID() == null && !destination.isAdvisory()) {
            throw new JMSException("No messageID specified for the Message");
        }
        associateTransaction(message);
        try {
            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;
                    }
                    else {
View Full Code Here

    protected void doMessageSend(BrokerClient client, ActiveMQMessage message) throws JMSException {
        if (securityAdapter != null) {
            securityAdapter.authorizeSendMessage(client, message);
        }
        ActiveMQDestination dest = message.getJMSActiveMQDestination();
        if (dest.isTopic()){
            if (message.isPersistent() && !dest.isTemporary()){
                persistentTopicMCM.sendMessage(client,message);
            }
            transientTopicMCM.sendMessage(client, message);
        }else {
            transientQueueMCM.sendMessage(client, message);
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

    }
  }

  protected void closeTemporaryDestinations() throws JMSException {
    for (Iterator i = tempDestinationMap.keySet().iterator(); i.hasNext();) {
      ActiveMQDestination dest = (ActiveMQDestination) i.next();
      stopTemporaryDestination(dest);
    }
  }
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.