ws-savan-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amila Suriarachchi <amilasuriarach...@gmail.com>
Subject Re: [Axis2-Spring] Let's get started: servlet + axis2.xml + JSR-181
Date Fri, 02 Apr 2010 09:30:12 GMT
On Fri, Apr 2, 2010 at 2:46 AM, Andreas Veithen
<andreas.veithen@gmail.com>wrote:

> Devs,
>
> In order to get the Axis2-Spring thing started without getting lost in
> endless discussions, I propose a very simple thing as a starter:
>

I think we agreed to discuss and come to agreement of the overall objective
of the project before going
to the implementation. Then we need to identify the areas to be work and how
best they can be done. For an example let users to configure the system
using spring beans is one aspect of it.


> implement a servlet that deploys a JSR-181 annotated bean from a
> Spring application context. For simplicity let's take the Axis2
> configuration from a classic axis2.xml file and also don't consider
> component scanning yet. Note that the code that does the second part
> (JSR-181 annotated Spring bean to Axis service) only takes a couple of
> lines and actually already exists [1].


This is good as the first milestone. This should show how a spring bean in a
servlet container can be
exposed as a web service.



> For the first part
> (implementing the servlet that manages the Spring application context
> and the Axis2 configuration context), there is actually an interesting
> design question that I would like to discuss. Indeed, the three
> existing codebases use two different approaches to manage the
> AxisConfiguration/ConfigurationContext, and we need to select the
> better one:
>
> In WSF/Spring and Axis2M, the servlet looks for beans of a certain
> type in the application context. In the case of WSF/Spring [2] this is
> a single SpringAxisConfiguration and a single WebServices instance. In
> the case of Axis2M [3] these are the ServiceBean and ModuleBean
> instances present in the context. Note that all these classes are
> framework specific. In both frameworks, the servlet then builds the
> AxisConfiguration and ConfigurationContext instances by translating
> the framework specific beans into Axis2 objects (using patterns
> similar to the traditional axis2.xml, services.xml and/or module.xml
> processing).
>

In your case also Factory beans are framework specific they initiate the
actual axis2 objects.

Here the most important fact is how the configuration xml file is looks to
the user and how easy to mange them rather than the way internanly map this
object structure to real axis2 object structure.

In your case parameters and other sub elements are declared as in axis2.xml
rather than the spring beans. if you can provide a sample configuration that
would be more clear.

I am not sure how exactly a name value pair is represented in spring way. we
need to do it in that way. That should be the idea of all this work.


thanks,
Amila.

>
> In my PoC I've used a different approach (Note that it doesn't have a
> servlet yet; only the standalone case is covered): the
> ConfigurationContext is itself a Spring managed bean. Obviously, since
> ConfigurationContext is not a simple JavaBean, this requires a
> BeanFactory [4]. The servlet would then only have to look up the
> ConfigurationContext which is already completely initialized by
> Spring.
>
> There are several advantages I see in this second approach:
>
> * It is more in line with the general paradigms used in Spring.
> * The standalone (i.e. non servlet) case is easily covered: since the
> ConfigurationContext is part of the application context, it is only
> necessary to instantiate a ListenerManager (the lifecycle of which is
> also managed by Spring via a FactoryBean that gets the
> ConfigurationContext injected): see [5].
> * This will also make support for the client side easier, since we
> need a ConfigurationContext as well to create the stub or the JAX-WS
> dynamic proxy.
> * It would make the implementation of the servlet very easy: just
> extend AxisServlet and look up the ConfigurationContext from the
> Spring application context.
> * Last but not least, it also implies that the components that deploy
> the services (or modules if we want to support that) are completely
> self-contained. In my PoC, this is PojoServiceFactoryBean [6] and this
> class is only known by the bean definition parser and (indirectly) the
> namespace handler. On the other hand, the servlet itself doesn't need
> to know anything about it. This fact makes the framework much easier
> to extend: if somebody comes up with new ways to deploy things, there
> is no need to change the core; it is sufficient to add a FactoryBean
> and the corresponding namespace handling stuff.
>
> The only potential issue I see is that compared to WSF/Spring and
> Axis2M, this approach provides less control (at least out of the box)
> about the order in which things are added to the
> AxisConfiguration/ConfigurationContext, but I'm not sure yet about the
> possible implications of this.
>
> Andreas
>
> [1]
> https://svn.apache.org/repos/asf/axis/axis2/java/core/scratch/java/veithen/spring/axis2-spring-core/src/main/java/org/apache/axis2/spring/service/PojoServiceUtil.java
> [2]
> https://wso2.org/repos/wso2/trunk/wsf/spring/core/src/main/java/org/wso2/spring/ws/servlet/SpringAxis2Servlet.java
> [3]
> https://axis2m.svn.sourceforge.net/svnroot/axis2m/trunk/axis2m/axis2m-spring/src/main/java/org/axis2m/spring/servlet/SpringAxis2Servlet.java
> [4]
> https://svn.apache.org/repos/asf/axis/axis2/java/core/scratch/java/veithen/spring/axis2-spring-core/src/main/java/org/apache/axis2/spring/cfgctx/ConfigurationContextFactoryBean.java
> [5]
> https://svn.apache.org/repos/asf/axis/axis2/java/core/scratch/java/veithen/spring/axis2-spring-core/src/main/java/org/apache/axis2/spring/cfgctx/ListenerManagerFactoryBean.java
> [6]
> https://svn.apache.org/repos/asf/axis/axis2/java/core/scratch/java/veithen/spring/axis2-spring-core/src/main/java/org/apache/axis2/spring/service/PojoServiceFactoryBean.java
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-dev-help@axis.apache.org
>
>


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

Mime
View raw message