[
https://issues.apache.org/jira/browse/CXF-5576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13937291#comment-13937291
]
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:
https://github.com/apache/cxf/blob/master/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java
https://github.com/apache/cxf/blob/master/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
https://github.com/apache/cxf/blob/master/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/blueprint/CXFBlueprintServlet.java
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.
Christian
> 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)