Package org.apache.activemq.command

Examples of org.apache.activemq.command.ActiveMQTopic


  private static void go(String brokerUrl, String topicName) throws JMSException {
    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
    connectionFactory.setBrokerURL(brokerUrl);
    Connection connection = connectionFactory.createConnection();
    ActiveMQTopic topic = new ActiveMQTopic(topicName);
    MessageConsumer consumer = connection.createSession(false, Session.AUTO_ACKNOWLEDGE).createConsumer(topic);
    connection.start();
    while(true) {
      Message m = consumer.receive();
      if (!(m instanceof ObjectMessage)) {
View Full Code Here


   
    /**
     * @return a new object instance
     */
    public DataStructure createObject() {
        return new ActiveMQTopic();
    }
View Full Code Here

            ActiveMQManagedConnectionFactory mcf = new ActiveMQManagedConnectionFactory();
            mcf.setResourceAdapter(outboundRa);
            managedConnectionFactory = (ConnectionFactory) mcf.createConnectionFactory(getConnectionManager());

            // Inbound broadcast
            broadcastTopic = new ActiveMQTopic(broadcastDestinationName);
            advisoryTopic = AdvisorySupport.getConsumerAdvisoryTopic((ActiveMQDestination) broadcastTopic);
        } catch (Exception e) {
            LOGGER.error("Failed to initialize JCAFlow", e);
            throw new JBIException(e);
        }
View Full Code Here

    public ActiveMQTopic toActiveMQTopic(List<TopicExpressionType> topics) throws InvalidTopicException {
        if (topics == null || topics.size() == 0) {
            return null;
        }
        int size = topics.size();
        ActiveMQTopic childrenDestinations[] = new ActiveMQTopic[size];
        for (int i = 0; i < size; i++) {
            childrenDestinations[i] = toActiveMQTopic(topics.get(i));
        }

        ActiveMQTopic topic = new ActiveMQTopic();
        topic.setCompositeDestinations(childrenDestinations);
        return topic;
    }
View Full Code Here

    public ActiveMQTopic toActiveMQTopic(TopicExpressionType topic) throws InvalidTopicException {
        String dialect = topic.getDialect();
        if (dialect == null || SIMPLE_DIALECT.equals(dialect)) {
            for (Iterator iter = topic.getContent().iterator(); iter.hasNext();) {
                ActiveMQTopic answer = createActiveMQTopicFromContent(iter.next());
                if (answer != null) {
                    return answer;
                }
            }
            throw new InvalidTopicException("No topic name available topic: " + topic);
View Full Code Here

    // Implementation methods
    // -------------------------------------------------------------------------
    protected ActiveMQTopic createActiveMQTopicFromContent(Object contentItem) {
        if (contentItem instanceof String) {
            return new ActiveMQTopic(((String) contentItem).trim());
        }
        if (contentItem instanceof QName) {
            return createActiveMQTopicFromQName((QName) contentItem);
        }
        return null;
View Full Code Here

        }
        return null;
    }

    protected ActiveMQTopic createActiveMQTopicFromQName(QName qName) {
        return new ActiveMQTopic(qName.toString());
    }
View Full Code Here

            ActiveMQManagedConnectionFactory mcf = new ActiveMQManagedConnectionFactory();
            mcf.setResourceAdapter(outboundRa);
            managedConnectionFactory = (ConnectionFactory) mcf.createConnectionFactory(getConnectionManager());

            // Inbound broadcast
            broadcastTopic = new ActiveMQTopic(broadcastDestinationName);
            advisoryTopic = AdvisorySupport.getConsumerAdvisoryTopic((ActiveMQDestination) broadcastTopic);
        } catch (Exception e) {
            log.error("Failed to initialize JCAFlow", e);
            throw new JBIException(e);
        }
View Full Code Here

                demandConsumerInfo.setDispatchAsync(configuration.isDispatchAsync());
                String advisoryTopic = AdvisorySupport.CONSUMER_ADVISORY_TOPIC_PREFIX + configuration.getDestinationFilter();
                if (configuration.isBridgeTempDestinations()) {
                    advisoryTopic += "," + AdvisorySupport.TEMP_DESTINATION_COMPOSITE_ADVISORY_TOPIC;
                }
                demandConsumerInfo.setDestination(new ActiveMQTopic(advisoryTopic));
                demandConsumerInfo.setPrefetchSize(configuration.getPrefetchSize());
                remoteBroker.oneway(demandConsumerInfo);
                startedLatch.countDown();
                if (!disposed) {
                    triggerLocalStartBridge();
View Full Code Here

        ActiveMQDestination topic = getMirrorTopic(destination.getActiveMQDestination());
        return brokerService.getDestination(topic);
    }

    protected ActiveMQDestination getMirrorTopic(ActiveMQDestination original) {
        return new ActiveMQTopic(prefix + original.getPhysicalName() + postfix);
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.command.ActiveMQTopic

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.