axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sagara Gunathunga <sagara.gunathu...@gmail.com>
Subject [Idea] ServiceBuilderExtension for Axis2 Deployers
Date Mon, 14 May 2012 10:31:35 GMT
Hi all,

We have an open issue for sometime to support JAX-WS customization through
a meta data file. AXIS2-4611 [1] contains a high level design and a POC but
we haven't continue this effort. In fact we had number of discussions about
this issue but nothing really implemented.  I'm planning to come up with
solution for this issue targeting Axis2 1.7.0 release. What I try to
propose here is a design which based on Andreas proposal here[2] but I try
to make it generic so that the concept will work with any other Deployers
too.

1.) Introduce a concept called ServiceBuilderExtension where each deployer
can register set of ServiceBuilderExtensions. During the deployment of a
particular deploymentFile, the underline deployer first try to execute its
registered ServiceBuilderExtensions according to the given order and allows
to create list of AxisService objects by ServiceBuilderExtensions then
apply it's own deployment behaviours.

ServiceBuilderExtension can take following API.

public interface ServiceBuilderExtension {

    public void init( ConfigurationContext configurationContext,  String
directory);

    public Map<String,AxisService> buildAxisServices(DeploymentFileData
deploymentFileData)
            throws DeploymentException;;

}

and possible to register them with deployers as follows.

<deployer extension="" directory=""  class="">

       <serviceBuilderExtension name ="jwsbuilderExt"
class="org.apache.axis2.jaxws.framework.JAXWSServiceBuilderExtension">

</deployer>

2.) If I apply above design to the JAX-WS scenario , we could use same
services.xml to configure additional settings also can get advantages
listed in [2].  Please refer following implementation level details.

a.) Implement a ServiceBuilderExtension API for JAXWS.

JAXWSServiceBuilderExtension can be a possible extension class name and it
is required to refactor some codes of JAXWSDeployer to reuse codes among
JAXWSServiceBuilderExtension and JAXWSDeployerDeployer.

At the moment ServiceDeployer does not added through the axis2.xml file
hence we need to add set of predefined ServiceBuilderExtensions
programtically. We can fix this later so that ServiceDeployer also define
in the axis2.xml and users can add custom ServiceBuilderExtensions to work
with  ServiceDeployer. But I'm not planning to touch this now.

b.) During the execution of ServiceDeployer#deploy method it execute
JAXWSServiceBuilderExtensions and try to get initial list of AxisService
objects and then apply configurations defined on services.xml.

c.) In case of WAR deployment where only service.xml file available within
the service directory JAXWSServiceBuilderExtension uses"ServiceClass"
parameter to load annotated service class.


3.) This proposal is not completely new to Axis2, creating a AxisService
out of WSDL files also take similar approach but it hidden within the
implementation. Also this not specific to JAX-WS,  any custom deployment
approach can reuse facilities provided by ServiceDeployer by simply
implementing a ServiceBuilderExtension.


I already completed dirty version of above design but expecting to see some
comments from community first  before I clean and commit them to the trunk.



[1] - https://issues.apache.org/jira/browse/AXIS2-4611
[2] - http://markmail.org/message/jz5bpoybvylbzb6q
[3] - http://markmail.org/thread/pelvh5qy4ufeh7dz


Thanks !

-- 
Sagara Gunathunga

Blog      - http://ssagara.blogspot.com
Web      - http://people.apache.org/~sagara/
LinkedIn - http://www.linkedin.com/in/ssagara

Mime
View raw message