ws-pubscribe-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r325923 [4/6] - in /webservices/pubscribe/trunk: ./ src/java/org/apache/ws/ src/java/org/apache/ws/eventing/ src/java/org/apache/ws/eventing/porttype/impl/ src/java/org/apache/ws/eventing/pubsub/ src/java/org/apache/ws/notification/ src/jav...
Date Mon, 17 Oct 2005 16:36:58 GMT
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicNamespace.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicNamespace.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicNamespace.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicNamespace.java Mon Oct 17 09:36:17 2005
@@ -1,18 +1,18 @@
-/*
- * Copyright 2004-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
- * 
+/*=============================================================================*
+ *  Copyright 2004 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.
- */
+ *
+ *  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.topics;
 
 import java.net.URI;
@@ -21,43 +21,42 @@
  * A topic namespace (a hierarchy of topics within a particular namespace), as defined by the WS-Topics 1.3
  * specification.
  */
-public interface TopicNamespace extends TopicSiblingSet
+public interface TopicNamespace
+   extends TopicSiblingSet
 {
-
-    /**
-     * Returns this topic namespace's target namespace.
-     *
-     * @return this topic namespace's target namespace
-     */
-    String getTargetNamespace();
-
-    /**
-     * Returns this topic namespace's name, or null if no name is defined.
-     *
-     * @return this topic namespace's name, or null if no name is defined
-     */
-    String getName();
-
-    /**
-     * If the value is <code>true</code> it indicates that NotificationProducers cannot use topics whose root topics do
-     * not appear in this topic namespace. The default value is <code>false</code>.
-     *
-     * @return true if this topic namespace is final, or false if it is not
-     */
-    boolean isFinal();
-
-    /**
-     * Sets this topic namespace's (optional) name.
-     *
-     * @param name the name
-     */
-    void setName( String name );
-
-    /**
-     * Sets this topic namespace's finality.
-     *
-     * @param finality the finality
-     */
-    void setFinal( boolean finality );
-
-}
+   /**
+    * Sets this topic namespace's finality.
+    *
+    * @param finality the finality
+    */
+   void setFinal( boolean finality );
+
+   /**
+    * If the value is <code>true</code> it indicates that NotificationProducers cannot use topics whose root topics do
+    * not appear in this topic namespace. The default value is <code>false</code>.
+    *
+    * @return true if this topic namespace is final, or false if it is not
+    */
+   boolean isFinal(  );
+
+   /**
+    * Sets this topic namespace's (optional) name.
+    *
+    * @param name the name
+    */
+   void setName( String name );
+
+   /**
+    * Returns this topic namespace's name, or null if no name is defined.
+    *
+    * @return this topic namespace's name, or null if no name is defined
+    */
+   String getName(  );
+
+   /**
+    * Returns this topic namespace's target namespace.
+    *
+    * @return this topic namespace's target namespace
+    */
+   String getTargetNamespace(  );
+}
\ No newline at end of file

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicNamespaceRegistry.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicNamespaceRegistry.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicNamespaceRegistry.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicNamespaceRegistry.java Mon Oct 17 09:36:17 2005
@@ -1,30 +1,29 @@
-/*
- * Copyright 2004-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
- * 
+/*=============================================================================*
+ *  Copyright 2004 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.
- */
+ *
+ *  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.topics;
 
 import org.apache.ws.notification.topics.v2004_06.TopicsConstants;
 import org.apache.xmlbeans.XmlObject;
 import org.springframework.core.io.DefaultResourceLoader;
 import org.springframework.core.io.Resource;
