jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] Re: [jax-rs-spec users] ResourceContext and subresource methods

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Thu, 13 Dec 2012 09:40:59 -0500

On Dec 13, 2012, at 8:05 AM, Sergey Beryozkin <sberyozkin_at_talend.com> wrote:

> Hi, consider DynanicFeature deciding which method should get applied which filters or the filter or interceptor bound to a specific subresource method working with ResourceContext.
>
> ResourceContext is supposed to return the name of (root) resource class and the method - but in case of subresource methods the resource class has to be the actual subresource class to make sure it matches the method returned from ResourceContext.
>
> IMHO it can be useful to extend ResourceContext for it to always return the current root resource class with the method getRootResourceClass() where getResourceClass() will return the 'owner' of the current resource method - it can be the same root resource class or subresource class and it will provide a better 'picture' to the code working with ResourceContext
>
> What do you think ?

 Don't really follow. How about a short example? :)

-- Santiago