[seam-commits] Seam SVN: r10588 - branches/community/Seam_2_1/src/resteasy/org/jboss/seam/resteasy.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Apr 22 12:30:18 EDT 2009


Author: jharting
Date: 2009-04-22 12:30:17 -0400 (Wed, 22 Apr 2009)
New Revision: 10588

Modified:
   branches/community/Seam_2_1/src/resteasy/org/jboss/seam/resteasy/AbstractResource.java
   branches/community/Seam_2_1/src/resteasy/org/jboss/seam/resteasy/ResteasyDispatcher.java
Log:
JBSEAM-4140

Modified: branches/community/Seam_2_1/src/resteasy/org/jboss/seam/resteasy/AbstractResource.java
===================================================================
--- branches/community/Seam_2_1/src/resteasy/org/jboss/seam/resteasy/AbstractResource.java	2009-04-22 14:52:17 UTC (rev 10587)
+++ branches/community/Seam_2_1/src/resteasy/org/jboss/seam/resteasy/AbstractResource.java	2009-04-22 16:30:17 UTC (rev 10588)
@@ -104,8 +104,7 @@
    }
 
    /**
-    * Retrieve a suffix of this resource's URI. This property does not have to
-    * be set. @Path annotation can be used insted to set the URI.
+    * Retrieve a suffix of this resource's URI. See {@link #setPath(String path)}
     * 
     * @see javax.ws.rs.Path
     * @return path
@@ -116,7 +115,9 @@
    }
 
    /**
-    * see {@link #getPath()}
+    * Set the path this resource will operate on. This method is intended to be
+    * used only by Seam to create a resource configured in component descriptor.
+    * To specify the path in other cases, use @Path annotation. See
     * 
     * @param path
     */

Modified: branches/community/Seam_2_1/src/resteasy/org/jboss/seam/resteasy/ResteasyDispatcher.java
===================================================================
--- branches/community/Seam_2_1/src/resteasy/org/jboss/seam/resteasy/ResteasyDispatcher.java	2009-04-22 14:52:17 UTC (rev 10587)
+++ branches/community/Seam_2_1/src/resteasy/org/jboss/seam/resteasy/ResteasyDispatcher.java	2009-04-22 16:30:17 UTC (rev 10588)
@@ -166,22 +166,18 @@
                             {
                             }
                         };
-                    // Register on specific path if component has it's path property set to not-null value
-                    if (AbstractResource.class.isAssignableFrom(seamComponent.getBeanClass()))
+                    // Register component on specific path if the component is a ResourceHome or ResourceQuery component configured in components.xml
+                    if (seamComponent.getBeanClass().equals(ResourceHome.class) || seamComponent.getBeanClass().equals(ResourceQuery.class))
                     {
-                       // TODO get the path some other way - it may not be possible to create a instance at this time
                        AbstractResource instance = (AbstractResource) seamComponent.newInstance();
                        String path = instance.getPath();
                        if (instance.getPath() != null)
                        {
                           log.debug("registering resource {0} on path {1}", seamComponent.getName(), path);
                           registry.addResourceFactory(factory, path);
+                       } else {
+                          log.warn("Unable to  register {0} resource on null path.", seamComponent.getName());
                        }
-                       else
-                       {
-                          log.debug("registering resource {0}", seamComponent.getName());
-                          registry.addResourceFactory(factory);
-                       }
                     }
                     else
                     {




More information about the seam-commits mailing list