You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-commits@ws.apache.org by da...@apache.org on 2006/08/30 04:56:54 UTC

svn commit: r438329 [2/2] - in /webservices/muse/trunk/modules: muse-wsdm-muws-api/src/org/apache/muse/ws/dm/muws/ muse-wsn-api/src/org/apache/muse/ws/notification/ muse-wsn-api/src/org/apache/muse/ws/notification/faults/ muse-wsn-api/src/org/apache/mu...

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/Messages.properties
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/Messages.properties?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/Messages.properties (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/Messages.properties Tue Aug 29 19:56:51 2006
@@ -16,3 +16,6 @@
 PolicyNotSupported=WS-N SubscriptionPolicy is not supported. The policy value was\: XXX
 NullTopicPath=The QName with the topic path is null.
 NullConsumerEPR=The ConsumerReference EPR is null.
+InvalidFilterType=The filter provided is not valid according to the WS-N spec - there is no filter type for element 'XXX'.
+InvalidDialect=Subscription filters do not support the dialect 'XXX'. The supported dialects are: XXX
+LastPublishFailed=The last notification published via wsnt\:Notify failed to reach its destination. The consumer may be unavailable. The original error was: XXX

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/NotificationProducerFilePersistence.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/NotificationProducerFilePersistence.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/NotificationProducerFilePersistence.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/NotificationProducerFilePersistence.java Tue Aug 29 19:56:51 2006
@@ -33,15 +33,53 @@
 import org.apache.muse.ws.notification.WsnConstants;
 import org.apache.muse.ws.resource.WsResource;
 
+/**
+ * 
+ * NotificationProducerFilePersistence is an implementation of file-based 
+ * persistence of subscription resource data. It stores data about current 
+ * subscription resources on disk and then re-loads them after an application 
+ * restarts. This allows the producer resource to continue functioning as it was 
+ * before the restart without the application having to notify all subscribers 
+ * and have them re-subscribe.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
+
 public class NotificationProducerFilePersistence 
     extends AbstractFilePersistence implements NotificationProducerPersistence
 {
     private NotificationProducer _producer = null;
     
+    protected void createResourceFile(EndpointReference epr, Resource resource, File resourceFile) 
+        throws SoapFault
+    {
+        //
+        // write subscription ws-rp doc to file
+        //
+        SubscriptionManager sub = (SubscriptionManager)resource.getCapability(WsnConstants.SUBSCRIPTION_MGR_URI);
+        Element subXML = sub.toXML();
+        
+        try
+        {
+            XmlUtils.toFile(subXML, resourceFile);
+        }
+        
+        catch (IOException error)
+        {
+            throw new SoapFault(error);
+        }
+    }
+    
     protected String getFilePrefix()
     {
         return "subscription-";
     }
+
+    public NotificationProducer getNotificationProducer()
+    {
+        return _producer;
+    }
     
     protected Resource reloadResource(String contextPath, Element resourceXML) 
         throws SoapFault
@@ -80,39 +118,17 @@
         
         return subResource;
     }
-
-    protected void createResourceFile(EndpointReference epr, Resource resource, File resourceFile) 
-        throws SoapFault
-    {
-        SubscriptionManager sub = (SubscriptionManager)resource.getCapability(WsnConstants.SUBSCRIPTION_MGR_URI);
-        Element subXML = sub.toXML();
-        
-        try
-        {
-            XmlUtils.toFile(subXML, resourceFile);
-        }
-        
-        catch (IOException error)
-        {
-            throw new SoapFault(error);
-        }
-    }
     
     public void resourceAdded(EndpointReference epr, Resource resource) 
         throws SoapFault
     {
         createResourceFile(epr, resource);
     }
-    
+
     public void resourceRemoved(EndpointReference epr)
         throws SoapFault
     {
         destroyResourceFile(epr);
-    }
-
-    public NotificationProducer getNotificationProducer()
-    {
-        return _producer;
     }
 
     public void setNotificationProducer(NotificationProducer producer)

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/ProducerPropertiesFilter.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/ProducerPropertiesFilter.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/ProducerPropertiesFilter.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/ProducerPropertiesFilter.java Tue Aug 29 19:56:51 2006
@@ -20,19 +20,45 @@
 import org.w3c.dom.Element;
 
 import org.apache.muse.util.LoggingUtils;
+import org.apache.muse.util.messages.Messages;
+import org.apache.muse.util.messages.MessagesFactory;
 import org.apache.muse.util.xml.XPathUtils;
 import org.apache.muse.util.xml.XmlUtils;
 import org.apache.muse.ws.notification.Filter;
 import org.apache.muse.ws.notification.NotificationMessage;
 import org.apache.muse.ws.notification.WsnConstants;
-import org.apache.muse.ws.notification.faults.InvalidProducerPropertiesExpressionFault;
+import org.apache.muse.ws.notification.faults.*;
 import org.apache.muse.ws.resource.WsResource;
 import org.apache.muse.ws.resource.properties.ResourcePropertyCollection;
 
+/**
+ * 
+ * ProducerPropertiesFilter is the implementation of resource property filters 
+ * for WS-N subscriptions. The filter objects need a reference to the producer 
+ * resource so that they can read current property values each time the filter 
+ * is evaluated. This filter is different from others in that it doesn't 
+ * evaluate the message content; rather, it evalutes the resource's current 
+ * WS-RP document in order to decide if it should send the message.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
+
 public class ProducerPropertiesFilter implements Filter
 {
+    //
+    // Used to look up all exception messages
+    //
+    private static Messages _MESSAGES = MessagesFactory.get(ProducerPropertiesFilter.class);
+    
+    //
+    // the resource whose ws-rp doc is being evaluated by the filter
+    //
     private WsResource _resource = null;
     
+    //
+    // xpath expression to evaluate on the ws-rp doc
+    //
     private String _expression = null;
     
     public ProducerPropertiesFilter(WsResource resource, 
@@ -40,15 +66,24 @@
                                     String dialect) 
         throws InvalidProducerPropertiesExpressionFault
     {
+        //
+        // we only support xpath
+        //
         if (!dialect.equals(XPathUtils.NAMESPACE_URI))
-            throw new InvalidProducerPropertiesExpressionFault("Invalid dialect: " + dialect);
-        
+        {
+            Object[] filler = { dialect, XPathUtils.NAMESPACE_URI };
+            throw new InvalidProducerPropertiesExpressionFault(_MESSAGES.get("InvalidDialect", filler));
+        }
         _resource = resource;
         _expression = expression;
     }
     
     public boolean accepts(NotificationMessage message)
     {
+        //
+        // evaluate the xpath over the resource's current ws-rp doc - if the 
+        // result is 'true', we publish the message
+        //
         try
         {
             ResourcePropertyCollection props = _resource.getPropertyCollection();

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/PublishAllMessagesFilter.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/PublishAllMessagesFilter.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/PublishAllMessagesFilter.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/PublishAllMessagesFilter.java Tue Aug 29 19:56:51 2006
@@ -19,10 +19,25 @@
 import org.apache.muse.util.xml.XPathUtils;
 import org.apache.muse.ws.notification.faults.InvalidMessageContentExpressionFault;
 
+/**
+ * 
+ * PublishAllMessagesFilter is a specialied MessagePatternFilter that matches 
+ * all messages by using a wildcard XPath ('*'). It is a singleton because 
+ * the XPath pattern is static and the filter evaluation is stateless.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
+
 public class PublishAllMessagesFilter extends MessagePatternFilter
 {
     private static PublishAllMessagesFilter _SINGLETON = null;
     
+    /**
+     * 
+     * Initializes the MessagePatternFilter class with the XPath expression '*'.
+     *
+     */
     private PublishAllMessagesFilter() 
         throws InvalidMessageContentExpressionFault
     {

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleNotificationConsumer.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleNotificationConsumer.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleNotificationConsumer.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleNotificationConsumer.java Tue Aug 29 19:56:51 2006
@@ -42,7 +42,7 @@
 
 public class SimpleNotificationConsumer 
     extends AbstractCapability implements NotificationConsumer
-{
+{    
     //
     // Event consumers, ordered by WS-N SimpleTopic
     //
@@ -63,17 +63,19 @@
     {
         super.initialize();
         
+        //
+        // add NotificationMessage to the collection of serializable types in 
+        // case the user forgot to put it in muse.xml
+        //
         SerializerRegistry registry = SerializerRegistry.getInstance();
         registry.registerSerializer(NotificationMessage.class, new NotificationMessageSerializer());
     }
     
     /**
      * 
-     * {@inheritDoc}
-     * <br><br>
-     * This implementation keeps TopicConsumers that share a SimpleTopic in an 
-     * ordered list. If there are multiple consumers for a SimpleTopic, they 
-     * will be notified in the order that they were added to the collection.
+     * This implementation spawns a thread to handle the passing of the message 
+     * to the message listeners so that the method can return immediately and 
+     * speed up the notification process for the reporter.
      * 
      */
     public void notify(NotificationMessage[] messages)
@@ -87,6 +89,14 @@
         _messageListeners.remove(listener);
     }
     
+    /**
+     * 
+     * NotifyThread is a simple thread that iterates over the collection of 
+     * message listeners and provides the latest message to each of them.
+     *
+     * @author Dan Jemiolo (danj)
+     *
+     */
     private class NotifyThread extends Thread
     {
         private NotificationMessage[] _messages = null;
@@ -115,8 +125,7 @@
                     catch (Throwable error)
                     {
                         Logger log = getLog();
-                        LoggingUtils.logError(log, error); // FIXME: extract message
-                        log.info("The last listener faulted while processing the current message - continuing to other listeners.");
+                        LoggingUtils.logError(log, error);
                     }
                 }
             }

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleNotificationMessage.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleNotificationMessage.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleNotificationMessage.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleNotificationMessage.java Tue Aug 29 19:56:51 2006
@@ -31,19 +31,21 @@
 import org.apache.muse.core.serializer.SerializerRegistry;
 import org.apache.muse.util.messages.Messages;
 import org.apache.muse.util.messages.MessagesFactory;
+import org.apache.muse.util.xml.XPathUtils;
 import org.apache.muse.util.xml.XmlSerializable;
 import org.apache.muse.util.xml.XmlUtils;
 import org.apache.muse.ws.addressing.EndpointReference;
 import org.apache.muse.ws.notification.NotificationMessage;
 import org.apache.muse.ws.notification.WsnConstants;
+import org.apache.muse.ws.notification.faults.TopicExpressionDialectUnknownFault;
 import org.apache.muse.ws.notification.topics.WstConstants;
 import org.apache.muse.ws.addressing.soap.SoapFault;
 
 /**
  *
- * SimpleNotificationMessage is a simple container that represents the WS-Notification 
- * SimpleNotificationMessage type. It provides serialization capabilities for these 
- * messages and validation of their contents.
+ * SimpleNotificationMessage is Muse's default implementation of the WS-Notification 
+ * NotificationMessageHolderType type. It provides serialization capabilities for 
+ * these messages and validation of their contents.
  *
  * @author Dan Jemiolo (danj)
  *
@@ -51,6 +53,9 @@
 
 public class SimpleNotificationMessage implements XmlSerializable, NotificationMessage
 {
+    //
+    // Used to look up all exception messages
+    //
     private static Messages _MESSAGES = MessagesFactory.get(SimpleNotificationMessage.class);
     
     private Map _messageContent = new LinkedHashMap();
@@ -65,8 +70,7 @@
      * 
      * The default constructor provides no initialization, allowing users 
      * to create messages in an 'aseembly line' system, where pieces of 
-     * the messages are added by different components (i.e., GLA, Muse) 
-     * before being published. 
+     * the messages are added by different components before being published. 
      *
      */
     public SimpleNotificationMessage() 
@@ -81,11 +85,6 @@
      *
      * @param root
      *        A DOM Element representing a WS-N SimpleNotificationMessage
-     * 
-     * @throws SoapFault
-     *         <ul>
-     *         <li>If the XML does not conform to the SimpleNotificationMessage schema.</li>
-     *         </ul>
      *
      */
     public SimpleNotificationMessage(Element root)
@@ -132,22 +131,6 @@
         _messageContent.put(name, content);
     }
     
-    /**
-     * 
-     * This method allows you to add message content that has not yet been 
-     * serialized into XML. The content object must be of a type that has 
-     * a Muse Serializer registered for it; these types include all of 
-     * the base/built-in types plus those that had serializers registered 
-     * for them in touchpoint.xml.
-     *
-     * @param content
-     * @param qname
-     * 
-     * @throws SoapFault
-     * 
-     * @see Serializer
-     *
-     */
     public void addMessageContent(QName qname, Object content)
         throws SoapFault
     {
@@ -169,16 +152,6 @@
         return (Element)_messageContent.get(qname);
     }
     
-    /**
-     * 
-     * This method allows you to read message content as a POJO rather than 
-     * XML. The content class type must be one that has a Muse Serializer 
-     * registered for it; these types include all of the base/built-in types 
-     * plus those that had serializers registered for them in touchpoint.xml.
-     *  
-     * @see Serializer
-     *
-     */
     public Object getMessageContent(QName qname, Class type)
         throws SoapFault
     {
@@ -244,10 +217,14 @@
         _topicPath = topicPath;
     }
     
-    public void setTopicDialect(String dialect)
+    public void setTopicDialect(String dialect) 
+        throws TopicExpressionDialectUnknownFault
     {
-        if (!dialect.equals(WstConstants.CONCRETE_TOPIC_URI)) // FIXME: message
-            throw new UnsupportedOperationException("Invalid topic dialect");
+        if (!dialect.equals(WstConstants.CONCRETE_TOPIC_URI))
+        {
+            Object[] filler = { dialect, XPathUtils.NAMESPACE_URI };
+            throw new TopicExpressionDialectUnknownFault(_MESSAGES.get("InvalidDialect", filler));
+        }
     }
 
     public String toString()

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleNotificationProducer.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleNotificationProducer.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleNotificationProducer.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleNotificationProducer.java Tue Aug 29 19:56:51 2006
@@ -64,8 +64,8 @@
  * WS-Notification NotificationProducer port type.
  * <br><br>
  * Resources that implement this port type should be deployed with the 
- * {@linkplain SubscriptionManager SubscriptionManager} type as well; the subscription 
- * resources cannot be managed without this endpoint.
+ * {@linkplain SubscriptionManager SubscriptionManager} type as well; the 
+ * subscription resources cannot be managed without this endpoint.
  *
  * @author Dan Jemiolo (danj)
  *
@@ -77,19 +77,33 @@
     //
     // Used to lookup all exception messages
     //
-    private static Messages _MESSAGES = 
-        MessagesFactory.get(SimpleNotificationProducer.class);
+    private static Messages _MESSAGES = MessagesFactory.get(SimpleNotificationProducer.class);
     
     private static final String _TOPIC_SET_PARAM = "topic-set";
     
+    //
+    // all topic names in the topic set - not a hierarchical collection
+    //
     private Set _allTopicNames = new HashSet();
     
+    //
+    // factory that will provide WSRP notifications with the right wrapper
+    //
     private ChangeNotificationListenerFactory _listenerFactory = null;
     
+    //
+    // context path of the subscription manager resource type
+    //
     private String _subscriptionPath = null;
     
+    //
+    // EPR -> current subscriptions
+    //
     private Map _subscriptionsByEPR = new HashMap();
     
+    //
+    // hierarchical topic set supported by the resource
+    //
     private TopicSet _topicSet = new SimpleTopicSet();
     
     public synchronized void addSubscription(WsResource sub)
@@ -120,11 +134,25 @@
         Topic topic = new SimpleTopic(localName, topicSpace);
         topicSpace.addTopic(topic);
         
+        //
+        // add to our collection of names as well as the topic set tree
+        //
         _allTopicNames.add(topicName);
         
         return topic;
     }
     
