users@jsr311.java.net

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

From: Bill Burke <bburke_at_redhat.com>
Date: Tue, 10 Jun 2008 14:53:37 -0400

Marc Hadley wrote:
> On Jun 10, 2008, at 1:30 PM, Bill Burke wrote:
>>
>> I've only done portable integration. Its as simple as registering a
>> JNDI resource with JAX-RS runtime. JAX-RS runtime receives an EJB
>> reference from JNDI, looks for JAX-RS annotations, uses the EJB
>> reference as the target endpoint for method dispatching from an HTTP
>> request. Kinda no different than Spring or Guice integration, except
>> you're getting the object from your EE environment.
>>
> So you annotate the EJB remote interface with JAX-RS annotations ? How
> do you register the JNDI resource with the JAX-RS runtime - servlet
> params ?
>

@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>


Or do it programmatically through our registery SPI.


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