Details
-
Feature Request
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
Release Notes
Description
I created this module to enable CDI beans to serve as JAX-RS resources, providers and javax.ws.rs.core.Application subclasses. The module registers custom InjectorFactory implementation which obtains CDI beans instead of creating new class instances. By default, every JAX-RS resource is a @RequestScoped CDI bean. Providers and Application subclasses are @ApplicationScoped beans. This can be changed by annotating the class with desired scope annotation.
Besides the module, minor modification of ResteasyBootstrap is required (see resteasy-cdi-deployment.patch). resteasy-cdi-war is a testing web application.
What works:
- CDI field injection
- CDI constructor injection
- CDI initializer injection
- all the other CDI features (interception of lifecycle events and method invocations, alternatives, ...)
- JAX-RS setter injection
- JAX-RS method injection
What does not currently work:
- JAX-RS field injection (https://jira.jboss.org/jira/browse/WELD-436)
- JAX-RS constructor injection (the spec says that this is non-portable anyway)
- support for Application subclasses (requires trivial change in RESTEasy)
tested with JBoss AS 6 20100215-M2