+    public TopicNamespace addTopicNamespace(String namespace)
+        throws BaseFault
+    {
+        TopicNamespace topics = new SimpleTopicNamespace(namespace);
+        topics.setName(WsrpConstants.TOPIC_SPACE_NAME);
+        
+        _topicSet.addTopicNamespace(topics);
+        
+        return topics;
+    }
+    
     protected void addTopics(Element topicTree, 
                              String namespace, 
                              String prefix) 
@@ -139,22 +167,28 @@
             addTopics(children[n], namespace, prefix);
     }
     
-    public TopicNamespace addTopicNamespace(String namespace)
-        throws BaseFault
-    {
-        TopicNamespace topics = new SimpleTopicNamespace(namespace);
-        topics.setName(WsrpConstants.TOPIC_SPACE_NAME);
-        
-        _topicSet.addTopicNamespace(topics);
-        
-        return topics;
-    }
-    
+    /**
+     * 
+     * Users can override this method to provide an alternative implementation 
+     * of ChangeNotificationListenerFactory that wraps WS-RP change notifications 
+     * in a different set of XML content.
+     * 
+     * @return An instance of WsrpNotificationListenerFactory
+     *
+     */
     protected ChangeNotificationListenerFactory createNotificationListenerFactory()
     {
         return new WsrpNotificationListenerFactory();
     }
     
