Alessio Soldano [
http://community.jboss.org/people/alessio.soldano%40jboss.com] created
the discussion
"Recent changes on CXF integration"
To view the discussion, visit:
http://community.jboss.org/message/535401#535401
--------------------------------------------------------------
Folks,
due to the requirements for
https://jira.jboss.org/jira/browse/JBWS-2971
https://jira.jboss.org/jira/browse/JBWS-2971 , I had to review a bit the current cxf stack
integration.
Basically, we used to depend on CXFServlet triggering the Bus creation and have the
servlet's loadBus method overwritten to also load our additional beans from
jboss-cxf.xml.
This recently turned up to be a problem as the CXF Bus creation needs to happen at deploy
time for some kind of operation to be possible; JBWS-2971 is an example, but more
generally, depending on a servlet only for the bus creation is wrong (think about JMS
endpoints,
https://jira.jboss.org/jira/browse/JBWS-2987
https://jira.jboss.org/jira/browse/JBWS-2987).
So, first of all I added a deployment aspect in the jbws-cxf stack for eagerly parsing the
cxf.xml and our (provided or generated) jboss-cxf.xml into a Bus during deployment (
https://jira.jboss.org/jira/browse/JBWS-2974
https://jira.jboss.org/jira/browse/JBWS-2974). The Bus is then attached to the endpoint
and the CXFServletExt checks it's already available before trying creating it.
An interesting question now is whether we want this to be the default behaviour or not.
Currently there's a system property for choosing when to load the bus, the default is
lazy behaviour (load in servlet). Anyway, a decision on this might also be related to how
we properly review and fix the jms integration with cxf stack (
https://jira.jboss.org/jira/browse/JBWS-2987
https://jira.jboss.org/jira/browse/JBWS-2987).
Besides this, it's probably interesting to note that for fixing JBWS-2971 I started
using another integration hook, ie. the Spring NamespaceHandlerSupport configuration. As
you know, we're generating the jboss-cxf.xml file at deploy time and basically
leveraging the spring configuration of CXF (in order to allow both stack agnostic
deployments and cxf specific deployments to work seamlessly).
CXF has spring.handler configuration files that map namespaces for elements in the spring
xml to default beans. We're now using a custom mapping for the jaxws.endpoint
elements, which in the end allows us to overwrite the CXF
org.apache.cxf.jaxws.EndpointImpl giving us control over the endpoint
start/stop/publish/etc. while still delegating to the CXF one for the core processing.
Generally speaking, customizing the spring namespace handler configuration for loading
different bean parsers is a powerful integration hook, to be considered in addition to the
already used setup of CXF Configurer in the Bus.
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/535401#535401]
Start a new discussion in JBoss Web Services Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]