axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sagara Gunathunga <>
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

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

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


and possible to register them with deployers as follows.

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

       <serviceBuilderExtension name ="jwsbuilderExt"


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] -
[2] -
[3] -

Thanks !

Sagara Gunathunga

Blog      -
Web      -
LinkedIn -

View raw message