+    /**
+     * 
+     * Users can override this method to provide an alternative implementation 
+     * of NotificationMessage.
+     *
+     * @return An instance of SimpleNotificationMessage
+     *
+     */
     protected NotificationMessage createNotificationMessage()
     {
         return new SimpleNotificationMessage();
@@ -328,6 +362,10 @@
         
         ChangeNotificationListenerFactory factory = getNotificationListenerFactory();
         
+        //
+        // for every property in the resource's ws-rp doc, create a property 
+        // change listener that will send out notifications for each change
+        //
         WsResource resource = getWsResource();
         ResourcePropertyCollection props = resource.getPropertyCollection();
         Iterator i = props.getPropertyNames().iterator();
@@ -343,6 +381,10 @@
             props.addChangeListener(listener);
         }
         
+        //
+        // if the resource supports either WS-RL capability, add support 
+        // for the WS-RL termination topic
+        //
         if (resource.hasCapability(WsrlConstants.IMMEDIATE_TERMINATION_URI) || 
             resource.hasCapability(WsrlConstants.SCHEDULED_TERMINATION_URI))
         {
@@ -372,12 +414,19 @@
     public void publish(QName topicName, Element content)
         throws SoapFault
     {
+        //
+        // construct the message/payload
+        //
         NotificationMessage message = createNotificationMessage();
         message.addMessageContent(content);
         
         message.setTopic(topicName);
         message.setProducerReference(getResource().getEndpointReference());
         
+        //
+        // give the message to each subscription so it can decide if it 
+        // should be sent or not
+        //
         Iterator i = getSubscriptions().iterator();
         
         while (i.hasNext())
@@ -385,6 +434,16 @@
             SubscriptionManager sub = (SubscriptionManager)i.next();
             sub.publish(message);
         }
+        
+        //
+        // if a topic was used, record the message as the 'current' message 
+        // for the topic (will be returned by getCurrentMessage())
+        //
+        if (topicName != null)
+        {
+            Topic topic = getTopic(topicName);
+            topic.setCurrentMessage(message);
+        }
     }
     
     public void publish(QName topicName, XmlSerializable content)