-
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
-import java.util.Collections;
 
 /**
  * A registry for topic namespace definitions.
@@ -33,65 +32,92 @@
  */
 public class TopicNamespaceRegistry
 {
-
-    /*
-     * maps targetNamespace <String> to <TopicNamespace>
-     */
-    private final Map m_topicNsMap = Collections.synchronizedMap( new HashMap() );
-
-    public TopicNamespaceRegistry()
-    {
-    }
-
-    public TopicNamespaceRegistry( Set topicNsSet )
-    {
-       initTopicNamespaceMap( topicNsSet );
-    }
-
-    /**
-     * Loads each of the TopicNamespace documents from the URLs in the specified set and
-     * adds them to this registry.
-     *
-     * @param topicNsSet a set of Strings representing URLs of TopicNamespace documents
-     */
-    public void initTopicNamespaceMap( Set topicNsSet )
-    {
-        for ( Iterator iterator = topicNsSet.iterator(); iterator.hasNext(); )
-        {
-            String location = (String) iterator.next();
-            Resource resource;
-            try
-            {
-                resource = new DefaultResourceLoader().getResource( location );
-            }
-            catch ( RuntimeException re )
-            {
-                System.err.println( "ERROR: " + location + " is not a valid URL - an associated topic namespace will not be added to the registry." );
-                continue;
-            }
-            TopicNamespace topicNs = null;
-            try
-            {
-                topicNs = TopicsTypeReader.newInstance( TopicsConstants.NSURI_WSTOP_SCHEMA ).toTopicNamespace( XmlObject.Factory.parse( resource.getInputStream() ) );
-            }
-            catch ( Exception e )
-            {
-                System.err.println( "ERROR: Unable to load topic namespace document from URL " + location + " - an associated topic namespace will not be added to the registry." );
-                e.printStackTrace( );
-                continue;
-            }
-            m_topicNsMap.put( topicNs.getTargetNamespace(), topicNs );
-        }
-    }
-
-    public TopicNamespace getTopicNamespace( String targetNamespace )
-    {
-        return (TopicNamespace) m_topicNsMap.get( targetNamespace.toString() );
-    }
-
-    public void addTopicNamespace( TopicNamespace topicNs )
-    {
-        m_topicNsMap.put( topicNs.getTargetNamespace() != null ? topicNs.getTargetNamespace().toString() : "", topicNs );
-    }
-
-}
+   /*
+    * maps targetNamespace <String> to <TopicNamespace>
+    */
+   private final Map m_topicNsMap = Collections.synchronizedMap( new HashMap(  ) );
+
+   /**
+    * Creates a new {@link TopicNamespaceRegistry} object.
+    */
+   public TopicNamespaceRegistry(  )
+   {
+   }
+
+   /**
+    * Creates a new {@link TopicNamespaceRegistry} object.
+    *
+    * @param topicNsSet DOCUMENT_ME
+    */
+   public TopicNamespaceRegistry( Set topicNsSet )
+   {
+      initTopicNamespaceMap( topicNsSet );
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param targetNamespace DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public TopicNamespace getTopicNamespace( String targetNamespace )
+   {
+      return (TopicNamespace) m_topicNsMap.get( targetNamespace.toString(  ) );
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param topicNs DOCUMENT_ME
+    */
+   public void addTopicNamespace( TopicNamespace topicNs )
+   {
+      m_topicNsMap.put( ( topicNs.getTargetNamespace(  ) != null ) ? topicNs.getTargetNamespace(  ).toString(  ) : "",
+                        topicNs );
+   }
+
+   /**
+    * Loads each of the TopicNamespace documents from the URLs in the specified set and
+    * adds them to this registry.
+    *
+    * @param topicNsSet a set of Strings representing URLs of TopicNamespace documents
+    */
+   public void initTopicNamespaceMap( Set topicNsSet )
+   {
+      for ( Iterator iterator = topicNsSet.iterator(  ); iterator.hasNext(  ); )
+      {
+         String   location = (String) iterator.next(  );
+         Resource resource;
+         try
+         {
+            resource = new DefaultResourceLoader(  ).getResource( location );
+         }
+         catch ( RuntimeException re )
+         {
+            System.err.println( "ERROR: " + location
+                                + " is not a valid URL - an associated topic namespace will not be added to the registry." );
+            continue;
+         }
+
+         TopicNamespace topicNs = null;
+         try
+         {
+            topicNs =
+               TopicsTypeReader.newInstance( TopicsConstants.NSURI_WSTOP_SCHEMA ).toTopicNamespace( XmlObject.Factory
+                                                                                                    .parse( resource
+                                                                                                            .getInputStream(  ) ) );
+         }
+         catch ( Exception e )
+         {
+            System.err.println( "ERROR: Unable to load topic namespace document from URL " + location
+                                + " - an associated topic namespace will not be added to the registry." );
+            e.printStackTrace(  );
+            continue;
+         }
+
+         m_topicNsMap.put( topicNs.getTargetNamespace(  ),
+                           topicNs );
+      }
+   }
+}
\ No newline at end of file

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicSet.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicSet.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicSet.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicSet.java Mon Oct 17 09:36:17 2005
@@ -1,5 +1,5 @@
 /*=============================================================================*
- *  Copyright 2005 The Apache Software Foundation
+ *  Copyright 2004 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.
@@ -17,7 +17,6 @@
 
 import org.apache.ws.notification.topics.expression.TopicExpression;
 import org.apache.ws.notification.topics.expression.TopicExpressionException;
-
 import javax.xml.namespace.QName;
 
 /**
@@ -25,48 +24,48 @@
  */
 public interface TopicSet
 {
-    
-    /**
-     * Sets the boolean that indicates if this topic set is fixed as defined by the WS-BaseNotification specification.
-     *
-     * @param fixed
-     */
-    void setFixed( boolean fixed );
-
-    /**
-     * Returns a boolean that indicates if this topic set is fixed as defined by the WS-BaseNotification specification.
-     */
-    boolean isFixed();
-
-    /**
-     * Returns the topic expressions contained in this topic set.
-     */
-    TopicExpression[] getTopicExpressions();
-
-    /**
-     * Returns the topics contained in this topic set.
-     */
-    Topic[] getTopics();
-
-    /**
-     * @param topicExpr
-     */
-    void addTopicExpression( TopicExpression topicExpr ) throws TopicExpressionException;
-
-    /**
-     *
-     * @param topicPath the path to exactly one Topic (e.g. new QName( "http://example.org/topicSpace/example1", "t4/t5" ))
-     *
-     * @return true if this topic set contains the specified topic, or false if it does not
-     */
-    boolean containsTopic( QName topicPath );
-
-    /**
-     *
-     * @param topicExpr
-     * @return
-     * @throws TopicExpressionException
-     */
-    Topic[] evaluateTopicExpression( TopicExpression topicExpr ) throws TopicExpressionException;
-
+   /**
+    * Sets the boolean that indicates if this topic set is fixed as defined by the WS-BaseNotification specification.
+    *
+    * @param fixed
+    */
+   void setFixed( boolean fixed );
+
+   /**
+    * Returns a boolean that indicates if this topic set is fixed as defined by the WS-BaseNotification specification.
+    */
+   boolean isFixed(  );
+
+   /**
+    * Returns the topic expressions contained in this topic set.
+    */
+   TopicExpression[] getTopicExpressions(  );
+
+   /**
+    * Returns the topics contained in this topic set.
+    */
+   Topic[] getTopics(  );
+
+   /**
+    * @param topicExpr
+    */
+   void addTopicExpression( TopicExpression topicExpr )
+   throws TopicExpressionException;
+
+   /**
+    *
+    * @param topicPath the path to exactly one Topic (e.g. new QName( "http://example.org/topicSpace/example1", "t4/t5" ))
+    *
+    * @return true if this topic set contains the specified topic, or false if it does not
+    */
+   boolean containsTopic( QName topicPath );
+
+   /**
+    *
+    * @param topicExpr
+    * @return
+    * @throws TopicExpressionException
+    */
+   Topic[] evaluateTopicExpression( TopicExpression topicExpr )
+   throws TopicExpressionException;
 }

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeFactory.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeFactory.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeFactory.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeFactory.java Mon Oct 17 09:36:17 2005
@@ -1,33 +1,43 @@
-/*=============================================================================*
- *  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.topics;
-
-import org.apache.ws.notification.topics.v2004_06.TopicsTypeFactoryImpl;
-
-/**
- * A factory for types defined by the WS-Topics specification.
- */
-public abstract class TopicsTypeFactory
-{
-
-    public static TopicsTypeFactory newInstance()
-    {
-       return new TopicsTypeFactoryImpl();
-    }
-
-    public abstract TopicNamespace createTopicNamespace( String targetNamespace );
-
-}
+/*=============================================================================*
+ *  Copyright 2004 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.topics;
+
+import org.apache.ws.notification.topics.v2004_06.TopicsTypeFactoryImpl;
+
+/**
+ * A factory for types defined by the WS-Topics specification.
+ */
+public abstract class TopicsTypeFactory
+{
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public static TopicsTypeFactory newInstance(  )
+   {
+      return new TopicsTypeFactoryImpl(  );
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param targetNamespace DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public abstract TopicNamespace createTopicNamespace( String targetNamespace );
+}
\ No newline at end of file

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeReader.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeReader.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeReader.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeReader.java Mon Oct 17 09:36:17 2005
@@ -1,47 +1,73 @@
-/*=============================================================================*
- *  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.topics;
-
-import org.apache.ws.UnsupportedNamespaceException;
-import org.apache.ws.notification.topics.expression.InvalidTopicExpressionException;
-import org.apache.ws.notification.topics.expression.TopicExpression;
-import org.apache.ws.notification.topics.v2004_06.TopicsConstants;
-import org.apache.ws.notification.topics.v2004_06.TopicsTypeReaderImpl;
-import org.apache.xmlbeans.XmlObject;
-
-/**
- * TODO
- */
-public abstract class TopicsTypeReader
-{
-
-    public static TopicsTypeReader newInstance( String schemaNamespace ) throws UnsupportedNamespaceException
-    {
-        if ( schemaNamespace.equals( TopicsConstants.NSURI_WSTOP_SCHEMA ) )
-        {
-            return new TopicsTypeReaderImpl();
-        }
-        else
-        {
-            throw new UnsupportedNamespaceException( schemaNamespace + " is not the namespace of a supported version of the WS-Topics schema." );
-        }
-    }
-
-    public abstract TopicExpression toTopicExpression( XmlObject xBean ) throws InvalidTopicExpressionException;
-
-    public abstract TopicNamespace toTopicNamespace( XmlObject xBean );
-
-}
+/*=============================================================================*
+ *  Copyright 2004 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.topics;
+
+import org.apache.ws.UnsupportedNamespaceException;
+import org.apache.ws.notification.topics.expression.InvalidTopicExpressionException;
+import org.apache.ws.notification.topics.expression.TopicExpression;
+import org.apache.ws.notification.topics.v2004_06.TopicsConstants;
+import org.apache.ws.notification.topics.v2004_06.TopicsTypeReaderImpl;
+import org.apache.xmlbeans.XmlObject;
+
+/**
+ * TODO
+ */
+public abstract class TopicsTypeReader
+{
+   /**
+    * DOCUMENT_ME
+    *
+    * @param schemaNamespace DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    *
+    * @throws UnsupportedNamespaceException DOCUMENT_ME
+    */
+   public static TopicsTypeReader newInstance( String schemaNamespace )
+   throws UnsupportedNamespaceException
+   {
+      if ( schemaNamespace.equals( TopicsConstants.NSURI_WSTOP_SCHEMA ) )
+      {
+         return new TopicsTypeReaderImpl(  );
+      }
+      else
+      {
+         throw new UnsupportedNamespaceException( schemaNamespace
+                                                  + " is not the namespace of a supported version of the WS-Topics schema." );
+      }
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param xBean DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    *
+    * @throws InvalidTopicExpressionException DOCUMENT_ME
+    */
+   public abstract TopicExpression toTopicExpression( XmlObject xBean )
+   throws InvalidTopicExpressionException;
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param xBean DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public abstract TopicNamespace toTopicNamespace( XmlObject xBean );
+}
\ No newline at end of file

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeWriter.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeWriter.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeWriter.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeWriter.java Mon Oct 17 09:36:17 2005
@@ -1,96 +1,131 @@
-/*=============================================================================*
- *  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.topics;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.ws.UnsupportedNamespaceException;
-import org.apache.ws.notification.topics.expression.TopicExpression;
-import org.apache.ws.notification.topics.v2004_06.TopicsConstants;
-import org.apache.ws.notification.topics.v2004_06.TopicsTypeWriterImpl;
-import org.apache.ws.util.XmlBeanUtils;
-import org.apache.xmlbeans.XmlCursor;
-import org.apache.xmlbeans.XmlObject;
-
-import javax.xml.namespace.QName;
-
-/**
- * A writer that can serialize various WS-Topics types to strongly-typed {@link XmlObject}s.
- * It is capable of supporting multiple versions of the WS-Topics specification.
- */
-public abstract class TopicsTypeWriter
-{
-
-    public static TopicsTypeWriter newInstance( String schemaNamespace ) throws UnsupportedNamespaceException
-    {
-        if ( schemaNamespace.equals( TopicsConstants.NSURI_WSTOP_SCHEMA ) )
-        {
-            return new TopicsTypeWriterImpl();
-        }
-        else
-        {
-            throw new UnsupportedNamespaceException(
-                    schemaNamespace + " is not the namespace of a supported version of the WS-Topics schema." );
-        }
-    }
-
-    public abstract XmlObject toXmlObject( TopicExpression topicExpr, QName elemName );
-
-    public abstract XmlObject toXmlObject( TopicNamespace topicNs );
-
-    protected void copyContent( TopicExpression topicExpr,
-                                XmlObject topicExprXBean )
-    {
-        Object content = topicExpr.getContent();
-        if ( content instanceof QName )
-        {
-            QName topicPath = (QName) content;
-            XmlBeanUtils.setValue( topicExprXBean, toString( topicPath, topicExprXBean ) );
-        }
-        else if ( content instanceof QName[] )
-        {
-            QName[] topicPaths = (QName[]) content;
-            XmlBeanUtils.setValue( topicExprXBean, toString( topicPaths, topicExprXBean ) );
-        }
-    }
-
-    private String toString( QName topicPath, XmlObject targetXBean )
-    {
-        StringBuffer strBuf = new StringBuffer();
-        if ( StringUtils.isNotEmpty( topicPath.getNamespaceURI() ) )
-        {
-            XmlCursor xCursor = targetXBean.newCursor();
-            String prefix = xCursor.prefixForNamespace( topicPath.getNamespaceURI() );
-            xCursor.dispose();
-            strBuf.append( prefix );
-            strBuf.append( ':' );
-        }
-        strBuf.append( topicPath.getLocalPart() );
-        return strBuf.toString();
-    }
-
-    private String toString( QName[] topicPaths, XmlObject targetXBean )
-    {
-        StringBuffer strBuf = new StringBuffer();
-        for ( int i = 0; i < topicPaths.length - 1; i++ )
-        {
-            strBuf.append( toString( topicPaths[i], targetXBean ) );
-            strBuf.append( '|' );
-        }
-        strBuf.append( toString( topicPaths[topicPaths.length - 1], targetXBean ) );
-        return strBuf.toString();
-    }
-
-}
+/*=============================================================================*
+ *  Copyright 2004 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.topics;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.ws.UnsupportedNamespaceException;
+import org.apache.ws.notification.topics.expression.TopicExpression;
+import org.apache.ws.notification.topics.v2004_06.TopicsConstants;
+import org.apache.ws.notification.topics.v2004_06.TopicsTypeWriterImpl;
+import org.apache.ws.util.XmlBeanUtils;
+import org.apache.xmlbeans.XmlCursor;
+import org.apache.xmlbeans.XmlObject;
+import javax.xml.namespace.QName;
+
+/**
+ * A writer that can serialize various WS-Topics types to strongly-typed {@link XmlObject}s.
+ * It is capable of supporting multiple versions of the WS-Topics specification.
+ */
+public abstract class TopicsTypeWriter
+{
+   /**
+    * DOCUMENT_ME
+    *
+    * @param schemaNamespace DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    *
+    * @throws UnsupportedNamespaceException DOCUMENT_ME
+    */
+   public static TopicsTypeWriter newInstance( String schemaNamespace )
+   throws UnsupportedNamespaceException
+   {
+      if ( schemaNamespace.equals( TopicsConstants.NSURI_WSTOP_SCHEMA ) )
+      {
+         return new TopicsTypeWriterImpl(  );
+      }
+      else
+      {
+         throw new UnsupportedNamespaceException( schemaNamespace
+                                                  + " is not the namespace of a supported version of the WS-Topics schema." );
+      }
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param topicExpr DOCUMENT_ME
+    * @param elemName DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public abstract XmlObject toXmlObject( TopicExpression topicExpr,
+                                          QName           elemName );
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param topicNs DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public abstract XmlObject toXmlObject( TopicNamespace topicNs );
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param topicExpr DOCUMENT_ME
+    * @param topicExprXBean DOCUMENT_ME
+    */
+   protected void copyContent( TopicExpression topicExpr,
+                               XmlObject       topicExprXBean )
+   {
+      Object content = topicExpr.getContent(  );
+      if ( content instanceof QName )
+      {
+         QName topicPath = (QName) content;
+         XmlBeanUtils.setValue( topicExprXBean,
+                                toString( topicPath, topicExprXBean ) );
+      }
+      else if ( content instanceof QName[] )
+      {
+         QName[] topicPaths = (QName[]) content;
+         XmlBeanUtils.setValue( topicExprXBean,
+                                toString( topicPaths, topicExprXBean ) );
+      }
+   }
+
+   private String toString( QName     topicPath,
+                            XmlObject targetXBean )
+   {
+      StringBuffer strBuf = new StringBuffer(  );
+      if ( StringUtils.isNotEmpty( topicPath.getNamespaceURI(  ) ) )
+      {
+         XmlCursor xCursor = targetXBean.newCursor(  );
+         String    prefix = xCursor.prefixForNamespace( topicPath.getNamespaceURI(  ) );
+         xCursor.dispose(  );
+         strBuf.append( prefix );
+         strBuf.append( ':' );
+      }
+
+      strBuf.append( topicPath.getLocalPart(  ) );
+      return strBuf.toString(  );
+   }
+
+   private String toString( QName[]   topicPaths,
+                            XmlObject targetXBean )
+   {
+      StringBuffer strBuf = new StringBuffer(  );
+      for ( int i = 0; i < ( topicPaths.length - 1 ); i++ )
+      {
+         strBuf.append( toString( topicPaths[i], targetXBean ) );
+         strBuf.append( '|' );
+      }
+
+      strBuf.append( toString( topicPaths[topicPaths.length - 1], targetXBean ) );
+      return strBuf.toString(  );
+   }
+}
\ No newline at end of file

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/ConcreteTopicExpression.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/ConcreteTopicExpression.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/ConcreteTopicExpression.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/ConcreteTopicExpression.java Mon Oct 17 09:36:17 2005
@@ -1,63 +1,88 @@
-/*=============================================================================*
- *  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.topics.expression;
-
-import org.apache.ws.notification.topics.v2004_06.TopicsConstants;
-import org.apache.ws.notification.topics.expression.impl.AbstractTopicExpression;
-
-import javax.xml.namespace.QName;
-import java.io.ObjectOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-
-/**
- * A Concrete TopicExpression as defined by the WS-Topics specification.
- */
-public class ConcreteTopicExpression extends AbstractTopicExpression
-{
-    private transient QName m_topicPath;
-
-    protected ConcreteTopicExpression()
-    {
-    }
-
-    public ConcreteTopicExpression( QName topicPath )
-    {
-        super( TopicsConstants.TOPIC_EXPR_DIALECT_CONCRETE, topicPath );
-        m_topicPath = topicPath;
-    }
-
-    public QName getTopicPath()
-    {
-        return m_topicPath;
-    }
-   private void writeObject(ObjectOutputStream out) throws IOException
-   {
-      out.writeObject(m_topicPath.toString());
-   }
-   private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
-   {
-       String qname = (String)in.readObject();
-       m_topicPath = QName.valueOf(qname);
-       setContent(m_topicPath);
-       setDialect(TopicsConstants.TOPIC_EXPR_DIALECT_CONCRETE);
-   }
-    public boolean equals( Object obj )
-    {
-        return obj != null && obj instanceof ConcreteTopicExpression && obj.hashCode() == hashCode();
-    }
-
-}
+/*=============================================================================*
+ *  Copyright 2004 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.topics.expression;
+
+import org.apache.ws.notification.topics.expression.impl.AbstractTopicExpression;
+import org.apache.ws.notification.topics.v2004_06.TopicsConstants;
+import javax.xml.namespace.QName;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+/**
+ * A Concrete TopicExpression as defined by the WS-Topics specification.
+ */
+public class ConcreteTopicExpression
+   extends AbstractTopicExpression
+{
+   private transient QName m_topicPath;
+
+   /**
+    * Creates a new {@link ConcreteTopicExpression} object.
+    *
+    * @param topicPath DOCUMENT_ME
+    */
+   public ConcreteTopicExpression( QName topicPath )
+   {
+      super( TopicsConstants.TOPIC_EXPR_DIALECT_CONCRETE, topicPath );
+      m_topicPath = topicPath;
+   }
+
+   /**
+    * Creates a new {@link ConcreteTopicExpression} object.
+    */
+   protected ConcreteTopicExpression(  )
+   {
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public QName getTopicPath(  )
+   {
+      return m_topicPath;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param obj DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public boolean equals( Object obj )
+   {
+      return ( obj != null ) && obj instanceof ConcreteTopicExpression && ( obj.hashCode(  ) == hashCode(  ) );
+   }
+
+   private void readObject( ObjectInputStream in )
+   throws IOException, 
+          ClassNotFoundException
+   {
+      String qname = (String) in.readObject(  );
+      m_topicPath = QName.valueOf( qname );
+      setContent( m_topicPath );
+      setDialect( TopicsConstants.TOPIC_EXPR_DIALECT_CONCRETE );
+   }
+
+   private void writeObject( ObjectOutputStream out )
+   throws IOException
+   {
+      out.writeObject( m_topicPath.toString(  ) );
+   }
+}
\ No newline at end of file

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/FullTopicExpression.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/FullTopicExpression.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/FullTopicExpression.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/FullTopicExpression.java Mon Oct 17 09:36:17 2005
@@ -1,95 +1,116 @@
-/*=============================================================================*
- *  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.topics.expression;
-
-import org.apache.ws.notification.topics.expression.impl.AbstractTopicExpression;
-import org.apache.ws.notification.topics.v2004_06.TopicsConstants;
-
-import javax.xml.namespace.QName;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.OptionalDataException;
-import java.util.ArrayList;
-
-/**
- * A Full TopicExpression as defined by the WS-Topics specification.
- */
-public class FullTopicExpression extends AbstractTopicExpression
-{
-    private transient QName[] m_topicPaths;
-
-    protected FullTopicExpression()
-    {
-    }
-
-    public FullTopicExpression(QName topicPaths[])
-    {
-        super(TopicsConstants.TOPIC_EXPR_DIALECT_FULL, topicPaths);
-        m_topicPaths = topicPaths;
-    }
-
-    public QName[] getTopicPaths()
-    {
-        return m_topicPaths;
-    }
-
-    private void writeObject(ObjectOutputStream out) throws IOException
-    {
-        for (int i = 0; i < m_topicPaths.length; i++)
-        {
-            out.writeObject(m_topicPaths[i].toString());
-        }
-    }
-
-    private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
-    {
-        ArrayList list = new ArrayList();
-        while (true)//loop the input stream to read in the array
-        {
-            try
-            {
-                String qname = (String) in.readObject();
-                list.add(QName.valueOf(qname));
-            }
-            catch (OptionalDataException e)//catch this exception to determine eof
-            {
-                if (e.eof == true)
-                {
-                    break;
-                }
-                else
-                {
-                    throw e;
-                }
-            }
-        }
-        m_topicPaths = (QName[]) list.toArray(new QName[0]);
-        setContent(m_topicPaths);
-        setDialect(TopicsConstants.TOPIC_EXPR_DIALECT_FULL);
-    }
-
-
-    public boolean equals( Object obj )
-    {
-        return obj != null && obj instanceof FullTopicExpression && obj.hashCode() == hashCode();
-    }
-
-
-}
+/*=============================================================================*
+ *  Copyright 2004 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.topics.expression;
+
+import org.apache.ws.notification.topics.expression.impl.AbstractTopicExpression;
+import org.apache.ws.notification.topics.v2004_06.TopicsConstants;
+import javax.xml.namespace.QName;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.OptionalDataException;
+import java.util.ArrayList;
+
+/**
+ * A Full TopicExpression as defined by the WS-Topics specification.
+ */
+public class FullTopicExpression
+   extends AbstractTopicExpression
+{
+   private transient QName[] m_topicPaths;
+
+   /**
+    * Creates a new {@link FullTopicExpression} object.
+    *
+    * @param topicPaths DOCUMENT_ME
+    */
+   public FullTopicExpression( QName[] topicPaths )
+   {
+      super( TopicsConstants.TOPIC_EXPR_DIALECT_FULL, topicPaths );
+      m_topicPaths = topicPaths;
+   }
+
+   /**
+    * Creates a new {@link FullTopicExpression} object.
+    */
+   protected FullTopicExpression(  )
+   {
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public QName[] getTopicPaths(  )
+   {
+      return m_topicPaths;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param obj DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public boolean equals( Object obj )
+   {
+      return ( obj != null ) && obj instanceof FullTopicExpression && ( obj.hashCode(  ) == hashCode(  ) );
+   }
+
+   private void readObject( ObjectInputStream in )
+   throws IOException, 
+          ClassNotFoundException
+   {
+      ArrayList list = new ArrayList(  );
+      while ( true ) //loop the input stream to read in the array
+      {
+         try
+         {
+            String qname = (String) in.readObject(  );
+            list.add( QName.valueOf( qname ) );
+         }
+         catch ( OptionalDataException e ) //catch this exception to determine eof
+         {
+            if ( e.eof == true )
+            {
+               break;
+            }
+            else
+            {
+               throw e;
+            }
+         }
+      }
+
+      m_topicPaths = (QName[]) list.toArray( new QName[0] );
+      setContent( m_topicPaths );
+      setDialect( TopicsConstants.TOPIC_EXPR_DIALECT_FULL );
+   }
+
+   private void writeObject( ObjectOutputStream out )
+   throws IOException
+   {
+      for ( int i = 0; i < m_topicPaths.length; i++ )
+      {
+         out.writeObject( m_topicPaths[i].toString(  ) );
+      }
+   }
+}
\ No newline at end of file

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/SimpleTopicExpression.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/SimpleTopicExpression.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/SimpleTopicExpression.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/SimpleTopicExpression.java Mon Oct 17 09:36:17 2005
@@ -1,67 +1,90 @@
-/*=============================================================================*
- *  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.topics.expression;
-
-import org.apache.ws.notification.topics.v2004_06.TopicsConstants;
-import org.apache.ws.notification.topics.expression.impl.AbstractTopicExpression;
-
-import javax.xml.namespace.QName;
-import java.io.ObjectOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-
-/**
- * A Simple TopicExpression as defined by the WS-Topics specification.
- */
-public class SimpleTopicExpression extends AbstractTopicExpression
-{
-    //this protects us from serialization problems
-   // private static final long serialVersionUID = -7927173894256703787L;
-    private transient QName m_topicPath;
-
-
-    protected SimpleTopicExpression()
-     {
-     }
-
-    public SimpleTopicExpression( QName topicPath )
-    {
-        super( TopicsConstants.TOPIC_EXPR_DIALECT_SIMPLE, topicPath );
-        m_topicPath = topicPath;
-    }
-
-    public QName getTopicPath()
-    {
-        return m_topicPath;
-    }
-
-   private void writeObject(ObjectOutputStream out) throws IOException
-   {
-      out.writeObject(m_topicPath.toString());
-   }
-   private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
-   {
-       String qname = (String)in.readObject();
-       m_topicPath = QName.valueOf(qname);
-       setContent(m_topicPath);
-       setDialect(TopicsConstants.TOPIC_EXPR_DIALECT_SIMPLE);
-   }
-    public boolean equals( Object obj )
-    {
-        return obj != null && obj instanceof SimpleTopicExpression && obj.hashCode() == hashCode();
-    }
-
-}
+/*=============================================================================*
+ *  Copyright 2004 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.topics.expression;
+
+import org.apache.ws.notification.topics.expression.impl.AbstractTopicExpression;
+import org.apache.ws.notification.topics.v2004_06.TopicsConstants;
+import javax.xml.namespace.QName;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+/**
+ * A Simple TopicExpression as defined by the WS-Topics specification.
+ */
+public class SimpleTopicExpression
+   extends AbstractTopicExpression
+{
+   //this protects us from serialization problems
+   // private static final long serialVersionUID = -7927173894256703787L;
+   private transient QName m_topicPath;
+
+   /**
+    * Creates a new {@link SimpleTopicExpression} object.
+    *
+    * @param topicPath DOCUMENT_ME
+    */
+   public SimpleTopicExpression( QName topicPath )
+   {
+      super( TopicsConstants.TOPIC_EXPR_DIALECT_SIMPLE, topicPath );
+      m_topicPath = topicPath;
+   }
+
+   /**
+    * Creates a new {@link SimpleTopicExpression} object.
+    */
+   protected SimpleTopicExpression(  )
+   {
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public QName getTopicPath(  )
+   {
+      return m_topicPath;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param obj DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public boolean equals( Object obj )
+   {
+      return ( obj != null ) && obj instanceof SimpleTopicExpression && ( obj.hashCode(  ) == hashCode(  ) );
+   }
+
+   private void readObject( ObjectInputStream in )
+   throws IOException, 
+          ClassNotFoundException
+   {
+      String qname = (String) in.readObject(  );
+      m_topicPath = QName.valueOf( qname );
+      setContent( m_topicPath );
+      setDialect( TopicsConstants.TOPIC_EXPR_DIALECT_SIMPLE );
+   }
+
+   private void writeObject( ObjectOutputStream out )
+   throws IOException
+   {
+      out.writeObject( m_topicPath.toString(  ) );
+   }
+}
\ No newline at end of file

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/TopicExpression.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/TopicExpression.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/TopicExpression.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/TopicExpression.java Mon Oct 17 09:36:17 2005
@@ -20,9 +20,9 @@
 /**
  * Java representation of the wsnt:TopicExpressionType XML schema type.
  */
-public interface TopicExpression extends Serializable
+public interface TopicExpression
+   extends Serializable
 {
-
    /**
     * Returns the dialect-dependent content of this topic expression (e.g. a QName or a String).
     */
@@ -32,5 +32,4 @@
     * Returns the dialect URI of this topic expression.
     */
    String getDialect(  );
-
 }

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/TopicExpressionEngine.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/TopicExpressionEngine.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/TopicExpressionEngine.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/TopicExpressionEngine.java Mon Oct 17 09:36:17 2005
@@ -22,7 +22,6 @@
 import org.apache.ws.notification.topics.expression.impl.ConcreteTopicExpressionEvaluator;
 import org.apache.ws.notification.topics.expression.impl.FullTopicExpressionEvaluator;
 import org.apache.ws.notification.topics.expression.impl.SimpleTopicExpressionEvaluator;
-
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -35,138 +34,137 @@
  */
 public class TopicExpressionEngine
 {
-
-    private static final Log LOG = LogFactory.getLog( TopicExpressionEngine.class.getName() );
-    private TopicNamespaceRegistry m_topicNsRegistry;
-    private Map m_evaluators = new HashMap();
-
-    /**
-     * Creates a new {@link TopicExpressionEngine}.
-     */
-    public TopicExpressionEngine( TopicNamespaceRegistry topicNsRegistry )
-    {
-        this( topicNsRegistry, new HashMap() );
-    }
-
-    /**
-     * Creates a new {@link TopicExpressionEngine}.
-     *
-     * @param topicNsRegistry
-     * @param topicExprEvaluatorMap
-     */
-    public TopicExpressionEngine( TopicNamespaceRegistry topicNsRegistry, Map topicExprEvaluatorMap )
-    {
-        m_topicNsRegistry = topicNsRegistry;
-        m_evaluators = topicExprEvaluatorMap;
-        if ( m_evaluators.isEmpty() )
-        {
-            // defaults...
-            registerEvaluator( new SimpleTopicExpressionEvaluator() );
-            registerEvaluator( new ConcreteTopicExpressionEvaluator() );
-            registerEvaluator( new FullTopicExpressionEvaluator() );
-        }
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @param dialect DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public synchronized TopicExpressionEvaluator getEvaluator( String dialect )
-    {
-        return (TopicExpressionEvaluator) m_evaluators.get( dialect );
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public synchronized String[] getSupportedDialects()
-    {
-        return (String[]) m_evaluators.keySet().toArray( new String[m_evaluators.size()] );
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @param topicExpr       DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     *
-     * @throws org.apache.ws.notification.topics.expression.TopicPathDialectUnknownException
-     *                                  DOCUMENT_ME
-     * @throws TopicExpressionResolutionException
-     *                                  DOCUMENT_ME
-     * @throws InvalidTopicExpressionException
-     *                                  DOCUMENT_ME
-     * @throws TopicExpressionException DOCUMENT_ME
-     * @throws TopicPathDialectUnknownException
-     *                                  DOCUMENT_ME
-     */
-    public Topic[] evaluateTopicExpression( TopicExpression topicExpr )
-            throws TopicPathDialectUnknownException,
-            TopicExpressionResolutionException,
-            InvalidTopicExpressionException,
-            TopicExpressionException
-    {
-        if ( topicExpr == null )
-        {
-            throw new IllegalArgumentException( "Specified TopicExpression was null." );
-        }
-
-        if ( topicExpr.getDialect() == null )
-        {
-            throw new org.apache.ws.notification.topics.expression.TopicPathDialectUnknownException(
-                    "nullArgument"
-                    + "topicExpression.dialect" );
-        }
-
-        String dialect = topicExpr.getDialect();
-        TopicExpressionEvaluator evaluator = getEvaluator( dialect );
-
-        if ( evaluator == null )
-        {
-            if ( LOG.isDebugEnabled() )
+   private static final Log       LOG               = LogFactory.getLog( TopicExpressionEngine.class.getName(  ) );
+   private TopicNamespaceRegistry m_topicNsRegistry;
+   private Map                    m_evaluators = new HashMap(  );
+
+   /**
+    * Creates a new {@link TopicExpressionEngine}.
+    */
+   public TopicExpressionEngine( TopicNamespaceRegistry topicNsRegistry )
+   {
+      this( topicNsRegistry, new HashMap(  ) );
+   }
+
+   /**
+    * Creates a new {@link TopicExpressionEngine}.
+    *
+    * @param topicNsRegistry
+    * @param topicExprEvaluatorMap
+    */
+   public TopicExpressionEngine( TopicNamespaceRegistry topicNsRegistry,
+                                 Map                    topicExprEvaluatorMap )
+   {
+      m_topicNsRegistry    = topicNsRegistry;
+      m_evaluators         = topicExprEvaluatorMap;
+      if ( m_evaluators.isEmpty(  ) )
+      {
+         // defaults...
+         registerEvaluator( new SimpleTopicExpressionEvaluator(  ) );
+         registerEvaluator( new ConcreteTopicExpressionEvaluator(  ) );
+         registerEvaluator( new FullTopicExpressionEvaluator(  ) );
+      }
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param dialect DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public synchronized TopicExpressionEvaluator getEvaluator( String dialect )
+   {
+      return (TopicExpressionEvaluator) m_evaluators.get( dialect );
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public synchronized String[] getSupportedDialects(  )
+   {
+      return (String[]) m_evaluators.keySet(  ).toArray( new String[m_evaluators.size(  )] );
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param topicExpr       DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    *
+    * @throws org.apache.ws.notification.topics.expression.TopicPathDialectUnknownException
+    *                                  DOCUMENT_ME
+    * @throws TopicExpressionResolutionException
+    *                                  DOCUMENT_ME
+    * @throws InvalidTopicExpressionException
+    *                                  DOCUMENT_ME
+    * @throws TopicExpressionException DOCUMENT_ME
+    * @throws TopicPathDialectUnknownException
+    *                                  DOCUMENT_ME
+    */
+   public Topic[] evaluateTopicExpression( TopicExpression topicExpr )
+   throws TopicPathDialectUnknownException, 
+          TopicExpressionResolutionException, 
+          InvalidTopicExpressionException, 
+          TopicExpressionException
+   {
+      if ( topicExpr == null )
+      {
+         throw new IllegalArgumentException( "Specified TopicExpression was null." );
+      }
+
+      if ( topicExpr.getDialect(  ) == null )
+      {
+         throw new org.apache.ws.notification.topics.expression.TopicPathDialectUnknownException( "nullArgument"
+                                                                                                  + "topicExpression.dialect" );
+      }
+
+      String                   dialect   = topicExpr.getDialect(  );
+      TopicExpressionEvaluator evaluator = getEvaluator( dialect );
+
+      if ( evaluator == null )
+      {
+         if ( LOG.isDebugEnabled(  ) )
+         {
+            LOG.debug( "Dialect not supported:" + dialect );
+            LOG.debug( "Registered dialects are:" );
+            Iterator keyIterator = m_evaluators.keySet(  ).iterator(  );
+            Object   key = null;
+            while ( keyIterator.hasNext(  ) )
             {
-                LOG.debug( "Dialect not supported:" + dialect );
-                LOG.debug( "Registered dialects are:" );
-                Iterator keyIterator = m_evaluators.keySet().iterator();
-                Object key = null;
-                while ( keyIterator.hasNext() )
-                {
-                    key = keyIterator.next();
-                    LOG.debug( key );
-                }
-
-                LOG.debug( "key.equals(dialect): " + ( key.equals( dialect.toString() ) ) );
-                LOG.debug( "m_evaluators.containsKey(dialect): "
-                        + m_evaluators.containsKey( dialect ) );
-                LOG.debug( "HashCode of key: " + String.valueOf( key.hashCode() ) );
-                LOG.debug( "HashCode of dialect: " + String.valueOf( dialect.toString().hashCode() ) );
-                LOG.debug( "Object stored for key: " + m_evaluators.get( key ) );
+               key = keyIterator.next(  );
+               LOG.debug( key );
             }
-            throw new TopicPathDialectUnknownException( "The dialect '" + dialect + "' was not recognized." );
-        }
-        return evaluator.evaluate( m_topicNsRegistry, topicExpr );
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @param evaluator DOCUMENT_ME
-     */
-    public void registerEvaluator( TopicExpressionEvaluator evaluator )
-    {
-        LOG.debug( "Adding dialects for " + evaluator.getClass().getName() );
-        String[] dialects = evaluator.getDialects();
-        for ( int i = 0; i < dialects.length; i++ )
-        {
-            LOG.debug( "Adding dialect: " + dialects[i] );
-            m_evaluators.put( dialects[i], evaluator );
-        }
-    }
 
+            LOG.debug( "key.equals(dialect): " + ( key.equals( dialect.toString(  ) ) ) );
+            LOG.debug( "m_evaluators.containsKey(dialect): " + m_evaluators.containsKey( dialect ) );
+            LOG.debug( "HashCode of key: " + String.valueOf( key.hashCode(  ) ) );
+            LOG.debug( "HashCode of dialect: " + String.valueOf( dialect.toString(  ).hashCode(  ) ) );
+            LOG.debug( "Object stored for key: " + m_evaluators.get( key ) );
+         }
+
+         throw new TopicPathDialectUnknownException( "The dialect '" + dialect + "' was not recognized." );
+      }
+
+      return evaluator.evaluate( m_topicNsRegistry, topicExpr );
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param evaluator DOCUMENT_ME
+    */
+   public void registerEvaluator( TopicExpressionEvaluator evaluator )
+   {
+      LOG.debug( "Adding dialects for " + evaluator.getClass(  ).getName(  ) );
+      String[] dialects = evaluator.getDialects(  );
+      for ( int i = 0; i < dialects.length; i++ )
+      {
+         LOG.debug( "Adding dialect: " + dialects[i] );
+         m_evaluators.put( dialects[i], evaluator );
+      }
+   }
 }

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/TopicExpressionEvaluator.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/TopicExpressionEvaluator.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/TopicExpressionEvaluator.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/TopicExpressionEvaluator.java Mon Oct 17 09:36:17 2005
@@ -47,7 +47,8 @@
     *                                  if the topic expression is invalid
     * @throws TopicExpressionException if any other error occurs
     */
-   Topic[] evaluate( TopicNamespaceRegistry topicNsRegistry, TopicExpression topicExpr )
+   Topic[] evaluate( TopicNamespaceRegistry topicNsRegistry,
+                     TopicExpression        topicExpr )
    throws TopicPathDialectUnknownException, 
           TopicExpressionResolutionException, 
           InvalidTopicExpressionException, 

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/impl/AbstractTopicExpression.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/impl/AbstractTopicExpression.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/impl/AbstractTopicExpression.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/impl/AbstractTopicExpression.java Mon Oct 17 09:36:17 2005
@@ -1,72 +1,108 @@
-/*=============================================================================*
- *  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.topics.expression.impl;
-
-import org.apache.ws.notification.topics.expression.TopicExpression;
-
-/**
- * An abstract implementation of <code>TopicExpression</code> that can be extended by dialect-specific implementations.
- *
- * @author Ian Springer
- */
-public abstract class AbstractTopicExpression implements TopicExpression
-{
-    private transient String m_dialect;
-    private transient Object m_content;
-
-    protected AbstractTopicExpression()
-    {
-    }
-
-    public AbstractTopicExpression( String dialect, Object content )
-    {
-        m_dialect = dialect;
-        m_content = content;
-    }
-
-    public Object getContent()
-    {
-        return m_content;
-    }
-
-    public String getDialect()
-    {
-        return m_dialect;
-    }
-
-    public String toString()
-    {
-        return m_content.toString();
-    }
-
-    protected void setDialect(String dialect)
-    {
-        m_dialect = dialect;
-    }
-
-    protected void setContent(Object content)
-    {
-        m_content = content;
-    }
-    /**
-     * @return
-     */
-    public int hashCode()
-    {
-        return toString().hashCode();
-    }
-
-}
+/*=============================================================================*
+ *  Copyright 2004 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.topics.expression.impl;
+
+import org.apache.ws.notification.topics.expression.TopicExpression;
+
+/**
+ * An abstract implementation of <code>TopicExpression</code> that can be extended by dialect-specific implementations.
+ *
+ * @author Ian Springer
+ */
+public abstract class AbstractTopicExpression
+   implements TopicExpression
+{
+   private transient String m_dialect;
+   private transient Object m_content;
+
+   /**
+    * Creates a new {@link AbstractTopicExpression} object.
+    *
+    * @param dialect DOCUMENT_ME
+    * @param content DOCUMENT_ME
+    */
+   public AbstractTopicExpression( String dialect,
+                                   Object content )
+   {
+      m_dialect    = dialect;
+      m_content    = content;
+   }
+
+   /**
+    * Creates a new {@link AbstractTopicExpression} object.
+    */
+   protected AbstractTopicExpression(  )
+   {
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public Object getContent(  )
+   {
+      return m_content;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public String getDialect(  )
+   {
+      return m_dialect;
+   }
+
+   /**
+    * @return
+    */
+   public int hashCode(  )
+   {
+      return toString(  ).hashCode(  );
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public String toString(  )
+   {
+      return m_content.toString(  );
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param content DOCUMENT_ME
+    */
+   protected void setContent( Object content )
+   {
+      m_content = content;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param dialect DOCUMENT_ME
+    */
+   protected void setDialect( String dialect )
+   {
+      m_dialect = dialect;
+   }
+}
\ No newline at end of file

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/impl/AbstractTopicExpressionEvaluator.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/impl/AbstractTopicExpressionEvaluator.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/impl/AbstractTopicExpressionEvaluator.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/impl/AbstractTopicExpressionEvaluator.java Mon Oct 17 09:36:17 2005
@@ -21,7 +21,6 @@
 import org.apache.ws.notification.topics.expression.InvalidTopicExpressionException;
 import org.apache.ws.notification.topics.expression.TopicExpressionEvaluator;
 import org.apache.ws.notification.topics.expression.TopicExpressionResolutionException;
-
 import javax.xml.namespace.QName;
 import java.util.Collections;
 import java.util.HashMap;
@@ -34,54 +33,55 @@
  * @author Ian Springer
  */
 public abstract class AbstractTopicExpressionEvaluator
-        implements TopicExpressionEvaluator
+   implements TopicExpressionEvaluator
 {
+   /** DOCUMENT_ME */
+   protected static final Map RESULTS_CACHE = Collections.synchronizedMap( new HashMap(  ) );
 
-    protected static final Map RESULTS_CACHE = Collections.synchronizedMap( new HashMap() );
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @param topicPath DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     *
-     * @throws TopicExpressionResolutionException
-     *          DOCUMENT_ME
-     */
-    protected TopicNamespace getTopicNamespace( TopicNamespaceRegistry topicNsRegistry, QName topicPath )
-            throws TopicExpressionResolutionException
-    {
-        TopicNamespace topicNs = topicNsRegistry.getTopicNamespace( topicPath.getNamespaceURI() );
-        if ( topicNs == null )
-        {
-            throw new TopicExpressionResolutionException( "Topic path '" + topicPath
-                    + "' references an unknown TopicNamespace with target namespace '"
-                    + topicPath.getNamespaceURI() + "'." );
-        }
-        return topicNs;
-    }
-
-    /**
-     * Performs basic validation of the specified topic path.
-     *
-     * @param topicPath a topicPath
-     *
-     * @throws InvalidTopicExpressionException     
-     */
-    protected void validateTopicPath( QName topicPath )
-            throws InvalidTopicExpressionException
-    {
-        String localPart = topicPath.getLocalPart();
-        if ( StringUtils.isEmpty( localPart ) || !StringUtils.containsNone( localPart, " \t\n\r\f" ) )
-        {
-            throw new InvalidTopicExpressionException( "Topic path '" + topicPath + "' contains whitespace." );
-        }
-        if ( localPart.indexOf( ':' ) != -1 )
-        {
-            throw new InvalidTopicExpressionException( "Topic path '" + topicPath
-                    + "' contains a colon." );
-        }
-    }
-
-}
+   /**
+    * DOCUMENT_ME
+    *
+    * @param topicPath DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    *
+    * @throws TopicExpressionResolutionException
+    *          DOCUMENT_ME
+    */
+   protected TopicNamespace getTopicNamespace( TopicNamespaceRegistry topicNsRegistry,
+                                               QName                  topicPath )
+   throws TopicExpressionResolutionException
+   {
+      TopicNamespace topicNs = topicNsRegistry.getTopicNamespace( topicPath.getNamespaceURI(  ) );
+      if ( topicNs == null )
+      {
+         throw new TopicExpressionResolutionException( "Topic path '" + topicPath
+                                                       + "' references an unknown TopicNamespace with target namespace '"
+                                                       + topicPath.getNamespaceURI(  ) + "'." );
+      }
+
+      return topicNs;
+   }
+
+   /**
+    * Performs basic validation of the specified topic path.
+    *
+    * @param topicPath a topicPath
+    *
+    * @throws InvalidTopicExpressionException
+    */
+   protected void validateTopicPath( QName topicPath )
+   throws InvalidTopicExpressionException
+   {
+      String localPart = topicPath.getLocalPart(  );
+      if ( StringUtils.isEmpty( localPart ) || !StringUtils.containsNone( localPart, " \t\n\r\f" ) )
+      {
+         throw new InvalidTopicExpressionException( "Topic path '" + topicPath + "' contains whitespace." );
+      }
+
+      if ( localPart.indexOf( ':' ) != -1 )
+      {
+         throw new InvalidTopicExpressionException( "Topic path '" + topicPath + "' contains a colon." );
+      }
+   }
+}
\ No newline at end of file

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/impl/ConcreteTopicExpressionEvaluator.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/impl/ConcreteTopicExpressionEvaluator.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/impl/ConcreteTopicExpressionEvaluator.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/expression/impl/ConcreteTopicExpressionEvaluator.java Mon Oct 17 09:36:17 2005
@@ -17,8 +17,8 @@
 
 import org.apache.ws.notification.topics.Topic;
 import org.apache.ws.notification.topics.TopicNamespace;
-import org.apache.ws.notification.topics.TopicSiblingSet;
 import org.apache.ws.notification.topics.TopicNamespaceRegistry;
+import org.apache.ws.notification.topics.TopicSiblingSet;
 import org.apache.ws.notification.topics.expression.ConcreteTopicExpression;
 import org.apache.ws.notification.topics.expression.InvalidTopicExpressionException;
 import org.apache.ws.notification.topics.expression.TopicExpression;
@@ -26,7 +26,6 @@
 import org.apache.ws.notification.topics.expression.TopicExpressionResolutionException;
 import org.apache.ws.notification.topics.expression.TopicPathDialectUnknownException;
 import org.apache.ws.notification.topics.v2004_06.TopicsConstants;
-
 import javax.xml.namespace.QName;
 import java.util.ArrayList;
 import java.util.List;
@@ -39,94 +38,100 @@
  * @see org.apache.ws.notification.topics.expression.TopicExpressionEvaluator
  */
 public class ConcreteTopicExpressionEvaluator
-        extends AbstractTopicExpressionEvaluator
+   extends AbstractTopicExpressionEvaluator
 {
+   private static final String[] SUPPORTED_DIALECTS = 
+                                                      {
+                                                         TopicsConstants.TOPIC_EXPR_DIALECT_CONCRETE
+                                                      };
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public String[] getDialects(  )
+   {
+      return SUPPORTED_DIALECTS;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param topicNsRegistry
+    * @param topicExpr  a "Concrete" topic expression - MUST be an instance of {@link ConcreteTopicExpression}
+    *
+    * @return DOCUMENT_ME
+    *
+    * @throws TopicPathDialectUnknownException
+    *                                  DOCUMENT_ME
+    * @throws TopicExpressionResolutionException
+    *                                  DOCUMENT_ME
+    * @throws InvalidTopicExpressionException
+    *                                  DOCUMENT_ME
+    * @throws TopicExpressionException DOCUMENT_ME
+    */
+   public Topic[] evaluate( TopicNamespaceRegistry topicNsRegistry,
+                            TopicExpression        topicExpr )
+   throws TopicPathDialectUnknownException, 
+          TopicExpressionResolutionException, 
+          InvalidTopicExpressionException, 
+          TopicExpressionException
+   {
+      Topic[] results;
+      if ( RESULTS_CACHE.containsKey( topicExpr ) )
+      {
+         results = (Topic[]) RESULTS_CACHE.get( topicExpr );
+      }
+      else
+      {
+         ConcreteTopicExpression concreteTopicExpr = (ConcreteTopicExpression) topicExpr;
+         results = evaluateTopicPath( topicNsRegistry,
+                                      concreteTopicExpr.getTopicPath(  ) );
+         RESULTS_CACHE.put( topicExpr, results );
+      }
+
+      return results;
+   }
+
+   private Topic[] evaluateTopicPath( TopicNamespaceRegistry topicNsRegistry,
+                                      QName                  topicPath )
+   throws TopicExpressionResolutionException, 
+          InvalidTopicExpressionException
+   {
+      validateTopicPath( topicPath );
+      List           matchedTopics = new ArrayList(  );
+      TopicNamespace topicNs = getTopicNamespace( topicNsRegistry, topicPath );
+      if ( ( topicPath.getLocalPart(  ).indexOf( "//" ) != -1 )
+           || ( topicPath.getLocalPart(  ).indexOf( "*" ) != -1 )
+           || ( topicPath.getLocalPart(  ).indexOf( "|" ) != -1 )
+           || ( topicPath.getLocalPart(  ).indexOf( "." ) != -1 ) )
+      {
+         throw new InvalidTopicExpressionException( "Topic path '" + topicPath
+                                                    + "' contains one or more illegal characters ('//', '*', '|' or '.')." );
+      }
+
+      StringTokenizer pathTokenizer = new StringTokenizer( topicPath.getLocalPart(  ),
+                                                           "/" );
+      TopicSiblingSet topicSiblingSet = topicNs;
+      boolean         resolvedPath    = true;
+      while ( pathTokenizer.hasMoreTokens(  ) )
+      {
+         String name = pathTokenizer.nextToken(  );
+         if ( !topicSiblingSet.containsTopic( name ) )
+         {
+            resolvedPath = false;
+            break;
+         }
+
+         topicSiblingSet = topicSiblingSet.getTopic( name );
+      }
+
+      if ( resolvedPath )
+      {
+         matchedTopics.add( topicSiblingSet );
+      }
 
-    private static final String[] SUPPORTED_DIALECTS =
-            {
-                TopicsConstants.TOPIC_EXPR_DIALECT_CONCRETE
-            };
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public String[] getDialects()
-    {
-        return SUPPORTED_DIALECTS;
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @param topicNsRegistry
-     * @param topicExpr  a "Concrete" topic expression - MUST be an instance of {@link ConcreteTopicExpression}
-     *
-     * @return DOCUMENT_ME
-     *
-     * @throws TopicPathDialectUnknownException
-     *                                  DOCUMENT_ME
-     * @throws TopicExpressionResolutionException
-     *                                  DOCUMENT_ME
-     * @throws InvalidTopicExpressionException
-     *                                  DOCUMENT_ME
-     * @throws TopicExpressionException DOCUMENT_ME
-     */
-    public Topic[] evaluate( TopicNamespaceRegistry topicNsRegistry, TopicExpression topicExpr )
-            throws TopicPathDialectUnknownException,
-            TopicExpressionResolutionException,
-            InvalidTopicExpressionException,
-            TopicExpressionException
-    {
-        Topic[] results;
-        if ( RESULTS_CACHE.containsKey( topicExpr ) )
-        {
-           results = (Topic[]) RESULTS_CACHE.get( topicExpr );
-        }
-        else
-        {
-           ConcreteTopicExpression concreteTopicExpr = (ConcreteTopicExpression) topicExpr;
-           results = evaluateTopicPath( topicNsRegistry, concreteTopicExpr.getTopicPath() );
-           RESULTS_CACHE.put( topicExpr, results );
-        }
-        return results;
-    }
-
-    private Topic[] evaluateTopicPath( TopicNamespaceRegistry topicNsRegistry, QName topicPath )
-            throws TopicExpressionResolutionException,
-            InvalidTopicExpressionException
-    {
-        validateTopicPath( topicPath );
-        List matchedTopics = new ArrayList();
-        TopicNamespace topicNs = getTopicNamespace( topicNsRegistry, topicPath );
-        if ( ( topicPath.getLocalPart().indexOf( "//" ) != -1 )
-                || ( topicPath.getLocalPart().indexOf( "*" ) != -1 )
-                || ( topicPath.getLocalPart().indexOf( "|" ) != -1 )
-                || ( topicPath.getLocalPart().indexOf( "." ) != -1 ) )
-        {
-            throw new InvalidTopicExpressionException(
-                    "Topic path '" + topicPath
-                    + "' contains one or more illegal characters ('//', '*', '|' or '.')." );
-        }
-        StringTokenizer pathTokenizer = new StringTokenizer( topicPath.getLocalPart(),
-                "/" );
-        TopicSiblingSet topicSiblingSet = topicNs;
-        boolean resolvedPath = true;
-        while ( pathTokenizer.hasMoreTokens() )
-        {
-            String name = pathTokenizer.nextToken();
-            if ( !topicSiblingSet.containsTopic( name ) )
-            {
-                resolvedPath = false;
-                break;
-            }
-            topicSiblingSet = topicSiblingSet.getTopic( name );
-        }
-        if ( resolvedPath )
-        {
-            matchedTopics.add( topicSiblingSet );
-        }
-        return (Topic[]) matchedTopics.toArray( new Topic[0] );
-    }
+      return (Topic[]) matchedTopics.toArray( new Topic[0] );
+   }
 }



Mime
View raw message