Package org.activemq.message

Examples of org.activemq.message.ActiveMQTopic


          broadcastConnector.afterPropertiesSet();
         
          // Outbound broadcast
          connection = ((ActiveMQResourceAdapter) resourceAdapter).makeConnection();
          connection.start();
          broadcastTopic = new ActiveMQTopic(broadcastDestinationName);
            advisor = new ConsumerAdvisor(connection, broadcastTopic);
            advisor.addListener(this);
        }
        catch (Exception e) {
            log.error("Failed t0 initialize JCAFlow", e);
View Full Code Here


    public RegisterPublisherResponseDocument registerPublisher(RegisterPublisherDocument requestDoc) {

        // Check request.
        RegisterPublisher publisherInfo = requestDoc.getRegisterPublisher();
        ActiveMQTopic topic = TopicExpressionConverter.toActiveMQTopic(publisherInfo.getTopicArray());
        Calendar terminationTime = publisherInfo.getInitialTerminationTime();
        if (terminationTime != null) {
            // Termination time cannot be in the past
            if (terminationTime.before(Calendar.getInstance())) {
                // Is this the right way to fault??
View Full Code Here

    public void XtestSendNotify() throws Exception {
       
        ActiveMQNotificationBroker broker = new ActiveMQNotificationBroker();
        ActiveMQConnection connection = broker.getConnection();
        Session session = connection.createSession(false, 0);
        ActiveMQTopic topic = new ActiveMQTopic("Test");
        MessageConsumer consumer = session.createConsumer(topic);
       
        NotifyDocument request = NotifyDocument.Factory.newInstance();
        Notify notify = request.addNewNotify();
        NotificationMessageHolderType messageHolder = notify.addNewNotificationMessage();
View Full Code Here

import junit.framework.TestCase;

public class TopicExpressionConverterTest extends TestCase {
   
    public void testConvert() {
        ActiveMQTopic topic1 = new ActiveMQTopic("Hello");
        TopicExpressionType type = TopicExpressionConverter.toTopicExpression(topic1);
        ActiveMQTopic topic2 = TopicExpressionConverter.toActiveMQTopic(type);
        assertEquals(topic1, topic2);       
    }
View Full Code Here

    static public ActiveMQTopic toActiveMQTopic(TopicExpressionType[] topicArray) {
        if( topicArray==null || topicArray.length==0 )
            return null;
       
        ActiveMQTopic childrenDestinations[] = new ActiveMQTopic[topicArray.length];
        for (int i = 0; i < topicArray.length; i++) {
            childrenDestinations[i] = toActiveMQTopic(topicArray[i]);
        }
       
        ActiveMQTopic topic = new ActiveMQTopic();
        topic.setChildDestinations(childrenDestinations);
        return topic;
    }
View Full Code Here

        if( SIMPLE_DIALECT.equals(dialect) ) {
           
            XmlCursor cursor = topic.newCursor();
            //cursor.toFirstContentToken();
            String textValue = cursor.getTextValue();           
            return new ActiveMQTopic(textValue);
           
        } else {
            throw new RuntimeException("Topic dialect: "+dialect+" not supported");
        }
    }
View Full Code Here

            @WebParam(name = "InitialTerminationTime", targetNamespace = "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BrokeredNotification-1.2-draft-01.xsd")
            XMLGregorianCalendar terminationTime) throws InvalidTopicExpressionFault, PublisherRegistrationFailedFault,
            ResourceUnknownFault, TopicNotSupportedFault {

        // Check request.
        ActiveMQTopic topic = topicConverter.toActiveMQTopic(list);

        terminationTime = validateTerminationTime(terminationTime);

        // Create publisher and assoicate an EndpointReference with it.
        EndpointReferenceType registrationEndpointReference = null;
View Full Code Here

    public ActiveMQTopic toActiveMQTopic(List<TopicExpressionType> topics) {
        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.setChildDestinations(childrenDestinations);
        return topic;
    }
View Full Code Here

    public ActiveMQTopic toActiveMQTopic(TopicExpressionType topic) {
        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 RuntimeException("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);
        }
        if (contentItem instanceof QName) {
            return createActiveMQTopicFromQName((QName) contentItem);
        }
        return null;
View Full Code Here

TOP

Related Classes of org.activemq.message.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.