cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Schneider (JIRA)" <>
Subject [jira] [Commented] (CXF-5576) Initital support for CDI integration
Date Sun, 16 Mar 2014 19:25:42 GMT


Christian Schneider commented on CXF-5576:

Hi Sergey,

my idea is to work like in a standard web or OSGi environment. We publish each endpoint to
the cxf bus. In a web or OSGi environment this is done in the namespacehandlers for spring
or blueprint or even programmatically by the user. Whenever an endpoint uses a path that triggers
the servlet transport (start just with /... instead a full uri) then this endpoint is registered
in the DestinationRegistry. So in our case we just have to create the endpoint using a factory
class when the extension finds the class to publish. 

Independently the user installs a CXFNonSpringServlet which just needs to be given the CXF
bus or the DestinationRegistry. In any case the CXFNonSpringServlet then makes all registered
endpoints available without any additional effort. In OSGi we install this servlet in the
Activator of the http transport.

If you look at existing variants of the CXFServlet:

None of these interacts with the container containing the endpoint definitions and actively
pulls up the endpoints. This is done in the namespace handlers or by the user. So I think
it would be quite exotic if the CDI extension would do this completely different.

So the only thing we might need to have is a CDIServlet that gets the bus injected using CDI.
Then the rest should work automatically.

Btw. one important reason to not have the servlet pull up the endpoints is the case when the
user has no http endpoints. Imagine a user just wants to use SOAP/JMS using CDI. Then it would
be very strange if he would have to install a CXFCDIServlet and perhaps even open a web port
just to pull up the JMS based endpoints.


> 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
>         Attachments:,
> 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