You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pubscribe-commits@ws.apache.org by ip...@apache.org on 2005/10/01 00:31:49 UTC

svn commit: r292867 - in /webservices/pubscribe/trunk/src: examples/filesystem/src/java/example/filesystem/ examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/ java/org/apache/ws/notification/base/impl/ java/org/apache/ws/notificati...

Author: ips
Date: Fri Sep 30 15:31:37 2005
New Revision: 292867

URL: http://svn.apache.org/viewcvs?rev=292867&view=rev
Log:
...

Added:
    webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/Filesystem-TopicSpace.xml
    webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_spring-jndi-config.xml
    webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/impl/NoCurrentMessageOnTopicException.java
    webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/impl/TopicNotSupportedException.java
    webservices/pubscribe/trunk/src/webapp/WEB-INF/classes/spring-jndi-config.xml
Removed:
    webservices/pubscribe/trunk/src/templates/v2004_06/SubscriptionManagerPortType.txt
Modified:
    webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_jndi-config.xml
    webservices/pubscribe/trunk/src/java/org/apache/ws/notification/tool/v2004_06/NotificationProducerPortType2JavaInfo.java
    webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/impl/TopicExpressionEngineImpl.java
    webservices/pubscribe/trunk/src/templates/NotificationProducerResource.txt
    webservices/pubscribe/trunk/src/templates/v2004_06/NotificationConsumerPortType.txt
    webservices/pubscribe/trunk/src/webapp/WEB-INF/web.xml

Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/Filesystem-TopicSpace.xml
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/Filesystem-TopicSpace.xml?rev=292867&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/Filesystem-TopicSpace.xml (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/Filesystem-TopicSpace.xml Fri Sep 30 15:31:37 2005
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+
+<TopicSpace name="FilesystemTopicSpace"
+  targetNamespace="http://ws.apache.org/resource/example/filesystem"
+  xmlns="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-Topics-1.2-draft-01.xsd"
+  xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd">
+  <Topic name="MountPointDirectory" messageTypes="wsrp:ResourcePropertyValueChangeNotification" />
+  <Topic name="Options" messageTypes="wsrp:ResourcePropertyValueChangeNotification" />
+  <Topic name="BackupFrequency" messageTypes="wsrp:ResourcePropertyValueChangeNotification" />
+  <Topic name="FsckPassNumber" messageTypes="wsrp:ResourcePropertyValueChangeNotification" />
+  <Topic name="Comment" messageTypes="wsrp:ResourcePropertyValueChangeNotification" />
+</TopicSpace>

Modified: webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_jndi-config.xml
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_jndi-config.xml?rev=292867&r1=292866&r2=292867&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_jndi-config.xml (original)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_jndi-config.xml Fri Sep 30 15:31:37 2005
@@ -7,6 +7,7 @@
    <service name="filesystem">
       <resource name="home" type="org.apache.ws.resource.example.filesystem.FilesystemHome">
          <resourceParams>
+           
             <parameter>
                <name>baseWebappUrl</name>
                <!-- 
@@ -16,7 +17,7 @@
                	    -NO Marker in which case whatever value you add will be static and used.
                -->
                <value>http://$IP_ADDRESS$:8080/pubscribe</value>
-	    </parameter>         
+	          </parameter>
             <parameter>
                <name>serviceClassName</name>
                <value>org.apache.ws.resource.example.filesystem.FilesystemService</value>
@@ -26,15 +27,9 @@
                <value>org.apache.ws.resource.example.filesystem.FilesystemResource</value>
             </parameter>
             <parameter>
-               <name>wsdlTargetNamespace</name>
-               <value>http://ws.apache.org/resource/example/filesystem</value>
-            </parameter>
-            
-            <parameter>
                <name>resourceIdentifierReferenceParameterName</name>
                <value>{http://ws.apache.org/resource/example/filesystem}ResourceIdentifier</value>
             </parameter>
-            
 
          </resourceParams>
       </resource>

Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_spring-jndi-config.xml
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_spring-jndi-config.xml?rev=292867&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_spring-jndi-config.xml (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_spring-jndi-config.xml Fri Sep 30 15:31:37 2005
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+
+<!-- *** WARNING: This file will be overwritten during generation *** -->
+ 
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+
+<beans>
+
+  <bean name="resource/filesystem" class="org.apache.ws.resource.example.filesystem.FilesystemHome" init-method="init">
+    <property name="serviceClass"><value>org.apache.ws.resource.example.filesystem.FilesystemService</value></property>
+    <property name="resourceClass"><value>org.apache.ws.resource.example.filesystem.FilesystemResource</value></property>
+    <property name="resourceIdentifierReferenceParameterName"><value>{http://ws.apache.org/resource/example/filesystem}ResourceIdentifier</value></property>
+  </bean>
+
+  <bean name="org.apache.ws.resource.example.filesystem.FilesystemResource" class="org.apache.ws.resource.example.filesystem.FilesystemResource" singleton="false">
+    <property name="topicSet">
+      <bean class="org.apache.ws.notification.topics.impl.TopicSetImpl">
+        <constructor-arg>
+          <set>
+            <bean class="org.apache.ws.notification.topics.expression.SimpleTopicExpression">
+              <constructor-arg><value>{http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd}ResourceTermination</value></constructor-arg>
+            </bean>
+            <bean class="org.apache.ws.notification.topics.expression.SimpleTopicExpression">
+              <constructor-arg><value>{http://ws.apache.org/resource/example/filesystem}MountPointDirectory</value></constructor-arg>
+            </bean>
+            <bean class="org.apache.ws.notification.topics.expression.SimpleTopicExpression">
+              <constructor-arg><value>{http://ws.apache.org/resource/example/filesystem}Options</value></constructor-arg>
+            </bean>
+            <bean class="org.apache.ws.notification.topics.expression.SimpleTopicExpression">
+              <constructor-arg><value>{http://ws.apache.org/resource/example/filesystem}BackupFrequency</value></constructor-arg>
+            </bean>
+            <bean class="org.apache.ws.notification.topics.expression.SimpleTopicExpression">
+              <constructor-arg><value>{http://ws.apache.org/resource/example/filesystem}FsckPassNumber</value></constructor-arg>
+            </bean>
+            <bean class="org.apache.ws.notification.topics.expression.SimpleTopicExpression">
+              <constructor-arg><value>{http://ws.apache.org/resource/example/filesystem}Comment</value></constructor-arg>
+            </bean>
+          </set>
+        </constructor-arg>
+      </bean>
+    </property>
+  </bean>
+
+</beans>

Added: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/impl/NoCurrentMessageOnTopicException.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/impl/NoCurrentMessageOnTopicException.java?rev=292867&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/impl/NoCurrentMessageOnTopicException.java (added)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/impl/NoCurrentMessageOnTopicException.java Fri Sep 30 15:31:37 2005
@@ -0,0 +1,32 @@
+/*=============================================================================*
+ *  Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+package org.apache.ws.notification.base.impl;
+
+import org.apache.ws.notification.topics.expression.TopicExpression;
+
+/**
+ * An exception that indicates that the topic expression specified in a GetCurrentMessage
+ * request refers to a topic that has no current message associated with it.
+ */
+public class NoCurrentMessageOnTopicException extends Exception
+{
+
+    public NoCurrentMessageOnTopicException( TopicExpression topicExpr )
+    {
+        super( "The topic identified by the topic expression '" + topicExpr + "' does not have a current message associated with it." );
+    }
+
+}

Added: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/impl/TopicNotSupportedException.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/impl/TopicNotSupportedException.java?rev=292867&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/impl/TopicNotSupportedException.java (added)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/impl/TopicNotSupportedException.java Fri Sep 30 15:31:37 2005
@@ -0,0 +1,32 @@
+/*=============================================================================*
+ *  Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+package org.apache.ws.notification.base.impl;
+
+import org.apache.ws.notification.topics.expression.TopicExpression;
+
+/**
+ * An exception that indicates that the topic expression specified in a GetCurrentMessage
+ * request refers to an unsupported topic.
+ */
+public class TopicNotSupportedException extends Exception
+{
+
+    public TopicNotSupportedException( TopicExpression topicExpr )
+    {
+        super( "The topic identified by the topic expression '" + topicExpr + "' is not supported by this producer resource." );
+    }
+
+}

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/tool/v2004_06/NotificationProducerPortType2JavaInfo.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/tool/v2004_06/NotificationProducerPortType2JavaInfo.java?rev=292867&r1=292866&r2=292867&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/tool/v2004_06/NotificationProducerPortType2JavaInfo.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/tool/v2004_06/NotificationProducerPortType2JavaInfo.java Fri Sep 30 15:31:37 2005
@@ -70,9 +70,7 @@
    }
 
    /**
-    * DOCUMENT_ME
-    *
-    * @return DOCUMENT_ME
+    * @see org.apache.ws.resource.tool.PortType2JavaInfo#getResourceTemplateFileName()
     */
    public String getResourceTemplateFileName(  )
    {

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/impl/TopicExpressionEngineImpl.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/impl/TopicExpressionEngineImpl.java?rev=292867&r1=292866&r2=292867&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/impl/TopicExpressionEngineImpl.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/impl/TopicExpressionEngineImpl.java Fri Sep 30 15:31:37 2005
@@ -46,6 +46,7 @@
 public class TopicExpressionEngineImpl
         implements TopicExpressionEngine
 {
+
     private static final Log LOG = LogFactory.getLog( TopicExpressionEngineImpl.class.getName() );
     private Map m_evaluators = new HashMap();
 
@@ -70,7 +71,7 @@
      * Get the default topic expression engine instance (currently used to hide JNDI lookup details, may change in the
      * future)
      *
-     * @return The default topic expression engine instance
+     * @return the topic expression engine instance
      */
     public static TopicExpressionEngine getInstance()
     {
@@ -81,8 +82,8 @@
         }
         catch ( NamingException ne )
         {
-            LOG.warn( "topicEngineConfigError: " + ne );
-            return new TopicExpressionEngineImpl();
+            // TODO: stick the engine instance into JNDI or static member
+            return new TopicExpressionEngineImpl();  // default
         }
     }
 

Modified: webservices/pubscribe/trunk/src/templates/NotificationProducerResource.txt
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/templates/NotificationProducerResource.txt?rev=292867&r1=292866&r2=292867&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/templates/NotificationProducerResource.txt (original)
+++ webservices/pubscribe/trunk/src/templates/NotificationProducerResource.txt Fri Sep 30 15:31:37 2005
@@ -13,20 +13,32 @@
         m_topicSet = topicSet;
     }
 
-    public void publish( org.apache.ws.notification.topics.expression.TopicExpression topicExpr, Object msg ) throws TopicExpressionException, MessageTypeNotSupportedException
+    public void publish( org.apache.ws.notification.topics.expression.TopicExpression topicExpr,
+                         Object msg )
+           throws org.apache.ws.notification.topics.expression.TopicExpressionException,
+                  org.apache.ws.notification.base.impl.MessageTypeNotSupportedException
     {
         m_producerHelper.publish( topicExpr, msg );
     }
 
-    public EndpointReference subscribe( EndpointReference consumerEPR, org.apache.ws.notification.topics.expression.TopicExpression topicExpr, Boolean useNotify,
-                                        QueryExpression precondition, QueryExpression selector,
-                                        Object subscriptionPolicy, Calendar initialTerminationtime )
-            throws SubscribeCreationFailedException, InvalidTopicExpressionException, TopicPathDialectUnknownException
+    public org.apache.ws.addressing.EndpointReference subscribe( org.apache.ws.addressing.EndpointReference consumerEPR,
+                                                                 org.apache.ws.notification.topics.expression.TopicExpression topicExpr,
+                                                                 Boolean useNotify,
+                                                                 org.apache.ws.resource.properties.query.QueryExpression precondition,
+                                                                 org.apache.ws.resource.properties.query.QueryExpression selector,
+                                                                 Object subscriptionPolicy,
+                                                                 java.util.Calendar initialTerminationtime )
+            throws org.apache.ws.notification.base.impl.SubscribeCreationFailedException,
+                   org.apache.ws.notification.topics.expression.TopicPathDialectUnknownException,
+                   org.apache.ws.notification.topics.expression.InvalidTopicExpressionException
     {
         return m_producerHelper.subscribe( consumerEPR, topicExpr, useNotify, precondition, selector, subscriptionPolicy, initialTerminationtime );
     }
 
-    public Object getCurrentMessage( org.apache.ws.notification.topics.expression.TopicExpression topicExpr ) throws TopicExpressionException
+    public Object getCurrentMessage( org.apache.ws.notification.topics.expression.TopicExpression topicExpr )
+            throws org.apache.ws.notification.topics.expression.InvalidTopicExpressionException,
+                   org.apache.ws.notification.base.impl.TopicNotSupportedException,
+                   org.apache.ws.notification.base.impl.NoCurrentMessageOnTopicException
     {
         return m_producerHelper.getCurrentMessage( topicExpr );
     }

Modified: webservices/pubscribe/trunk/src/templates/v2004_06/NotificationConsumerPortType.txt
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/templates/v2004_06/NotificationConsumerPortType.txt?rev=292867&r1=292866&r2=292867&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/templates/v2004_06/NotificationConsumerPortType.txt (original)
+++ webservices/pubscribe/trunk/src/templates/v2004_06/NotificationConsumerPortType.txt Fri Sep 30 15:31:37 2005
@@ -1,10 +1,9 @@
    /**
-    * notify operation to recieve notifications
+    * Called by producers to send a notification to this consumer.
     *
-    * //TODO: Handle your incoming notifications
+    * TODO: Process your incoming notifications.
     *
-    * @param notifyDocument 
-    *    
+    * @param notifyDocument        
     */
     public abstract void notify(org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.NotifyDocument notifyDocument);
     

Added: webservices/pubscribe/trunk/src/webapp/WEB-INF/classes/spring-jndi-config.xml
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/webapp/WEB-INF/classes/spring-jndi-config.xml?rev=292867&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/webapp/WEB-INF/classes/spring-jndi-config.xml (added)
+++ webservices/pubscribe/trunk/src/webapp/WEB-INF/classes/spring-jndi-config.xml Fri Sep 30 15:31:37 2005
@@ -0,0 +1,60 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+
+<beans>
+
+  <bean name="global/WsrfRuntime" class="org.apache.ws.resource.WsrfRuntime" factory-method="getRuntime">
+    <property name="baseWebappUrl">
+       <!-- 
+	    The value of the baseWebappUrl property may contain the following:
+	     o the marker $IP_ADDRESS$ in which case we will attempt to determine the IP address at runtime. (Do not use on multi-homed systems)
+	     o the marker $HOST_NAME$ in which case we will attempt to determine the host name at runtime
+	     o NO Marker in which case whatever value you add will be static and used.
+       -->
+       <value>http://$IP_ADDRESS$:8080/wsrf</value>    
+    </property>
+  </bean>
+
+  <bean name="global/TopicNamespaceRegistry" class="org.apache.ws.notification.topics.TopicNamespaceRegistry" factory-method="getInstance">
+    <property name="topicNamespaceSet">
+      <set>
+        <value>classpath:org/apache/ws/notification/topics/v2004_06/ResourceLifetime-TopicSpace.xml</value>
+      </set>
+    </property>
+  </bean>
+
+  <bean name="global/TopicExpressionEngine" class="org.apache.ws.notification.topics.expression.impl.TopicExpressionEngineImpl">
+    <constructor-arg>
+      <!-- A map where the keys are TopicExpression dialects and the values are beans that implement
+           the TopicExpressionEvaluator interface AND support the associated dialect -->
+      <map>
+        <entry>
+          <key>
+            <value>http://docs.oasis-open.org/wsn/2004/06/TopicExpression/Simple</value>
+          </key>
+          <bean class="org.apache.ws.notification.topics.expression.impl.SimpleTopicExpressionEvaluator" />
+        </entry>
+        <entry>
+          <key>
+            <value>http://docs.oasis-open.org/wsn/2004/06/TopicExpression/Concrete</value>
+          </key>
+          <bean class="org.apache.ws.notification.topics.expression.impl.ConcreteTopicExpressionEvaluator" />
+        </entry>
+        <entry>
+          <key>
+            <value>http://docs.oasis-open.org/wsn/2004/06/TopicExpression/Full</value>
+          </key>
+          <bean class="org.apache.ws.notification.topics.expression.impl.FullTopicExpressionEvaluator" />
+        </entry>
+      </map>
+    </constructor-arg>
+  </bean>
+
+  <bean name="resource/SubscriptionManager" class="org.apache.ws.notification.base.v2004_06.impl.SubscriptionHome" init-method="init">
+    <property name="serviceClass"><value>org.apache.ws.notification.base.v2004_06.impl.SubscriptionService</value></property>
+    <property name="resourceClass"><value>org.apache.ws.notification.base.v2004_06.impl.SubscriptionResource</value></property>
+    <property name="resourceIdentifierReferenceParameterName"><value>{http://ws.apache.org/notification/base/service/SubscriptionManager}ResourceIdentifier</value></property>
+  </bean>
+
+</beans>

Modified: webservices/pubscribe/trunk/src/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/webapp/WEB-INF/web.xml?rev=292867&r1=292866&r2=292867&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/webapp/WEB-INF/web.xml (original)
+++ webservices/pubscribe/trunk/src/webapp/WEB-INF/web.xml Fri Sep 30 15:31:37 2005
@@ -7,6 +7,18 @@
 
   <display-name>Apache Pubscribe</display-name>
 
+<!--
+  <context-param>
+    <param-name>jndi.config.dialect</param-name>
+    <param-value>http://www.springframework.org/dtd/spring-beans.dtd</param-value>
+  </context-param>
+
+  <context-param>
+    <param-name>jndi.config.location</param-name>
+    <param-value>spring-jndi-config.xml</param-value>
+  </context-param>
+-->
+
   <listener>
     <listener-class>org.apache.ws.resource.webapp.WsrfServletContextListener</listener-class>
   </listener>