users@jsr311.java.net

UriInfo.getAncestorResource*()

From: Stephan Koops <Stephan.Koops_at_web.de>
Date: Thu, 13 Mar 2008 12:48:35 +0100

Hello all,

I have some new remarks:

*UriInfo.getAncestorResource*()*

    * I think it is better to return the root resource class (and
      especially the URI) as last and not as first. Did anyone think,
      the root resource class should be at the beginning? I remember,
      that Marc said, he has no special preferences.
    * I think it is good to add in the javadoc explicit, that the query
      is never returned.
    * Both Lists should or must be unmodifiable (add to javadoc)

*UriBuilder*

    * *build(int...)*? I think it is useful to add
      UriBuilder.build(int...), because often IDs are used for the URI
      build, and they are often Integers (but never null). I know that
      we could add a lot of other methods here, but I think this is a
      common use case.
    * *port(String)*? If template variables should als be allowed for
      the port, than we need UriBuilder.port(String). I think it should
      only be possible to set a port (0 (or1?) until 65535 (=2**16-1) )
      or one template variable and nothing else. To unset the explicit
      port null should be used. For
      uriBuilder.port("808{lastPortDigit}") or something like this there
      is only a very little number of use cases and will complicates the
      algorithm to check for validity.

*RuntimeDelegate*

    * *createEndpoint(..)*: I think it is useful to officialy allow the
      throwing of an UnsupportedOperationException, if the creation of
      an endpoint is supported for no class.
    * *createUriBuilder()*: I think it is useful to add also javadoc to
      RuntimeDelegate#createUriBuilder(), UriBuilder#isEncode() and
      UriBuilder#setEncode(.), that the encoding is turned on by
      default. Marc, if you want, let me know and I add some javadoc
      which is useful IMO and send you a SVN patch.

*Constructors of root resource classes and providers
*I think it is useful to define also in the spec, that only constructors
are checked, if they are valid (as in resource methods and locators

*MessageBodyReader/Writer*
I found no specifcation, what should happens, if no feasible
MessageBodyReader or Writer could be found. I think it is feasible, to
return

    * status 415 (Unsupported Media Type [of request body]) if no
      MessageBodyReader was found, and
    * status 406 (Not Acceptable [because requested response media type
      is not supported]) if no MessageBodyWriter is found.

*Annotation Inheritance*
IMO it should be clearly defined, if an implementation check first the
super classes or the implemented interfaces for annotations on methods.
The current text preferes the superclass, but is a little bit spongy, IMO.

*JSR 250 dependency*
The common dependency to JSR 250 for resource classes is placed in the
javadoc of @Path. In the specification it is only available in the note
to Java EE container. I think it is useful to put this from the @Path
javadoc to the specification file, perhaps into the section
"Constructors" of chapter "Resources". I think it is also useful for the
providers.

best regards
   Stephan