[
https://issues.apache.org/jira/browse/CXF-4199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13831126#comment-13831126
]
Andriy Redko commented on CXF-4199:
-----------------------------------
Hi Sergey,
I guess I understood now the issue better. Let me just repeat that please:
- add to JAXRSServerFactoryBean method setAutoDiscoveryPackages( <packages to
scan> )
- if application is Spring - based, add respective providers as bean to
application context and to providers list (JAXRSServerFactoryBean)
- if application is non-Spring, add instances of discovered providers into
providers list (JAXRSServerFactoryBean)
- for CXFNonSpringJaxrsServlet, we could have additional context property,
f.e. jaxrs.autodiscover.packages and follow the same way as non-Spring
application
By spending some time looking through the code, my understanding is (at least
with respect to JAXRSServerFactoryBean based instantiation), that bus instance
is the only one who knows the context application is running
(Spring/Blueprint/....). If it's true, than from implementation standpoint,
auto-discovery bus extension may be a solution to consider (it should work for
CXFNonSpringJaxrsServlet as well easily).
Also, multiple <jaxrs:server /> instances is a very good point. I assume they
share the same bus instance and as such, in case of Spring application, the
same context. But they may declare different packages to discover providers
(which sounds very logical). It brings some (solvable) complexity in order not
to create duplicate bean definitions.
Does it have sense to you?
Thanks.
Andriy.
> Support class-scanning for discovering JAX-RS providers
> --------------------------------------------------------
>
> Key: CXF-4199
> URL: https://issues.apache.org/jira/browse/CXF-4199
> Project: CXF
> Issue Type: Improvement
> Components: JAX-RS
> Reporter: Sergey Beryozkin
>
> With the search extensions module containing a provider the time has come to
> support the optional class-scanning. Will help in cases when the providers
> are simple and no extra configuration is expected. Post 2.6 though
--
This message was sent by Atlassian JIRA
(v6.1#6144)