Title: [949] trunk/ws/jaxws/wsnotification: WS notification now uses jsr181 component

Diff

Modified: trunk/ws/jaxws/wsnotification/project.xml (948 => 949)

--- trunk/ws/jaxws/wsnotification/project.xml	2005-11-28 12:17:19 UTC (rev 948)
+++ trunk/ws/jaxws/wsnotification/project.xml	2005-11-28 12:54:20 UTC (rev 949)
@@ -103,13 +103,21 @@
     </dependency>
     <dependency>
       <groupId>servicemix</groupId>
-      <artifactId>servicemix-jaxws</artifactId>
+      <artifactId>servicemix-common</artifactId>
       <version>${pom.currentVersion}</version>
       <properties>
         <eclipse.dependency>true</eclipse.dependency>
       </properties>
     </dependency>
     <dependency>
+      <groupId>servicemix</groupId>
+      <artifactId>servicemix-jsr181</artifactId>
+      <version>${pom.currentVersion}</version>
+      <properties>
+        <eclipse.dependency>true</eclipse.dependency>
+      </properties>
+    </dependency>
+    <dependency>
       <groupId>org.xbean</groupId>
       <artifactId>xbean-spring</artifactId>
       <version>${xbean_version}</version>
@@ -170,6 +178,36 @@
       <id>jencks+all</id>
       <version>${jencks_version}</version>
     </dependency>
+    <dependency>
+      <groupId>xfire</groupId>
+      <artifactId>xfire-all</artifactId>
+      <version>${xfire_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>servicemix</groupId>
+      <artifactId>xfire-jaxws</artifactId>
+      <version>${xfire_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>jdom</groupId>
+      <artifactId>jdom</artifactId>
+      <version>${jdom_version}</version>
+    </dependency>
+    <dependency>
+      <groupId>backport175</groupId>
+      <artifactId>backport175</artifactId>
+      <version>${backport175_version}</version>
+    </dependency>
+      <dependency>
+        <groupId>commons-attributes</groupId>
+        <artifactId>commons-attributes-api</artifactId>
+        <version>${commons_attributes_version}</version>
+      </dependency>
+      <dependency>
+        <groupId>wsdl4j</groupId>
+        <artifactId>wsdl4j</artifactId>
+        <version>${wsdl4j_version}</version>
+      </dependency>
     
     <!-- optional ActiveSOAP component -->
     <dependency>

Modified: trunk/ws/jaxws/wsnotification/src/main/java/org/servicemix/ws/notification/ActiveMQSubscription.java (948 => 949)

--- trunk/ws/jaxws/wsnotification/src/main/java/org/servicemix/ws/notification/ActiveMQSubscription.java	2005-11-28 12:17:19 UTC (rev 948)
+++ trunk/ws/jaxws/wsnotification/src/main/java/org/servicemix/ws/notification/ActiveMQSubscription.java	2005-11-28 12:54:20 UTC (rev 949)
@@ -66,9 +66,7 @@
                     topicConverter.toActiveMQTopic(topicExpression), toJMSSelector(selector));
             consumer.setMessageListener(dispatcher);
         }
-        else {
-            consumer.start();
-        }
+        consumer.start();
     }
 
     public void stop() throws JMSException {

Modified: trunk/ws/jaxws/wsnotification/src/main/java/org/servicemix/ws/notification/JBINotificationBroker.java (948 => 949)

--- trunk/ws/jaxws/wsnotification/src/main/java/org/servicemix/ws/notification/JBINotificationBroker.java	2005-11-28 12:17:19 UTC (rev 948)
+++ trunk/ws/jaxws/wsnotification/src/main/java/org/servicemix/ws/notification/JBINotificationBroker.java	2005-11-28 12:54:20 UTC (rev 949)
@@ -135,4 +135,12 @@
 
         return null;
     }
