Package org.activemq.message

Examples of org.activemq.message.ActiveMQDestination


    }
  }

  protected void closeTemporaryDestinations() throws JMSException {
    for (Iterator i = tempDestinationMap.keySet().iterator(); i.hasNext();) {
      ActiveMQDestination dest = (ActiveMQDestination) i.next();
      stopTemporaryDestination(dest);
    }
  }
View Full Code Here


  }

  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

     * @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) {
            // 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               
            final MessageContainer container = getContainer(dest.getPhysicalName());
            container.addMessage(message);
            TransactionManager.getContexTransaction().addPostCommitTask(new TransactionTask() {
                public void execute() throws Throwable {
                    doSendMessage(client, message, container);
                }
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

    }

    private void startSubscriptions(Map destinations, boolean topic, boolean durableTopic) {
        if (destinations != null) {
            for (Iterator i = destinations.values().iterator();i.hasNext();) {
                ActiveMQDestination dest = (ActiveMQDestination) i.next();
                addConsumerInfo(dest, topic, durableTopic);
            }
        }
    }
View Full Code Here

    }

    static String convert(Destination d)
    {
        ActiveMQDestination amq_d = (ActiveMQDestination)d;
        String p_name = amq_d.getPhysicalName();

        StringBuffer buffer = new StringBuffer();
        if (amq_d.isQueue()) buffer.append("/queue/");
        if (amq_d.isTopic()) buffer.append("/topic/");
        buffer.append(p_name);

        return buffer.toString();
    }
View Full Code Here

        String destination = headers.getProperty(Stomp.Headers.Send.DESTINATION);

        ActiveMQTextMessage text = new ActiveMQTextMessage();
        text.setJMSMessageID(StompWireFormat.PACKET_IDS.generateId());

        ActiveMQDestination d = DestinationNamer.convert(destination);
        text.setJMSDestination(d);
        text.setJMSClientID(format.getClientId());
        if (format.isInTransaction())
        {
            text.setTransactionIDString(format.getTransactionId());
View Full Code Here

        return ActiveMQDestination.createDestination(type, text);
    }

    protected String toString(Destination destination) {
        if (destination instanceof ActiveMQDestination) {
            ActiveMQDestination activeDestination = (ActiveMQDestination) destination;
            String physicalName = activeDestination.getPhysicalName();
            switch (activeDestination.getDestinationType()) {
                case ActiveMQDestination.ACTIVEMQ_QUEUE:
                    return QUEUE_PREFIX + physicalName;

                case ActiveMQDestination.ACTIVEMQ_TEMPORARY_QUEUE:
                    return TEMP_QUEUE_PREFIX + physicalName;
View Full Code Here

    public PacketEnvelope build(String commandLine, DataInput in) throws IOException
    {
        ConsumerInfo ci = new ConsumerInfo();
        Properties headers = headerParser.parse(in);
        String destination = headers.getProperty(Stomp.Headers.Subscribe.DESTINATION);
        ActiveMQDestination actual_dest  = DestinationNamer.convert(destination);
        ci.setDestination(DestinationNamer.convert(destination));
        ci.setStarted(true);
        ci.setStartTime(System.currentTimeMillis());
        ci.setClientId(format.getClientId());
        short consumer_no = StompWireFormat.clientIds.getNextShortSequence();
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.