Move bus wiring out of Spring XML handlers
------------------------------------------
Key: CXF-1619
URL: https://issues.apache.org/jira/browse/CXF-1619
Project: CXF
Issue Type: Improvement
Components: Configuration
Affects Versions: 2.1
Reporter: Ian Roberts
Several classes in CXF, such as JaxWs{Proxy,Server}FactoryBean, EndpointImpl,
etc. that take a reference to a Bus automatically wire in a reference to the
Spring bean "cxf" if no bus has been explicitly specified. However, this
wiring is currently handled in the custom XML handlers, so happens at XML
parsing time. This means it is sensitive to the order in which the Spring
beans have been defined - the "cxf" Bus bean is only wired in if its definition
exists in the Spring context at the time the custom XML is parsed.
This patch implements an alternative behaviour where we first parse all the
bean definitions, then go back and check for the existence of the "cxf" bean
and wire it in if necessary. This would mean that the CXF <import>s could go
anywhere in your Spring config file (even after your <jaxws:endpoint>s), or
even in a separate file. At present, if you put the imports in a separate file
you must arrange for this file to be loaded before your others, but this isn't
always possible to guarantee.
Summary of the patch:
- Anywhere where a Spring XML handler currently does a check for the existence
of a bean called "cxf" and wires it into the new definition, replace this code
with code to add a custom attribute to the new bean definition instead.
- BusWiringBeanFactoryPostProcessor, registered by default in cxf.xml, checks
bean definitions for this custom attribute and does the wiring.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.