Hi, again, Bill,

I've found the section on annotation inheritance in the spec and will make an attempt at implementing it in the logic of ResourceMethodRegistry.processMethod() etc.

Would you like me to run the changes by you before I commit?  I don't want to overstep my bounds as a new committer :-)

Cheers,

pete

On Mon, Sep 12, 2011 at 11:41 AM, Peter Murray <resteasy@pmurray.com> wrote:
https://issues.jboss.org/browse/RESTEASY-596

Bill,

I could possibly take a look at this if it would be helpful.  I'd just need a bit of guidance as to what is the right fix. 
  • Is it the case that the subresource is valid if it or any of its superclasses or any of the interfaces in the hierarchy have a jax-rs annotation?  I can easily write the hierarchy scanning logic to do that.
  • If so, should the call to registry.addResourceFactory() at ResourceLocator.java:127 be invoked passing in the actual subresource implementation class instead of only the first interface we find that has jax-rs on it?  My question is that if there are multiple distinct interfaces further up the hierarchy, shouldn't the resource publish the union of all exposed jax-rs annotated methods?
Best,

pete

On Mon, Sep 12, 2011 at 10:32 AM, Bill Burke <bburke@redhat.com> wrote:
Looks like a bug.  Log a jira for me?  I'll see if I can get a fix in
for the Beta release this week.

On 9/11/11 9:09 PM, Peter Murray wrote:
> Greetings folks,  I have a situation like this:
>
> interface SuperInt
> {
>      @Path("foo")
>      @GET
>      @Produces("application/json")
>      String getFoo()
> }
>
> abstract class SuperIntAbstract implements SuperInt
> {
>      @Override
>      public String getFoo()
>      {
>          return "Foo: " + getName();
>      }
>      protected abstract String getName();
> }
>
> @Path("/somewhere")
> class SomeOtherResource
> {
>      @Path("superint")
>      public SuperInt getSuperInt()
>      {
>          return new SuperIntAbstract()
>          {
>              @Override
>              protected String getName()
>              {
>                   return "Fred";
>               }
>          }
>      }
> }
>
> When a client accesses GET /somewhere/superint/foo, resteasy throws
> indicating that it doesn't think the returned type from getSuperInt()
> has JAX-RS annotations.  In GetRestful.getSubResourceClass(), resteasy
> looks first up the superclass chain for JAX-RS annotations, then it
> looks only at the immediate class's interfaces and throws if they don't
> have JAX-RS annos.
>
> Is it possible that resteasy should examine superclass interfaces as
> well?  What is the purpose of finding a single class with some jaxrs
> annotations?  What if the class (or a superclass) implemented several
> interfaces that had different, but compatible annotations?
>
> Thanks for any insight!
>
> Cheers,
> --
> -pete
> peter m. murray
>
>
> ------------------------------------------------------------------------------
> Doing More with Less: The Next Generation Virtual Desktop
> What are the key obstacles that have prevented many mid-market businesses
> from deploying virtual desktops?   How do next-generation virtual desktops
> provide companies an easier-to-deploy, easier-to-manage and more affordable
> virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
>
>
>
> _______________________________________________
> Resteasy-developers mailing list
> Resteasy-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-developers

--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Resteasy-developers mailing list
Resteasy-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-developers