[ 
https://issues.apache.org/jira/browse/CXF-5576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13919141#comment-13919141
 ] 

Christian Schneider commented on CXF-5576:
------------------------------------------

Hi Andriy,

I now was able to play bit with your poc code. I think it is quite impressive 
and works very well.
There is one thing I would change. I would separate the servlet from the 
creation of the jaxrs endpoints. Basically I would just create the jaxrs 
endpoints in the JAXRSCdiResourceExtension and add them to the cxf bus. Then I 
would attach the CXFNonSpringServlet to the cxf bus. In my poc I created a cxf 
bus as a CDI bean. We could use the same technique to have a cxf bus that we 
can then inject into the JAXRSCdiResourceExtension and into the servlet. I am a 
bit unsure though if we should create the bus ourself or if we should rather 
expect the user to do it in his own code so he can easily do customizations for 
the bus.

In any case the advantage in this separation is that we are less dependent in 
the servlet. For example jaxrs can also run with jetty uris (no servlet) or 
especially if we support JAXWS too then people might have only have JMS or 
jetty endpoints. So it makes sense to create the endpoints independent of the 
servlet. 

We also should look into making our extension OSGi ready so it is a bundle and 
announces itself as a CDI extension in OSGi.

I agree with Sergey that the POC can be considered completed. So I propose we 
move to the CXF master with the module. There we should from the start split 
the module into the extension project and the person example. We should also 
create an itest from the start so we can verify it works all right. I propose 
over time we create three itests for the three target environments:
1. in a standalone CDI container
2. as a war
3. in OSGi
Of course a fourth environment would be in a Java EE server but we currently 
have no test environment to show this. 

Should I move the code to master or does any of you want to do it?


> Initital support for CDI integration
> ------------------------------------
>
>                 Key: CXF-5576
>                 URL: https://issues.apache.org/jira/browse/CXF-5576
>             Project: CXF
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 3.0.0
>            Reporter: Andriy Redko
>            Assignee: Andriy Redko
>              Labels: cdi
>         Attachments: weld-one-jar.zip, weld-one-war.zip
>
>
> 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
(v6.2#6252)

Reply via email to