+
+    public ComponentContext getContext() {
+        return context;
+    }
+
+    public void setContext(ComponentContext context) {
+        this.context = context;
+    }
 }

Modified: trunk/ws/jaxws/wsnotification/src/main/java/org/servicemix/ws/notification/TopicExpressionConverter.java (948 => 949)

--- trunk/ws/jaxws/wsnotification/src/main/java/org/servicemix/ws/notification/TopicExpressionConverter.java	2005-11-28 12:17:19 UTC (rev 948)
+++ trunk/ws/jaxws/wsnotification/src/main/java/org/servicemix/ws/notification/TopicExpressionConverter.java	2005-11-28 12:54:20 UTC (rev 949)
@@ -80,7 +80,7 @@
     // -------------------------------------------------------------------------
     protected ActiveMQTopic createActiveMQTopicFromContent(Object contentItem) {
         if (contentItem instanceof String) {
-            return new ActiveMQTopic((String) contentItem);
+            return new ActiveMQTopic(((String) contentItem).trim());
         }
         if (contentItem instanceof QName) {
             return createActiveMQTopicFromQName((QName) contentItem);

Modified: trunk/ws/jaxws/wsnotification/src/test/java/org/servicemix/ws/notification/JbiNotificationTest.java (948 => 949)

--- trunk/ws/jaxws/wsnotification/src/test/java/org/servicemix/ws/notification/JbiNotificationTest.java	2005-11-28 12:17:19 UTC (rev 948)
+++ trunk/ws/jaxws/wsnotification/src/test/java/org/servicemix/ws/notification/JbiNotificationTest.java	2005-11-28 12:54:20 UTC (rev 949)
@@ -16,10 +16,10 @@
 
 public class JbiNotificationTest extends TestSupport {
 
-	public void testSubscribe() throws Exception {
-        QName serviceName = new QName("http://jaxws.components.servicemix.org/", "NotificationBroker");
+    public void testSubscribe() throws Exception {
+        QName serviceName = new QName("http://notification.ws.servicemix.org", "JBINotificationBroker");
 
-        String file = "wsn-subscribe-with-envelope.xml";
+        String file = "wsn-subscribe.xml";
         Object answer = requestServiceWithFileRequest(serviceName, file);
         if (answer instanceof Source) {
             System.err.println(transformer.toString((Source) answer));
@@ -29,19 +29,19 @@
         Node node = (Node) answer;
         System.out.println(transformer.toString(node));
 
-        file = "wsn-notify-with-envelope.xml";
+        file = "wsn-notify.xml";
         sendServiceWithFileRequest(serviceName, file);
         
         MyReceiver consumer = (MyReceiver) getBean("consumer");
         assertMessagesReceived(consumer.getMessageList(), 1);
-	}
-	
-	@Override
-	protected AbstractXmlApplicationContext createBeanFactory() {
+    }
+    
+    @Override
+    protected AbstractXmlApplicationContext createBeanFactory() {
         List processors = Arrays.asList(new XBeanProcessor());
         return new ClassPathXmlApplicationContext("org/servicemix/ws/notification/jbi-wsn.xml", processors);
-	}
-	
+    }
+    
     protected void assertMessagesReceived(MessageList messageList, int messageCount) throws Exception {
         messageList.assertMessagesReceived(messageCount);
         List list = messageList.getMessages();

Modified: trunk/ws/jaxws/wsnotification/src/test/java/org/servicemix/ws/notification/SubscribeParseTest.java (948 => 949)

--- trunk/ws/jaxws/wsnotification/src/test/java/org/servicemix/ws/notification/SubscribeParseTest.java	2005-11-28 12:17:19 UTC (rev 948)
+++ trunk/ws/jaxws/wsnotification/src/test/java/org/servicemix/ws/notification/SubscribeParseTest.java	2005-11-28 12:54:20 UTC (rev 949)
@@ -36,7 +36,7 @@
         Subscribe doc = (Subscribe) context.createUnmarshaller().unmarshal(getClass().getResource("wsn-subscribe.xml"));
 
         System.out.println("Parsed: " + doc);
-        System.out.println("Addresss: " + doc.getConsumerReference().getAddress().getValue());
+        System.out.println("Service: " + doc.getConsumerReference().getServiceName().getValue());
     }
 
     protected void setUp() throws Exception {

Modified: trunk/ws/jaxws/wsnotification/src/test/resources/log4j.properties (948 => 949)

--- trunk/ws/jaxws/wsnotification/src/test/resources/log4j.properties	2005-11-28 12:17:19 UTC (rev 948)
+++ trunk/ws/jaxws/wsnotification/src/test/resources/log4j.properties	2005-11-28 12:54:20 UTC (rev 949)
@@ -1,7 +1,7 @@
 #
 # The logging properties used during tests..
 #
-log4j.rootLogger=INFO, stdout
+log4j.rootLogger=DEBUG, stdout
 
 log4j.logger.org.activemq.spring=WARN
 log4j.logger.org.activemq.store.journal=INFO

Modified: trunk/ws/jaxws/wsnotification/src/test/resources/org/servicemix/ws/notification/jbi-wsn.xml (948 => 949)

--- trunk/ws/jaxws/wsnotification/src/test/resources/org/servicemix/ws/notification/jbi-wsn.xml	2005-11-28 12:17:19 UTC (rev 948)
+++ trunk/ws/jaxws/wsnotification/src/test/resources/org/servicemix/ws/notification/jbi-wsn.xml	2005-11-28 12:54:20 UTC (rev 949)
@@ -1,11 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns:foo="http://jaxws.components.servicemix.org/">
+<beans xmlns:sm="http://servicemix.org/config/1.0" 
+	   xmlns:jsr181="http://servicemix.org/jsr181/1.0">
 
-  <container id="jbi">
-    <components>
-      <component id="notificationBroker" service="foo:NotificationBroker" 
-      			 class="org.servicemix.components.jaxws.JAXWSInBinding">
-        <property name="implementor">
+  <!-- the JBI container -->
+  <sm:container id="jbi" embedded="true" monitorInstallationDirectory="false">
+    <sm:activationSpecs>
+
+      <!-- output using a POJO -->
+      <sm:activationSpec>
+      	<sm:component>
+            <jsr181:component>
+            	<jsr181:endpoints>
+            		<jsr181:endpoint>
+            		  <jsr181:pojo>
         	<bean class="org.servicemix.ws.notification.JBINotificationBroker">
         		<constructor-arg>
         			<bean class="org.activemq.ActiveMQConnectionFactory">
@@ -15,12 +22,21 @@
         			</bean>
         		</constructor-arg>
         	</bean>
-        </property>
-       </component>
-		<component id="consumer" service="foo:Consumer"
-				   class="org.servicemix.ws.notification.MyReceiver" />
-    </components>
-  </container>
+            		  </jsr181:pojo>
+            		</jsr181:endpoint>
+            	</jsr181:endpoints>
+            </jsr181:component>
+        </sm:component>
+      </sm:activationSpec>
+      
+      <sm:activationSpec componentName="consumer" service="foo:Consumer">
+        <sm:component>
+          <bean class="org.servicemix.ws.notification.MyReceiver" />
+        </sm:component>
+      </sm:activationSpec>
+      
+    </sm:activationSpecs>
+  </sm:container>
 
   <bean id="client" class="org.servicemix.client.DefaultServiceMixClient">
     <constructor-arg ref="jbi"/>

Deleted: trunk/ws/jaxws/wsnotification/src/test/resources/org/servicemix/ws/notification/wsn-notify-with-envelope.xml (948 => 949)

--- trunk/ws/jaxws/wsnotification/src/test/resources/org/servicemix/ws/notification/wsn-notify-with-envelope.xml	2005-11-28 12:17:19 UTC (rev 948)
+++ trunk/ws/jaxws/wsnotification/src/test/resources/org/servicemix/ws/notification/wsn-notify-with-envelope.xml	2005-11-28 12:54:20 UTC (rev 949)
@@ -1,37 +0,0 @@
-<?xml version="1.0"?>
-<s12:Envelope
-        xmlns:s12='http://schemas.xmlsoap.org/soap/envelope/'
-        xmlns:wsa='http://schemas.xmlsoap.org/ws/2003/03/addressing'
-        xmlns:ncex='http://www.consumer.org/RefProp'>
-  <s12:Header>
-    <wsa:Action>
-      http://docs.oasis-open.org/wsn/2004/06/WS-BaseNotification/Notify
-    </wsa:Action>
-    <wsa:MessageID>
-      uuid:d7c5726b-de29-4313-b4d4-b3425b200839
-    </wsa:MessageID>
-    <!--
-        <wsa:ReplyTo>
-          <wsa:Address>http://www.example.com/MyEventSink</wsa:Address>
-        </wsa:ReplyTo>
-    -->
-
-    <wsa:To s12:mustUnderstand="1">
-      http://www.consumer.org/ConsumerEndpoint
-    </wsa:To>
-    <ncex:NCResourceDisambiguator>
-      uuid:9fef5fec-6dc3-44a2-ba32-8680cace43f9
-    </ncex:NCResourceDisambiguator>
-  </s12:Header>
-  <s12:Body>
-    <Notify xmlns="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd"
-            xmlns:wsrf="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd">
-      <NotificationMessage>
-        <Topic Dialect="http://www.ibm.com/xmlns/stdwip/web-services/WSTopics/TopicExpression/simple">npex:SomeTopic</Topic>
-        <Message>
-          <wsrf:GetResourceProperty xmlns:test="test">test:test</wsrf:GetResourceProperty>
-        </Message>
-      </NotificationMessage>
-    </Notify>
-  </s12:Body>
-</s12:Envelope>
\ No newline at end of file

Added: trunk/ws/jaxws/wsnotification/src/test/resources/org/servicemix/ws/notification/wsn-notify.xml (948 => 949)

--- trunk/ws/jaxws/wsnotification/src/test/resources/org/servicemix/ws/notification/wsn-notify.xml	2005-11-28 12:17:19 UTC (rev 948)
+++ trunk/ws/jaxws/wsnotification/src/test/resources/org/servicemix/ws/notification/wsn-notify.xml	2005-11-28 12:54:20 UTC (rev 949)
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<Notify
+	xmlns="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd"
+	xmlns:wsrf="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd">
+	<NotificationMessage>
+		<Topic
+			Dialect="http://www.ibm.com/xmlns/stdwip/web-services/WSTopics/TopicExpression/simple">
+			npex:SomeTopic
+		</Topic>
+		<Message>
+			<wsrf:GetResourceProperty xmlns:test="test">
+				test:test
+			</wsrf:GetResourceProperty>
+		</Message>
+	</NotificationMessage>
+</Notify>

Deleted: trunk/ws/jaxws/wsnotification/src/test/resources/org/servicemix/ws/notification/wsn-subscribe-with-envelope.xml (948 => 949)

--- trunk/ws/jaxws/wsnotification/src/test/resources/org/servicemix/ws/notification/wsn-subscribe-with-envelope.xml	2005-11-28 12:17:19 UTC (rev 948)
+++ trunk/ws/jaxws/wsnotification/src/test/resources/org/servicemix/ws/notification/wsn-subscribe-with-envelope.xml	2005-11-28 12:54:20 UTC (rev 949)
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
-  <SOAP:Body>
-	<wsnt:Subscribe
-	        xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing"
-	        xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy"
-	        xmlns:wsnt="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd">
-	
-	  <wsnt:ConsumerReference xmlns:ncex="http://www.consumer.org/RefProp">
-	  	<wsa:ServiceName xmlns:sm="http://jaxws.components.servicemix.org/">
-	  		sm:Consumer
-	  	</wsa:ServiceName>
-	  	<!-- 
-	    <wsa:Address>http://www.producer.org/ProducerEndpoint</wsa:Address>
-	    <wsa:ReferenceProperties>
-	      <ncex:NCResourceId>uuid:9fef5fec-6dc3-44a2-ba32-8680cace43f9</ncex:NCResourceId>
-	    </wsa:ReferenceProperties>
-	    -->
-	  </wsnt:ConsumerReference>
-	  <wsnt:TopicExpression dialect="http://www.ibm.com/xmlns/stdwip/web-services/WSTopics/TopicExpression/simple">npex:SomeTopic</wsnt:TopicExpression>
-	  <wsnt:UseNotify>true</wsnt:UseNotify>
-	  <wsnt:Precondition dialect="http://www.w3.org/TR/1999/REC-xpath-19991116">boolean(ncex:NumberOfBlocks > 20 and
-	    ncex:BlockSize=1024)</wsnt:Precondition>
-	  <wsnt:InitialTerminationTime>2003-12-25T00:00:00.00000Z</wsnt:InitialTerminationTime>
-	</wsnt:Subscribe>
-  </SOAP:Body>
-</SOAP:Envelope>

Modified: trunk/ws/jaxws/wsnotification/src/test/resources/org/servicemix/ws/notification/wsn-subscribe.xml (948 => 949)

--- trunk/ws/jaxws/wsnotification/src/test/resources/org/servicemix/ws/notification/wsn-subscribe.xml	2005-11-28 12:17:19 UTC (rev 948)
+++ trunk/ws/jaxws/wsnotification/src/test/resources/org/servicemix/ws/notification/wsn-subscribe.xml	2005-11-28 12:54:20 UTC (rev 949)
@@ -2,19 +2,19 @@
 <wsnt:Subscribe
         xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing"
         xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy"
-        xmlns:wsnt="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd">
+        xmlns:wsnt="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd"
+       	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+		xsi:schemaLocation="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd
+	                        http://schemas.xmlsoap.org/ws/2002/12/policy http://schemas.xmlsoap org/ws/2002/12/policy
+	                        http://schemas.xmlsoap.org/ws/2003/03/addressing http://schemas.xmlsoap.org/ws/2003/03/addressing">
 
   <wsnt:ConsumerReference xmlns:ncex="http://www.consumer.org/RefProp">
-    <wsa:Address>http://www.producer.org/ProducerEndpoint</wsa:Address>
-    <wsa:ReferenceProperties>
-      <ncex:NCResourceId>uuid:9fef5fec-6dc3-44a2-ba32-8680cace43f9</ncex:NCResourceId>
-    </wsa:ReferenceProperties>
+  	<wsa:ServiceName xmlns:sm="http://jaxws.components.servicemix.org/">
+  		sm:Consumer
+  	</wsa:ServiceName>
   </wsnt:ConsumerReference>
   <wsnt:TopicExpression dialect="http://www.ibm.com/xmlns/stdwip/web-services/WSTopics/TopicExpression/simple">
     npex:SomeTopic</wsnt:TopicExpression>
   <wsnt:UseNotify>true</wsnt:UseNotify>
-  <wsnt:Precondition dialect="http://www.w3.org/TR/1999/REC-xpath-19991116">boolean(ncex:NumberOfBlocks > 20 and
-    ncex:BlockSize=1024)</wsnt:Precondition>
-  <wsnt:Selector dialect="http://www.w3.org/TR/1999/REC-xpath-19991116">boolean(ncex:Producer="15")</wsnt:Selector>
   <wsnt:InitialTerminationTime>2003-12-25T00:00:00.00000Z</wsnt:InitialTerminationTime>
 </wsnt:Subscribe>

Reply via email to