cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andriy Redko (JIRA)" <>
Subject [jira] [Commented] (CXF-5576) Initital support for CDI integration
Date Sat, 01 Mar 2014 20:59:19 GMT


Andriy Redko commented on CXF-5576:

Hi guys,

I finally have the PoC working (for simplest use cases). It's actually involves only two classes:
CDI portable extension and a simple servlet derived from CXFNonSpringServlet. Here is the
high-level overview how it works:
 - CDI container starts and detects our portable extension
 - extension starts to listen for the events from CDI container and automatically detects
JAX-RS applications and resources
 - once CDI container starts, extension instantiates all discovered applications (for now
only 1 is supported) and resources

At this point, the servlet comes into play:
 - it tries to detect the presence of CDI container
 - if CDI container is detected, servlet asks for the instance of the portable extension 
 - once retrieved, servlet asks for discovered application and resources
 - and uses JAXRSServerFactoryBean to create the server for application and resources (service

It looks quite simple and it really is. I have two PoC application, one uses embedded Jetty
and another one is WAR file deployed under Tomcat 8. In both cases, everything works: CDI
resources are injected (@Inject) along with JAX-RS specific ones (@Context). Please validate
this approach and let me know your opinion. I can provide the samples at first demand (or
attach them to this JIRA if you guys see it as a good start).


> Initital support for CDI integration
> ------------------------------------
>                 Key: CXF-5576
>                 URL:
>             Project: CXF
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 3.0.0
>            Reporter: Andriy Redko
>            Assignee: Andriy Redko
>              Labels: cdi
> A per section 10.2.3 Context and Dependency Injection (CDI) of JAX-RS 2.0 specification,
in a product that supports CDI, the implementations MUST support the use of CDI-style Beans
as root resource classes, providers and Application subclasses. Providers and Application
subclasses MUST be singletons or use application scope.

This message was sent by Atlassian JIRA

View raw message