users@jsr311.java.net

Re: Inherited Path

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 01 Feb 2008 18:52:30 -0500

IIRC, @Inherited only applies to classes so, even if @Path was
inherited, any annotations on the abstract service class methods
(@GET, @ProduceMime etc) wouldn't be inherited and a subclass would
appear to unannotated except for the class-level annotations.

Marc.


  On Feb 1, 2008, at 12:24 PM, Adam Karl wrote:

> Here is my situation. I would like to define an abstract Service
> class such as below. Now when the real service classes extend my
> service class, I would like them to inherit the path annotation.
> This allows the service classes to know nothing about the
> implementation of my service architecture other than the fact that
> they should be extending my abstract service class. Currently, the
> @Path annotation is not @Inherited so this doesn't work for me. Is
> there a reason why @Path cannot be @Inherited?
>
> @Path("{serviceClassName}")
> public abstract class AbstractService
> {
> public AbstractService
> getServiceClass(@PathParam("serviceClassName") String
> serviceClassName)
> {
> return this;
> }
> ...
> }
>
> ____________________________________________
> Adam Karl
> Nighthawk Radiology
> Software Engineer
>
> Phone: +1 414 220 4295 ext-8319
> Email: akarl_at_nighthawkrad.net
>
>

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.