Hi all,
nice to see that the Spring integration topic has been kicked up
by the Axis team. I have a couple of comments regarding the code
that has been commited:
- I don't see why you introduced the ApplicationContextHolder with a
static reference to the Spring ApplicationContext. There is another
way to get the ApplicationContext that you should consider, because
with that non invasive approach there is no need to configure a
proprietary Axis2 ApplicationContextHolder in the Spring config.
When using Spring's ContextLoader(Servlet|Listener) the ApplicationContext
is exposed in the ServletContext. And the ServletContext itself is
exposed in Axis2's MessageContext properties. Using that approach the
SpringAbstractMessageReceiver's makeNewServiceObject can be changed to
ServletContext oServletContext = (ServletContext) msgContext.getOptions().
getProperty(Constants.SERVLET_CONTEXT);
ApplicationContext aCtx =
WebApplicationContextUtils.getWebApplicationContext(oServletContext);
and the ApplicationContextHolder class can be removed.
- I'm not quite sure if the choosen approach to integrate Spring with
Axis2 on the server-side is the best. Basically that is because invoking
Spring beans as a pojo service implementations now becomes a concern for the
Receiver implementation. With the current Receiver architecture (which needs
refactoring btw.) you end up implementing different message receivers for
"plain" Axis2 and for the integration with Spring (as you did with RawXML
and RPC) which are bascially copies of each other in order to integrate
different data binding frameworks.
IMHO there are two possible solutions for that: You can refactor the
receiver stuff incl. Axis2's core receivers to provide better extension
points (template methods to invoke business logic). Or you can choose a
different approach to integrate Spring which is not aware of actual message
receiving.
The last approach can be implemented by providing a superclass for Axis2
pojo based service objects. That superclass can access the Spring
ApplicationContext and provide the required business logic Spring bean to
invoke. That is quite similiar to Spring's JAX-RPC (based on Axis 1.x)
integration; look into ServletEndpointSupport.
calling business logic)
If there is anything I can do further clarify the above, please let me know.
Cheers
Christian
-
Spring IDE
http://springide.org