Package org.activemq.ws.xmlbeans.notification.base

Examples of org.activemq.ws.xmlbeans.notification.base.TopicExpressionType


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


            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            consumer = (ActiveMQMessageConsumer) session.createConsumer(TopicExpressionConverter.toActiveMQTopic(topicExpression), toJMSSelector(selector));
            consumer.setMessageListener(new MessageListener(){
                public void onMessage(Message msg) {
                    try {                       
                        TopicExpressionType topic = TopicExpressionConverter.toTopicExpression((ActiveMQTopic) msg.getJMSDestination());
                        if( msg instanceof BytesMessage  ) {
                            BytesMessage bm = (BytesMessage) msg;
                            byte data[] = new byte[(int)bm.getBodyLength()];
                            bm.readBytes(data);
                            XmlObject xml = XmlObject.Factory.parse(new ByteArrayInputStream(data));                           
View Full Code Here

public class TopicExpressionConverter {

    private static final String SIMPLE_DIALECT = "http://www.ibm.com/xmlns/stdwip/web-services/WSTopics/TopicExpression/simple";
   
    static public TopicExpressionType toTopicExpression( ActiveMQTopic topic ) {
        TopicExpressionType rc = TopicExpressionType.Factory.newInstance();
        rc.setDialect(SIMPLE_DIALECT);
        XmlCursor cursor = rc.newCursor();
        cursor.setTextValue(topic.getPhysicalName());
        return rc;
    }
View Full Code Here

TOP

Related Classes of org.activemq.ws.xmlbeans.notification.base.TopicExpressionType

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.