users@jsr311.java.net

Re: Annotations on interfaces and super classes <was> Re: URI Contracts

From: Bill Burke <bburke_at_redhat.com>
Date: Wed, 11 Jun 2008 11:23:15 -0400

Marc Hadley wrote:
> On Jun 10, 2008, at 2:53 PM, Bill Burke wrote:
>>
>> @Local|_at_Remote
>> @Path("/customers")
>> public interface CustomerDAO {
>> ...
>> }
>>
>> Doesn't matter if its local or remote.
>>
>
>> Register a JNDI name as a context-param
>>
>> <context-param>
>> <param-name>resteasy.jndi.resources</param-name>
>> <param-value>
>> java:comp/env/MyEJB
>> </param-value>
>> </context-param>
>>
> Neat !
>
> So the key thing here is to be able to have annotations on interfaces so
> you can "export" the JAX-RS information via an interface rather than
> having it tied to an implementation class (which in this case is an
> EJB). Your code only inspects the interface since the implementation
> class is hidden from you by the EJB plumbing.
>
> Interestingly, this isn't the functionality addressed by the annotation
> inheritance defined by the spec (section 3.6). That is targeted at
> making annotations on an abstract method available to a runtime
> inspecting an implementation class. We could remove the inheritance of
> annotations on abstract methods without impacting your use case at all.
>

I had a user that wanted the current annotation inheritance defined in
the specification. Let me see if I can find the email/usecase.

Also, I hope you don't mean remove annotations on superclasses/methods?


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