@@ -400,10 +459,6 @@
 
     public void resourceAdded(EndpointReference epr, Resource resource)
     {
-        //
-        // this call is synchronized, so if we're publishing, the 
-        // collection will not be updated until afterwards
-        //
         if (resource.hasCapability(WsnConstants.SUBSCRIPTION_MGR_URI))
         {
             addSubscription((WsResource)resource);
@@ -456,6 +511,10 @@
         if (consumer == null)
             throw new NullPointerException(_MESSAGES.get("NullConsumerEPR"));
         
+        //
+        // sanity check - the message handler should do this, but we handle 
+        // null filters just in case
+        //
         if (filter == null)
             filter = PublishAllMessagesFilter.getInstance();
         
@@ -497,6 +556,9 @@
             throw new SubscribeCreationFailedFault(error);
         }
         
+        //
+        // use the subscription capability to set all the subscription fields
+        //
         SubscriptionManager subMgr = 
             (SubscriptionManager)sub.getCapability(WsnConstants.SUBSCRIPTION_MGR_URI);
         

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimplePullPoint.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimplePullPoint.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimplePullPoint.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimplePullPoint.java Tue Aug 29 19:56:51 2006
@@ -21,6 +21,7 @@
 import org.apache.muse.ws.notification.Filter;
 import org.apache.muse.ws.notification.NotificationConsumer;
 import org.apache.muse.ws.notification.NotificationMessage;
+import org.apache.muse.ws.notification.NotificationMessageListener;
 import org.apache.muse.ws.notification.PullPoint;
 import org.apache.muse.ws.notification.PullPointDataStore;
 import org.apache.muse.ws.notification.WsnConstants;
@@ -28,20 +29,52 @@
 import org.apache.muse.ws.resource.WsResource;
 import org.apache.muse.ws.resource.impl.AbstractWsResourceCapability;
 
+/**
+ * 
+ * SimplePullPoint is Muse's default implementation of the WS-Notification 
+ * PullPoint port type and the data store API that augments it. Users that 
+ * want to change the way that messages are stored should override the 
+ * createDataStore() method to return an alternate implementation of the 
+ * {@linkplain PullPointDataStore PullPointDataStore API}. The default 
+ * implementation is {@linkplain SimplePullPointDataStore SimplePullPointDataStore}.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
 
 public class SimplePullPoint 
-    extends AbstractWsResourceCapability implements PullPoint
+    extends AbstractWsResourceCapability implements PullPoint, NotificationMessageListener
 {
+    //
+    // the place where we keep messages until a client asks for them
+    //
     private PullPointDataStore _dataStore = null;
     
+    //
+    // the subscription that is sending messages to our pullpoint
+    //
     private WsResource _subscription = null;
     
+    /**
+     * 
+     * @return True if the message has a subscription EPR that matches our 
+     *         subscription's EPR
+     *         
+     */
     public boolean accepts(NotificationMessage message)
     {
         EndpointReference subEPR = message.getSubscriptionReference();
         return subEPR != null && getSubscription().equals(subEPR);
     }
     
+    /**
+     * 
+     * Users can override this method to provide an alternate implementation 
+     * of the PullPointDataStore API.
+     *
+     * @return An instance of SimplePullPointDataStore
+     *
+     */
     protected PullPointDataStore createDataStore()
     {
         return new SimplePullPointDataStore();
@@ -52,6 +85,12 @@
         return _dataStore;
     }
     
+    /**
+     * 
+     * @return An instance of PublishAllMessagesFilter. This allows the pullpoint 
+     *         to add all messages to its data store.
+     * 
+     */
     public Filter getFilter()
     {
         return PublishAllMessagesFilter.getInstance();
@@ -76,6 +115,9 @@
         _dataStore = createDataStore();
         _dataStore.initialize();
         
+        //
+        // register for messages so we can add them to the data store
+        //
         NotificationConsumer wsn = (NotificationConsumer)getResource().getCapability(WsnConstants.CONSUMER_URI);
         wsn.addMessageListener(this);
     }

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimplePullPointCreation.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimplePullPointCreation.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimplePullPointCreation.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimplePullPointCreation.java Tue Aug 29 19:56:51 2006
@@ -29,10 +29,25 @@
 import org.apache.muse.ws.resource.basefaults.BaseFault;
 import org.apache.muse.ws.resource.impl.AbstractWsResourceCapability;
 
+/**
+ * 
+ * SimplePullPointCreation is Muse's default implementation of the 
+ * WS-Notification PullPointCreation port type.
+ * <br><br>
+ * Resources that implement this port type should be deployed with the 
+ * {@linkplain PullPoint PullPoint} type as well; the pullpoint resources 
+ * cannot be managed without this endpoint.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
 
 public class SimplePullPointCreation 
     extends AbstractWsResourceCapability implements PullPointCreation
 {
+    //
+    // context path of the pullpoint resource type
+    //
     private String _pullPointPath = null;
     
     public EndpointReference createPullPoint() 
@@ -41,7 +56,7 @@
         ResourceManager manager = getResource().getResourceManager();
         
         //
-        // create the resource to represent the subscription
+        // create the resource to represent the pullpoint
         //
         String endpoint = getPullPointContextPath();
         WsResource pullPoint = null;
@@ -61,6 +76,9 @@
         PullPoint pullPointCap = (PullPoint)pullPoint.getCapability(WsnConstants.PULL_POINT_URI);
         Filter filter = pullPointCap.getFilter();
         
+        //
+        // create subscription that will send messages to the pullpoint
+        //
         NotificationProducer wsn = (NotificationProducer)getResource().getCapability(WsnConstants.PRODUCER_URI);
         WsResource sub = null;
         
@@ -76,6 +94,20 @@
         
         pullPointCap.setSubscription(sub);
         
+        //
+        // initialize pullpoint to complete creation process
+        //
+        try
+        {
+            pullPoint.initialize();
+            manager.addResource(epr, pullPoint);
+        }
+        
+        catch (SoapFault error)
+        {
+            throw new UnableToCreatePullPointFault(error);
+        }
+        
         return epr;        
     }
     
@@ -89,7 +121,8 @@
         super.initialize();
         
         //
-        // find subscription manager so we can subscribe upon creation
+        // find pullpoint resource type so we can create instances of it 
+        // in createPullPoint()
         //
         ResourceManager manager = getResource().getResourceManager();
         _pullPointPath = manager.getResourceContextPath(PullPoint.class);

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimplePullPointDataStore.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimplePullPointDataStore.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimplePullPointDataStore.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimplePullPointDataStore.java Tue Aug 29 19:56:51 2006
@@ -23,13 +23,33 @@
 import org.apache.muse.ws.notification.NotificationMessage;
 import org.apache.muse.ws.notification.PullPointDataStore;
 
+/**
+ * 
+ * SimplePullPointDataStore is an in-memory container for messages received by 
+ * a pullpoint resource. It stores messages in a linked hash set so that they 
+ * can be retrieved in order in O(1) time. There is no maximum size for the 
+ * collection, so footprint of the application could easily get out-of-hand 
+ * unless the user provides additional logic to handle this (although it is 
+ * not clear what else could be done aside from dropping messages). A better 
+ * implementation would rely on a persistent data store and asynchronous 
+ * additions and deletions.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
+
 public class SimplePullPointDataStore implements PullPointDataStore
 {
     private boolean _hasBeenInitialized = false;
+    
     private boolean _hasBeenShutdown = false;
-        
-    private Set _messages = new LinkedHashSet();
     
+    //
+    // use a linked hash set so that insertion/deletion is O(1) while still 
+    // allowing us to maintain order for getMessages()
+    //
+    private Set _messages = new LinkedHashSet();
+
     public synchronized void addMessage(NotificationMessage message)
     {
         _messages.add(message);
@@ -39,12 +59,18 @@
     {
         int currentSize = _messages.size();
         
+        //
+        // make sure we don't take more than we have
+        //
         if (currentSize < maxNumber)
             maxNumber = currentSize;
         
         NotificationMessage[] results = new NotificationMessage[maxNumber];
         Iterator i = _messages.iterator();
         
+        //
+        // delete from the list so messages aren't returned twice
+        //
         for (int n = 0; n < maxNumber; ++n)
         {
             results[n] = (NotificationMessage)i.next();

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleSubscriptionManager.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleSubscriptionManager.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleSubscriptionManager.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleSubscriptionManager.java Tue Aug 29 19:56:51 2006
@@ -36,26 +36,18 @@
 import org.apache.muse.ws.notification.WsnConstants;
 import org.apache.muse.ws.notification.remote.NotificationConsumerClient;
 import org.apache.muse.ws.resource.impl.AbstractWsResourceCapability;
-import org.apache.muse.ws.resource.lifetime.WsrlConstants;
 import org.apache.muse.ws.addressing.soap.SoapFault;
 
 /**
  *
  * SimpleSubscriptionManager is Muse's default implementation of the 
- * SubscriptionManager resource type (WS-N's SubscriptionManager). This class is 
- * exposed as a first-class resource to web service clients. It extends 
- * the {@linkplain AbstractWsResourceCapability basic resource capability} 
- * defined by Muse and adds support for the SubscriptionManager properties.
+ * WS-Notification SubscriptionManager port type. It uses the 
+ * {@linkplain NotificationConsumerClient NotificationConsumerClient class} 
+ * to send messages to its subscribers. It also provides an initialization 
+ * flag, <em>trace-notifications</em> that allows users to turn on tracing 
+ * for the outgoing notification messages (the default is 'false').
  * <br><br>
- * Please refer to {@linkplain SubscriptionManager this documentation} for notes 
- * about the relationship between SimpleTopic and SimpleSubscriptionManager, and how 
- * users should publish messages to subscribers.
- * <br><br>
- * <b>NOTE:</b> This class does not support the optional filtering 
- * capabilities for subscribers (preconditions, selectors, or policy); 
- * when Muse is upgraded to WS-N 1.3, the subscription interface will 
- * be simplified and have a more robust filtering API, so users should 
- * not make too much investment in the current filtering interface.
+ * This implementation does not support subscription policies.
  *
  * @author Dan Jemiolo (danj)
  *
@@ -64,18 +56,24 @@
 public class SimpleSubscriptionManager 
     extends AbstractWsResourceCapability implements SubscriptionManager
 {
-    private static final String _TRACE_PARAM = "trace-notifications";
-    
     //
     // Used to lookup all exception messages
     //
     private static Messages _MESSAGES = MessagesFactory.get(SimpleSubscriptionManager.class);
     
     //
+    // init. param used to turn on SOAP tracing for notifications
+    //
+    private static final String _TRACE_PARAM = "trace-notifications";
+    
+    //
     // The client that is used to publish messages to the consumer
     //
     private NotificationConsumerClient _client = null;
     
+    //
+    // EPR of the resource receiving our messages
+    //
     private EndpointReference _consumer = null;
     
     //
@@ -92,16 +90,18 @@
     
     private boolean _isUsingTrace = false;
     
+    //
+    // EPR of the resource using this capability
+    //
     private EndpointReference _producer = null;
 
     /**
      * 
-     * <b>Plug-In Point:</b> This is a factory method that creates the 
-     * actual proxy used to send out notifications. It can be overridden 
-     * to provide a different implementation of the WS-N proxy class 
-     * without changing the implementation of subscription management.
+     * Users can override this method to provide a different implementation of 
+     * the WS-N client class without changing the implementation of subscription 
+     * management.
      *
-     * @return This implementation returns an instance of NotificationConsumerClient.
+     * @return An instance of NotificationConsumerClient.
      *
      */
     protected NotificationConsumerClient createConsumerClient()
@@ -154,16 +154,6 @@
      * This implementation always returns null.
      * 
      */
-    public String getSelector()
-    {
-        return null;
-    }
-    
-    /**
-     * 
-     * This implementation always returns null.
-     * 
-     */
     public Policy getSubscriptionPolicy()
     {
         return null;
@@ -174,23 +164,23 @@
     {
         super.initialize();
         
-        if (!getResource().hasCapability(WsrlConstants.SCHEDULED_TERMINATION_URI))
-            throw new IllegalStateException("Subscriptions must support WSRL ScheduledTermination");
-        
+        //
+        // turn on tracing for notifications, if desired
+        //
         String traceString = getInitializationParameter(_TRACE_PARAM);
         
         if (traceString != null)
             _isUsingTrace = Boolean.valueOf(traceString).booleanValue();
     }
     
-    protected boolean isUsingTrace()
+    public synchronized boolean isPaused()
     {
-        return _isUsingTrace;
+        return _isPaused;
     }
     
-    public synchronized boolean isPaused()
+    protected boolean isUsingTrace()
     {
-        return _isPaused;
+        return _isUsingTrace;
     }
     
     public synchronized void pauseSubscription()
@@ -211,8 +201,14 @@
         
         catch (SoapFault error)
         {
-            LoggingUtils.logError(getLog(), error); // FIXME: extract message
-            getLog().info("The last message failed to publish - sending next message.");
+            //
+            // log the error and include a follow up message to 
+            // provide some context
+            //
+            LoggingUtils.logError(getLog(), error);
+            
+            Object[] filler = { error.getMessage() };
+            getLog().info(_MESSAGES.get("LastPublishFailed", filler));
         }
     }
     

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/Subscribe.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/Subscribe.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/Subscribe.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/Subscribe.java Tue Aug 29 19:56:51 2006
@@ -46,6 +46,9 @@
 
 public class Subscribe implements XmlSerializable
 {
+    //
+    // Used to look up all exception messages
+    //
     private static Messages _MESSAGES = MessagesFactory.get(Subscribe.class);
     
     private EndpointReference _consumer = null;
@@ -113,21 +116,27 @@
     
     protected String getDialect(String name)
     {
+        //
+        // concrete expressions will be paths/with/slashes
+        //
         return name.indexOf('/') >= 0 ? WstConstants.CONCRETE_TOPIC_URI : WstConstants.SIMPLE_TOPIC_URI;
     }
     
-    public Date getTerminationTime()
+    public Filter getFilter()
     {
-        return _terminationTime;
+        return _filter;
     }
     
-    public Filter getFilter()
+    public Date getTerminationTime()
     {
-        return _filter;
+        return _terminationTime;
     }
     
     public Object[] toArray()
     {
+        //
+        // use null for the policy - our impl doesn't support policy
+        //
         return new Object[]{ 
             getConsumerReference(), getFilter(), getTerminationTime(), null 
         };

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SubscribeHandler.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SubscribeHandler.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SubscribeHandler.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SubscribeHandler.java Tue Aug 29 19:56:51 2006
@@ -32,7 +32,7 @@
  * 
  * @author Dan Jemiolo (danj)
  * 
- * @see org.apache.muse.ws.notification.NotificationProducer
+ * @see org.apache.muse.ws.notification.impl.SimpleNotificationProducer
  * 
  */
 
@@ -58,8 +58,14 @@
     {
         WsResource sub = (WsResource)result;
         
+        //
+        // add termination time to the response, if it exists
+        //
         ScheduledTermination wsrl = (ScheduledTermination)sub.getCapability(WsrlConstants.SCHEDULED_TERMINATION_URI);
-        Date time = wsrl.getTerminationTime();
+        Date time = null;
+        
+        if (wsrl != null)
+            time = wsrl.getTerminationTime();
         
         SubscribeResponse response = new SubscribeResponse(sub, time);
         return response.toXML();

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SubscribeResponse.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SubscribeResponse.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SubscribeResponse.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SubscribeResponse.java Tue Aug 29 19:56:51 2006
@@ -44,6 +44,9 @@
 
 public class SubscribeResponse implements XmlSerializable
 {
+    //
+    // Used to look up all exception messages
+    //
     private static Messages _MESSAGES = MessagesFactory.get(SubscribeResponse.class);
     
     private Date _currentTime = new Date();

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/TopicFilter.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/TopicFilter.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/TopicFilter.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/TopicFilter.java Tue Aug 29 19:56:51 2006
@@ -21,17 +21,35 @@
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
+import org.apache.muse.util.messages.Messages;
+import org.apache.muse.util.messages.MessagesFactory;
+import org.apache.muse.util.xml.XPathUtils;
 import org.apache.muse.util.xml.XmlUtils;
 import org.apache.muse.ws.notification.Filter;
 import org.apache.muse.ws.notification.NotificationMessage;
 import org.apache.muse.ws.notification.WsnConstants;
-import org.apache.muse.ws.notification.faults.InvalidTopicExpressionFault;
-import org.apache.muse.ws.notification.faults.TopicExpressionDialectUnknownFault;
+import org.apache.muse.ws.notification.faults.*;
 import org.apache.muse.ws.notification.topics.WstConstants;
 import org.apache.muse.ws.notification.topics.impl.ConcretePathExpression;
 
+/**
+ * 
+ * TopicFilter is the implementation of topic-based filters for WS-N subscriptions. 
+ * All messages that have a wsnt:Topic field that matches the filter's topic 
+ * will be sent to subscribers. Only simple and concrete topic expressions are 
+ * supported by this filter.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
+
 public class TopicFilter implements Filter
 {
+    //
+    // Used to look up all exception messages
+    //
+    private static Messages _MESSAGES = MessagesFactory.get(TopicFilter.class);
+    
     private QName _topicName = null;
     
     public TopicFilter(QName topicName) 
@@ -45,9 +63,15 @@
         throws TopicExpressionDialectUnknownFault, 
                InvalidTopicExpressionFault
     {
+        //
+        // we only support simple and concrete topic expressions
+        //
         if (!dialect.equals(WstConstants.SIMPLE_TOPIC_URI) && 
             !dialect.equals(WstConstants.CONCRETE_TOPIC_URI))
-            throw new TopicExpressionDialectUnknownFault("Invalid dialect: " + dialect);
+        {
+            Object[] filler = { dialect, XPathUtils.NAMESPACE_URI };
+            throw new TopicExpressionDialectUnknownFault(_MESSAGES.get("InvalidDialect", filler));
+        }
         
         ConcretePathExpression.validateTopicPath(topicName);
         

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/properties/ChangeNotificationListener.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/properties/ChangeNotificationListener.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/properties/ChangeNotificationListener.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/properties/ChangeNotificationListener.java Tue Aug 29 19:56:51 2006
@@ -25,32 +25,17 @@
 import org.apache.muse.ws.resource.basefaults.BaseFault;
 import org.apache.muse.ws.resource.basefaults.WsbfUtils;
 import org.apache.muse.ws.resource.properties.listeners.PropertyChangeListener;
-import org.apache.muse.ws.resource.properties.listeners.ResourcePropertyListeners;
 
 /**
  *
- * ChangeNotificationListener is a 
- * {@linkplain PropertyChangeListener PropertyChangeListener} that reports 
- * changes in a resource property to the equivalent WS-N SimpleTopic that is used 
- * to publish such changes to subscribers. This listener adds the property 
- * change to the set of messages the SimpleTopic has to publish, and if there are 
- * any subscribers at that moment, they will receive a WS-N notification about 
- * the change.
- * <br><br>
- * The WS-N NotificationMessages create by this listener have a 
- * <em>ResourcePropertyValueChangeNotification</em> 
- * content item. That content contains the old and new values of the property. 
- * The schema for this content item is described in the WS-RP spec (under 
- * <em>Subscription</em>).
+ * ChangeNotificationListener is a {@linkplain PropertyChangeListener PropertyChangeListener} 
+ * that reports changes in a resource property to the WS-N topic that represents 
+ * the property. The WS-N notification message create by this listener have a 
+ * <em>ResourcePropertyValueChangeNotification</em> content item. That content 
+ * contains the old and new values of the property.
  * <br><br>
  * Note that this class does not send the notification messages directly - that 
- * is handled by the WS-N framework.
- * <br><br>
- * This class should be leveraged through the 
- * {@linkplain ChangeNotificationListenerFactory ChangeNotificationListenerFactory} that 
- * is provided in the {@linkplain ResourcePropertyListeners ResourcePropertyListeners} 
- * interface. This will allow users to write code that is independent of how 
- * the WS-N property change notifications are formatted.
+ * is handled by the WS-N NotificationProducer component.
  *
  * @author Dan Jemiolo (danj)
  * 
@@ -73,21 +58,16 @@
         _wsn = wsn;
     }
     
-    public QName getPropertyName()
+    protected NotificationProducer getNotificationProducer()
     {
-        return _topicName;
+        return _wsn;
     }
     
-    protected QName getTopic()
+    public QName getPropertyName()
     {
         return _topicName;
     }
     
-    protected NotificationProducer getNotificationProducer()
-    {
-        return _wsn;
-    }
-    
     /**
      * 
      * Creates a WS-N message that holds a WS-RP change notification event. 
@@ -105,15 +85,18 @@
     public void propertyChanged(Element oldValue, Element newValue)
         throws BaseFault
     {
+        Element[] oldValues = new Element[]{ oldValue };
+        Element[] newValues = new Element[]{ newValue };
+        
         ResourcePropertyChangeEvent event = 
-            new ResourcePropertyChangeEvent(getPropertyName(), oldValue, newValue);
+            new ResourcePropertyChangeEvent(oldValues, newValues);
         
         //
         // publish to the property's topic
         //
         try
         {
-            getNotificationProducer().publish(getTopic(), event);
+            getNotificationProducer().publish(getPropertyName(), event);
         }
         
         catch (SoapFault error)

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/properties/ResourcePropertyChangeEvent.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/properties/ResourcePropertyChangeEvent.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/properties/ResourcePropertyChangeEvent.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/properties/ResourcePropertyChangeEvent.java Tue Aug 29 19:56:51 2006
@@ -16,13 +16,12 @@
  
 package org.apache.muse.ws.notification.properties;
 
-import javax.xml.namespace.QName;
-
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
 import org.apache.muse.util.xml.XmlSerializable;
 import org.apache.muse.util.xml.XmlUtils;
+import org.apache.muse.ws.notification.NotificationMessage;
 import org.apache.muse.ws.resource.properties.WsrpConstants;
 
 /**
@@ -38,31 +37,42 @@
 
 public class ResourcePropertyChangeEvent implements XmlSerializable
 {
-    private QName _propertyName = null;
+    private Element[] _newValues = null;
     
-    private Object _oldValue = null;
-    private Object _newValue = null;
+    private Element[] _oldValues = null;
     
-    public ResourcePropertyChangeEvent(QName propertyName, Object oldValue, Object newValue)
+    public ResourcePropertyChangeEvent(Element[] oldValues, Element[] newValues)
     {
-        _propertyName = propertyName;
-        _oldValue = oldValue;
-        _newValue = newValue;
+        _oldValues = oldValues;
+        _newValues = newValues;
     }
     
-    public QName getPropertyName()
-    {
-        return _propertyName;
+    /**
+     * 
+     * Parses the message content to find the WSRP change notification data.
+     * 
+     * @param message
+     *        A notification message containing a WSRP change event.
+     *
+     */
+    public ResourcePropertyChangeEvent(NotificationMessage message)
+    {
+        Element wsrpXML = message.getMessageContent(WsrpConstants.NOTIFICATION_QNAME);
+        Element oldValuesXML = XmlUtils.getElement(wsrpXML, WsrpConstants.OLD_VALUES_QNAME);
+        Element newValuesXML = XmlUtils.getElement(wsrpXML, WsrpConstants.NEW_VALUES_QNAME);
+        
+        _oldValues = XmlUtils.getAllElements(oldValuesXML);
+        _newValues = XmlUtils.getAllElements(newValuesXML);
     }
     
-    public Object getOldValue()
+    public Element[] getNewValues()
     {
-        return _oldValue;
+        return _newValues;
     }
     
-    public Object getNewValue()
+    public Element[] getOldValues()
     {
-        return _newValue;
+        return _oldValues;
     }
 
     public Element toXML()
@@ -72,21 +82,28 @@
 
     public Element toXML(Document doc)
     {
-        Element xml = XmlUtils.createElement(doc, WsrpConstants.NOTIFICATION_QNAME);
+        Element root = XmlUtils.createElement(doc, WsrpConstants.NOTIFICATION_QNAME);
+        
+        Element[] oldValues = getOldValues();
+        Element[] newValues = getNewValues();
         
-        //
-        // the old property value
-        //
-        QName qname = getPropertyName();
-        Object oldValue = getOldValue();
-        Object newValue = getNewValue();
+        Element oldValueXML = XmlUtils.createElement(doc, WsrpConstants.OLD_VALUES_QNAME);
+        Element newValueXML = XmlUtils.createElement(doc, WsrpConstants.NEW_VALUES_QNAME);
+        root.appendChild(oldValueXML);
+        root.appendChild(newValueXML);
         
-        Element oldValueXML = XmlUtils.createElement(doc, qname, oldValue);
-        Element newValueXML = XmlUtils.createElement(doc, qname, newValue);
+        for (int n = 0; n < oldValues.length; ++n)
+        {
+            oldValues[n] = (Element)doc.importNode(oldValues[n], true);
+            oldValueXML.appendChild(oldValues[n]);
+        }
         
-        XmlUtils.setElement(xml, WsrpConstants.OLD_VALUE_QNAME, oldValueXML, false);
-        XmlUtils.setElement(xml, WsrpConstants.NEW_VALUE_QNAME, newValueXML, false);
+        for (int n = 0; n < newValues.length; ++n)
+        {
+            newValues[n] = (Element)doc.importNode(newValues[n], true);
+            newValueXML.appendChild(newValues[n]);
+        }
         
-        return xml;
+        return root;
     }
 }

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/properties/WsrpNotificationListenerFactory.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/properties/WsrpNotificationListenerFactory.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/properties/WsrpNotificationListenerFactory.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/properties/WsrpNotificationListenerFactory.java Tue Aug 29 19:56:51 2006
@@ -16,7 +16,6 @@
 
 package org.apache.muse.ws.notification.properties;
 
-
 import javax.xml.namespace.QName;
 
 import org.apache.muse.ws.notification.NotificationProducer;
@@ -27,8 +26,8 @@
 /**
  *
  * WsrpNotificationListenerFactory creates instances of the 
- * {@linkplain ChangeNotificationListener ChangeNotificationListener} class. This is 
- * the default factory for WS-RP users who want to send out valid WS-RP 
+ * {@linkplain ChangeNotificationListener ChangeNotificationListener} class. 
+ * This is the default factory for WS-RP users who want to send out valid WS-RP 
  * change notifications and aren't using any other event format.
  *
  * @author Dan Jemiolo (danj)
@@ -39,7 +38,7 @@
 {
     /**
      * 
-     * This implementation returns an instance of ChangeNotificationListener.
+     * @return An instance of ChangeNotificationListener.
      * 
      */
     public PropertyChangeListener newInstance(QName property, WsResource resource)

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/remote/NotificationConsumerClient.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/remote/NotificationConsumerClient.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/remote/NotificationConsumerClient.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/remote/NotificationConsumerClient.java Tue Aug 29 19:56:51 2006
@@ -28,12 +28,12 @@
 
 /**
  *
- * NotificationConsumerClient is a proxy class for resources that implement 
- * the WS-N NotificationConsumer port type. It adds the notify() method to 
- * the base WS-RF interfaces.
+ * NotificationConsumerClient is a web services client for resources that 
+ * implement the WS-N NotificationConsumer port type. It adds the wsnt:Notify 
+ * method to the base WS-RF interfaces.
  *
  * @author Dan Jemiolo (danj)
- * 
+ *
  */
 
 public class NotificationConsumerClient extends WsResourceClient

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/remote/NotificationProducerClient.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/remote/NotificationProducerClient.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/remote/NotificationProducerClient.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/remote/NotificationProducerClient.java Tue Aug 29 19:56:51 2006
@@ -37,9 +37,9 @@
 
 /**
  *
- * NotificationConsumerClient is a proxy class for resources that implement 
- * the WS-N NotificationProducer port type. It adds the subscribe() and 
- * getCurrentMessage() methods to the base WS-RF interfaces.
+ * NotificationProducerClient is a web services client for resources that 
+ * implement the WS-N NotificationProducer port type. It adds the subscribe() 
+ * and getCurrentMessage() methods to the base WS-RF interfaces.
  *
  * @author Dan Jemiolo (danj)
  *

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/remote/SubscriptionClient.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/remote/SubscriptionClient.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/remote/SubscriptionClient.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/remote/SubscriptionClient.java Tue Aug 29 19:56:51 2006
@@ -28,9 +28,9 @@
 
 /**
  *
- * SubscriptionClient is a proxy class for resources that implement the 
- * WS-N SubscriptionManager port type. It adds the pause() and resume() 
- * methods to the base WS-RF interfaces.
+ * SubscriptionClient is a web services client for resources that implement the 
+ * WS-N SubscriptionManager port type. It adds the pauseSubscription() and 
+ * resumeSubscription() methods to the base WS-RF interfaces.
  *
  * @author Dan Jemiolo (danj)
  *

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/topics/impl/ConcretePathExpression.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/topics/impl/ConcretePathExpression.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/topics/impl/ConcretePathExpression.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/topics/impl/ConcretePathExpression.java Tue Aug 29 19:56:51 2006
@@ -34,7 +34,7 @@
 /**
  *
  * ConcretePathExpression allows users to evaluate simple and concrete 
- * topic expressions, as defined by WS-Topics 1.2 draft 03. This class 
+ * topic expressions, as defined by WS-Topics v1.3. This class 
  * cannot evaluate paths with wildcards ('full' expressions).
  *
  * @author Dan Jemiolo (danj)
@@ -42,12 +42,21 @@
  */
 
 public class ConcretePathExpression implements TopicPathExpression
-{
+{    
     private static Messages _MESSAGES = MessagesFactory.get(ConcretePathExpression.class);
+        
+    private QName _topicPath = null;
     
     private TopicNamespace _topicSpace = null;
     
-    private QName _topicPath = null;
+    public ConcretePathExpression(Topic topic)
+    {
+        if (topic == null)
+            throw new NullPointerException(_MESSAGES.get("NullTopic"));
+        
+        _topicSpace = topic.getTopicNamespace();
+        _topicPath = createTopicPath(_topicSpace, topic);
+    }
     
     public ConcretePathExpression(TopicNamespace topicSpace, QName topicPath)
         throws InvalidTopicExpressionFault
@@ -105,15 +114,6 @@
         validateTopicPath(_topicPath);
     }
     
-    public ConcretePathExpression(Topic topic)
-    {
-        if (topic == null)
-            throw new NullPointerException(_MESSAGES.get("NullTopic"));
-        
-        _topicSpace = topic.getTopicNamespace();
-        _topicPath = createTopicPath(_topicSpace, topic);
-    }
-    
     private QName createTopicPath(TopicNamespace topicSpace, Topic topic)
     {
         String namespace = topicSpace.getTargetNamespace();
@@ -148,25 +148,12 @@
         
         return new QName(namespace, buffer.toString(), "topic");
     }
-    
-    public static void validateTopicPath(QName topicPath) 
-        throws InvalidTopicExpressionFault
-    {        
-        String unqualifiedPath = topicPath.getLocalPart();
         
-        if (unqualifiedPath.indexOf('*') >= 0 || 
-            unqualifiedPath.indexOf("//") >= 0)
-        {
-            Object[] filler = { XmlUtils.toString(topicPath) };
-            throw new InvalidTopicExpressionFault(_MESSAGES.get("InvalidConcretePath", filler));
-        }
-    }
-    
     public QName getTopicPath()
     {
         return _topicPath;
     }
-        
+    
     public TopicNamespace getTopicSpace()
     {
         return _topicSpace;
@@ -177,14 +164,13 @@
         String[] nodes = _topicPath.getLocalPart().split("/");
         return new ConcretePathIterator(_topicSpace, nodes);
     }
-    
+
     public Topic resolve()
     {
         //
-        // all we have to do is use a ConcretePathIterator to move 
-        // through the path; if we can get through each node with 
-        // the iterator without hitting a dead end (no topic), then 
-        // we have found a match
+        // all we have to do is use an iterator to move through the path; if 
+        // we can get through each node with the iterator without hitting a 
+        // dead end, then we have found a match
         //
         
         ListIterator i = iterator();
@@ -194,99 +180,137 @@
         {
             topic = (Topic)i.next();
             
+            //
+            // path could not be completed - no match
+            //
             if (topic == null)
                 return null;
         }
         
         return topic;
     }
-
+    
     /**
-     *
-     * ConcretePathIterator is an internal class that allows us to 
-     * move back and forth between nodes in a topic path. Each 
-     * node is one of the strings between the '/' characters in 
-     * the path.
-     *
-     * @author Dan Jemiolo (danj)
+     * 
+     * Validates the given topic name against the rules for concrete topic 
+     * expressions.
+     * 
+     * @throws InvalidTopicExpressionFault
+     *         <ul>
+     *         <li>If the expression violates the rules for concrete topic 
+     *         expressions as outlined in WS-Topics v1.3.
+     *         </ul>
      *
      */
-    class ConcretePathIterator implements ListIterator
-    {
-        private TopicNamespace _root = null;
-        private Topic _currentTopic = null;
-        
-        private String[] _nodes = null;
-        private int _currentNode = 0;
-        
-        public ConcretePathIterator(TopicNamespace root, String[] nodes)
-        {
-            _root = root;
-            _nodes = nodes;
-        }
+    public static void validateTopicPath(QName topicPath) 
+        throws InvalidTopicExpressionFault
+    {        
+        String unqualifiedPath = topicPath.getLocalPart();
         
-        public void add(Object item)
+        if (unqualifiedPath.indexOf('*') >= 0 || 
+            unqualifiedPath.indexOf("//") >= 0)
         {
-            throw new UnsupportedOperationException();
+            Object[] filler = { XmlUtils.toString(topicPath) };
+            throw new InvalidTopicExpressionFault(_MESSAGES.get("InvalidConcretePath", filler));
         }
+    }
+    
+    /**
+     * 
+     * ConcretePathIterator is an internal class that allows us to move back 
+     * and forth between nodes in a topic path. Each node is one of the strings 
+     * between the '/' characters in the path.
+     * 
+     * @author Dan Jemiolo (danj)
+     * 
+     */
+   class ConcretePathIterator implements ListIterator
+   {
+       //
+       // position of the iterator in the path
+       //
+       private int _currentNode = 0;
+       
+       //
+       // the topic representing the iterator's current place on the path
+       //
+       private Topic _currentTopic = null;
+       
+       //
+       // the set of items the iterator can move over
+       //
+       private String[] _nodes = null;
+       
+       private TopicNamespace _root = null;
+       
+       public ConcretePathIterator(TopicNamespace root, String[] nodes)
+       {
+           _root = root;
+           _nodes = nodes;
+       }
+       
+       public void add(Object item)
+       {
+           throw new UnsupportedOperationException();
+       }
 
-        public boolean hasNext()
-        {
-            return _currentNode < _nodes.length;
-        }
-        
-        public boolean hasPrevious()
-        {
-            return _currentNode > 0;
-        }
+       public boolean hasNext()
+       {
+           return _currentNode < _nodes.length;
+       }
+       
+       public boolean hasPrevious()
+       {
+           return _currentNode > 0;
+       }
 
-        public Object next()
-        {
-            if (!hasNext())
-                throw new IllegalStateException();
-            
-            String name = _nodes[_currentNode++];
-            
-            //
-            // special case - if we're at the beginning, we have 
-            // to get the first topic from the SimpleTopicNamespace
-            //
-            if (_currentTopic == null)
-                _currentTopic = _root.getTopic(name);
-            
-            else
-                _currentTopic = _currentTopic.getTopic(name);
-            
-            return _currentTopic;
-        }
-        
-        public int nextIndex()
-        {
-            return _currentNode;
-        }
-        
-        public Object previous()
-        {
-            if (!hasPrevious())
-                throw new IllegalStateException();
-            
-            --_currentNode;
-            return _currentTopic.getParentTopic();
-        }
-        
-        public int previousIndex()
-        {
-            return _currentNode - 1;
-        }
+       public Object next()
+       {
+           if (!hasNext())
+               throw new IllegalStateException();
+           
+           String name = _nodes[_currentNode++];
+           
+           //
+           // special case - if we're at the beginning, we have 
+           // to get the first topic from the TopicNamespace
+           //
+           if (_currentTopic == null)
+               _currentTopic = _root.getTopic(name);
+           
+           else
+               _currentTopic = _currentTopic.getTopic(name);
+           
+           return _currentTopic;
+       }
+       
+       public int nextIndex()
+       {
+           return _currentNode;
+       }
+       
+       public Object previous()
+       {
+           if (!hasPrevious())
+               throw new IllegalStateException();
+           
+           --_currentNode;
+           return _currentTopic.getParentTopic();
+       }
+       
+       public int previousIndex()
+       {
+           return _currentNode - 1;
+       }
 
-        public void remove()
-        {
-            throw new UnsupportedOperationException();
-        }
+       public void remove()
+       {
+           throw new UnsupportedOperationException();
+       }
 
-        public void set(Object item)
-        {
-            throw new UnsupportedOperationException();
-        }
-    }
+       public void set(Object item)
+       {
+           throw new UnsupportedOperationException();
+       }
+   }
 }

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/topics/impl/SimpleTopic.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/topics/impl/SimpleTopic.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/topics/impl/SimpleTopic.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/topics/impl/SimpleTopic.java Tue Aug 29 19:56:51 2006
@@ -44,13 +44,8 @@
 
 /**
  *
- * SimpleTopic is a representation of the WS-Topics SimpleTopic type. It is responsible 
- * for managing all sub-topics (its topic tree) as well as the subscriptions 
- * that have been made against the topic. Whenever a resource publishes a 
- * message to a SimpleTopic, it must record the message and then send it out to 
- * all of the subscribers. This class is used by all resources that implement 
- * {@linkplain org.apache.muse.ws.notification.NotificationProducer NotificationProducer} 
- * to actually send messages to subscribers.
+ * SimpleTopic is Muse's default implementation of the wsnt:Topic data structure 
+ * defined in WS-Notification v1.3 and WS-Topics v1.3.
  *
  * @author Dan Jemiolo (danj)
  *
@@ -60,8 +55,14 @@
 {
     private static Messages _MESSAGES = MessagesFactory.get(SimpleTopic.class);
     
+    //
+    // keep children in the order they were added for serialization purposes
+    //
     private Map _childTopics = new LinkedHashMap();
     
+    //
+    // the last message published for this topic
+    //
     private NotificationMessage _currentMessage = null;
     
     private boolean _isFinal = false;
@@ -191,6 +192,12 @@
         _childTopics.put(name, childTopic);
     }
     
+    /**
+     * 
+     * @return True if the two topics have the same local name, topic namespace, 
+     *         concrete path, message pattern, and 'final' status.
+     *         
+     */
     public synchronized boolean equals(Object obj)
     {
         if (obj == null)
@@ -222,23 +229,12 @@
         return thatPattern == null;
     }
     
-    /**
-     *
-     * @return A fully-qualified name for the SimpleTopic, which can be used 
-     *         in WS-N requests.
-     *
-     */
     public synchronized QName getConcretePath()
     {
         TopicPathExpression path = new ConcretePathExpression(this);
         return path.getTopicPath();
     }
     
-    /**
-     *
-     * @return The last message published to this SimpleTopic (via publish()).
-     *
-     */
     public synchronized NotificationMessage getCurrentMessage()
     {
         return _currentMessage;
@@ -275,11 +271,6 @@
         return _name;
     }
     
-    /**
-     *
-     * @return The SimpleTopic's parent SimpleTopic, or null if it is a root SimpleTopic.
-     *
-     */
     public synchronized Topic getParentTopic()
     {
         return _parentTopic;
@@ -290,16 +281,23 @@
         return (Topic)_childTopics.get(topicName);
     }
     
-    public synchronized Collection getTopics()
+    public synchronized TopicNamespace getTopicNamespace()
     {
-        return Collections.unmodifiableCollection(_childTopics.values());
+        return _topicSpace;
     }
     
-    public synchronized TopicNamespace getTopicNamespace()
+    public synchronized Collection getTopics()
     {
-        return _topicSpace;
+        return Collections.unmodifiableCollection(_childTopics.values());
     }
     
+    /**
+     * 
+     * @return A hash code based on the same values used for testing equality.
+     * 
+     * @see #equals(Object)
+     * 
+     */
     public synchronized int hashCode()
     {
         String pattern = getMessagePattern();
@@ -346,6 +344,11 @@
             throw new NullPointerException(_MESSAGES.get("NullTopicName"));
         
         _childTopics.remove(topicName);
+    }
+    
+    public void setCurrentMessage(NotificationMessage message)
+    {
+        _currentMessage = message;
     }
     
     public synchronized void setFinal(boolean isFinal)

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/topics/impl/SimpleTopicNamespace.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/topics/impl/SimpleTopicNamespace.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/topics/impl/SimpleTopicNamespace.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/topics/impl/SimpleTopicNamespace.java Tue Aug 29 19:56:51 2006
@@ -37,10 +37,8 @@
 
 /**
  *
- * SimpleTopicNamespace is a representation of the WS-Topics SimpleTopicNamespace type. It 
- * contains a set of topic trees that all have the same namespace. Users 
- * can evaluate topic path expressions against TopicSpaces to find out if 
- * a SimpleTopic is published by a resource.
+ * SimpleTopicNamespace is Muse's default implementation of the wsnt:TopicNamespace 
+ * data structure defined in WS-Notification v1.3 and WS-Topics v1.3.
  *
  * @author Dan Jemiolo (danj)
  *
@@ -111,6 +109,11 @@
         _rootTopics.put(name, topic);
     }
     
+    /**
+     * 
+     * @return True if the two topic namespaces have the same target namespace.
+     *
+     */
     public boolean equals(Object obj)
     {
         if (obj == null)
@@ -130,21 +133,23 @@
         return Collections.unmodifiableCollection(_rootTopics.values());
     }
     
-    public synchronized final Iterator iterator()
-    {
-        return getRootTopics().iterator();
-    }
-    
     public synchronized final String getTargetNamespace()
     {
         return _targetNamespace;
     }
-
+    
     public synchronized final Topic getTopic(String topicName)
     {
         return (Topic)_rootTopics.get(topicName);
     }
-    
+
+    /**
+     * 
+     * @return A hash code based on the same values used for testing equality.
+     * 
+     * @see #equals(Object)
+     * 
+     */
     public int hashCode()
     {
         return getTargetNamespace().hashCode();
@@ -195,7 +200,7 @@
         
         while (i.hasNext())
         {
-            SimpleTopic topic = (SimpleTopic)i.next();
+            Topic topic = (Topic)i.next();
             Element topicXML = topic.toXML(doc);
             topicSpace.appendChild(topicXML);
         }

Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/topics/impl/SimpleTopicSet.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/topics/impl/SimpleTopicSet.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/topics/impl/SimpleTopicSet.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/topics/impl/SimpleTopicSet.java Tue Aug 29 19:56:51 2006
@@ -21,6 +21,9 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
 import org.apache.muse.util.messages.Messages;
 import org.apache.muse.util.messages.MessagesFactory;
 import org.apache.muse.util.xml.XmlUtils;
@@ -29,13 +32,11 @@
 import org.apache.muse.ws.notification.topics.TopicSet;
 import org.apache.muse.ws.notification.topics.WstConstants;
 import org.apache.muse.ws.resource.basefaults.BaseFault;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
 
 /**
  *
- * SimpleTopicSet is a top-level container that keeps all of a 
- * resource's topic spaces sorted by their namespaces.
+ * SimpleTopicSet is Muse's default implementation of the wst:TopicSet data 
+ * structure defined in WS-Topics v1.3.
  *
  * @author Dan Jemiolo (danj)
  *
@@ -68,14 +69,14 @@
         _topicSpacesByNS.put(namespace, topicSpace);
     }
     
-    public synchronized final Collection getTopicNamespaceURIs()
+    public synchronized final TopicNamespace getTopicNamespace(String namespace)
     {
-        return Collections.unmodifiableCollection(_topicSpacesByNS.keySet());
+        return (TopicNamespace)_topicSpacesByNS.get(namespace);
     }
     
-    public synchronized final TopicNamespace getTopicNamespace(String namespace)
+    public synchronized final Collection getTopicNamespaceURIs()
     {
-        return (TopicNamespace)_topicSpacesByNS.get(namespace);
+        return Collections.unmodifiableCollection(_topicSpacesByNS.keySet());
     }
     
     public synchronized final void removeTopicNamespace(String namespace)
@@ -91,12 +92,14 @@
         return toXML(XmlUtils.EMPTY_DOC);
     }
 
-    public Element toXML(Document factory)
+    public Element toXML(Document doc)
     {
-        Element root = XmlUtils.createElement(WstConstants.TOPIC_SET_QNAME);
-
-        // FIXME: placeholder - not implemented yet
-        XmlUtils.setElement(root, WstConstants.TOPIC_QNAME, "Placeholder");
+        Element root = XmlUtils.createElement(doc, WstConstants.TOPIC_SET_QNAME);
+        
+        //
+        // FIXME: not implemented yet, but this property is not nillable
+        //
+        XmlUtils.setElementText(root, "Serialization of the wst:TopicSet property has not been implemented yet.");
         
         return root;
     }

Modified: webservices/muse/trunk/modules/muse-wsrf-api/src/org/apache/muse/ws/resource/properties/WsrpConstants.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsrf-api/src/org/apache/muse/ws/resource/properties/WsrpConstants.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsrf-api/src/org/apache/muse/ws/resource/properties/WsrpConstants.java (original)
+++ webservices/muse/trunk/modules/muse-wsrf-api/src/org/apache/muse/ws/resource/properties/WsrpConstants.java Tue Aug 29 19:56:51 2006
@@ -115,8 +115,8 @@
      * WS-RP/WS-N change notification - new value element name.
      * 
      */
-    public  static final QName NEW_VALUE_QNAME = 
-        new QName(NAMESPACE_URI, "NewValue", PREFIX);
+    public  static final QName NEW_VALUES_QNAME = 
+        new QName(NAMESPACE_URI, "NewValues", PREFIX);
     
     /**
      * 
@@ -131,8 +131,8 @@
      * WS-RP/WS-N change notification - old value element name.
      * 
      */
-    public static final QName OLD_VALUE_QNAME = 
-        new QName(NAMESPACE_URI, "OldValue", PREFIX);
+    public static final QName OLD_VALUES_QNAME = 
+        new QName(NAMESPACE_URI, "OldValues", PREFIX);
     
     public static final QName PROPERTY_QNAME = 
         new QName(NAMESPACE_URI, "ResourceProperty", PREFIX);

Modified: webservices/muse/trunk/modules/muse-wsrf-api/src/org/apache/muse/ws/resource/sg/ServiceGroupPersistence.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsrf-api/src/org/apache/muse/ws/resource/sg/ServiceGroupPersistence.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsrf-api/src/org/apache/muse/ws/resource/sg/ServiceGroupPersistence.java (original)
+++ webservices/muse/trunk/modules/muse-wsrf-api/src/org/apache/muse/ws/resource/sg/ServiceGroupPersistence.java Tue Aug 29 19:56:51 2006
@@ -31,6 +31,7 @@
  * @author Dan Jemiolo (danj)
  *
  */
+
 public interface ServiceGroupPersistence extends Persistence, ResourceManagerListener
 {
     WsResource getServiceGroup();

Modified: webservices/muse/trunk/modules/muse-wsx-api/src/org/apache/muse/ws/metadata/MetadataExchange.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsx-api/src/org/apache/muse/ws/metadata/MetadataExchange.java?rev=438329&r1=438328&r2=438329&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsx-api/src/org/apache/muse/ws/metadata/MetadataExchange.java (original)
+++ webservices/muse/trunk/modules/muse-wsx-api/src/org/apache/muse/ws/metadata/MetadataExchange.java Tue Aug 29 19:56:51 2006
@@ -22,7 +22,7 @@
 
 /**
  *
- * MetadataExchange is an internal implementation of the WS-MetadataExchange 
+ * MetadataExchange is an interface that represents the WS-MetadataExchange 
  * GetMetadata port type; it is based on WS-MEX 09/04. It does not include 
  * the concept of metadata references, only the direct lookup of metadata 
  * from the resource itself.



---------------------------------------------------------------------
To unsubscribe, e-mail: muse-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-commits-help@ws.apache.org