Package org.activemq.message

Examples of org.activemq.message.ActiveMQDestination


  }

  protected void startAdvisoryForTempDestination(Destination d)
      throws JMSException {
    if (d != null) {
      ActiveMQDestination dest = (ActiveMQDestination) ActiveMQMessageTransformation
          .transformDestination(d);
      if (dest.isTemporary()) {
        TempDestinationAdvisor test = (TempDestinationAdvisor) validDestinationsMap
            .get(dest);
        if (test == null) {
          test = new TempDestinationAdvisor(this, dest);
          test.start();
View Full Code Here


  }

  protected void stopAdvisoryForTempDestination(ActiveMQDestination d)
      throws JMSException {
    if (d != null) {
      ActiveMQDestination dest = (ActiveMQDestination) ActiveMQMessageTransformation
          .transformDestination(d);
      if (dest.isTemporary()) {
        TempDestinationAdvisor test = (TempDestinationAdvisor) validDestinationsMap
            .remove(dest);
        if (test != null) {
          test.stop();
        }
View Full Code Here

        if (message == null) {
            return;
        }

        boolean consumed = browser ? false : messageRead;
        ActiveMQDestination destination = message.getJMSActiveMQDestination();
        boolean topic = destination != null && destination.isTopic();
        message.setTransientConsumed((!isDurableSubscriber() || !message.isPersistent()) && topic);
        this.session.afterMessageDelivered((isDurableSubscriber() || this.destination.isQueue()), message, consumed, messageExpired, beforeCalled);
        if (messageRead) {
            stats.onMessage(message);
        }
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

    public ActiveMQDestination createDestination() {
        if( isEmpty(destinationType) || isEmpty(destination) )
            return null;
       
        ActiveMQDestination dest = null;
        if (Queue.class.getName().equals(destinationType)) {
            dest = new ActiveMQQueue(destination);
        } else if (Topic.class.getName().equals(destinationType)) {
            dest = new ActiveMQTopic(destination);
        } else {
View Full Code Here

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

     * @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

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.