Commit in servicemix/ws/jaxws/wsnotification/src/main/java/org/servicemix/ws/notification/impl on MAIN
TopicExpressionConverter.java+18-21.2 -> 1.3
added hook to support QNames

servicemix/ws/jaxws/wsnotification/src/main/java/org/servicemix/ws/notification/impl
TopicExpressionConverter.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- TopicExpressionConverter.java	25 Aug 2005 17:35:18 -0000	1.2
+++ TopicExpressionConverter.java	26 Aug 2005 10:15:45 -0000	1.3
@@ -21,8 +21,12 @@
 import org.oasis_open.docs.wsn._2004._06.wsn_ws_basenotification_1_2_draft_01.TopicExpressionType;
 
 import javax.jms.Topic;
+import javax.xml.namespace.QName;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
+
+import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
 
 public class TopicExpressionConverter {
 
@@ -63,7 +67,7 @@
         String dialect = topic.getDialect();
         if (dialect == null || SIMPLE_DIALECT.equals(dialect)) {
             for (Iterator iter = topic.getContent().iterator(); iter.hasNext();) {
-                ActiveMQTopic answer = createActiveMQFromContent(iter.next());
+                ActiveMQTopic answer = createActiveMQTopicFromContent(iter.next());
                 if (answer != null) {
                     return answer;
                 }
@@ -75,11 +79,23 @@
         }
     }
 
-    protected ActiveMQTopic createActiveMQFromContent(Object contentItem) {
+    // 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;
+    }
+
+    protected ActiveMQTopic createActiveMQTopicFromQName(QName qName) {
+        String localPart = qName.getLocalPart();
+
+        // TODO we should support namespaced topics
+        return new ActiveMQTopic(localPart);
     }
 
 }
CVSspam 0.2.8



Reply via email to