axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amila Suriarachchi" <>
Subject [Axis2] Generated ADB code memory and performance improvment.
Date Mon, 19 Mar 2007 08:44:20 GMT
the getOMElement method in current generated ADB code is as follows,

 public getOMElement(
               final javax.xml.namespace.QName parentQName,
               final factory){ dataSource =
getOMDataSource(parentQName, factory);

               return new


    public getOMDataSource(
            final javax.xml.namespace.QName parentQName,
            final factory){
 dataSource =
                       new org.apache.axis2.databinding.ADBDataSource

         public void serialize( xmlWriter)
throws {
            // serialize method implementation


in here getOMElement method calls to getOMDataSource method. then within the
each getOMDataSource method always a new OMDataSource Object is created
(using an anonymous inner class) and the serialize method implements within
In the serialize method (in anonymous class) it calls for getOMDataSource in
other adb classes again and again and as a result of this there are a lot of
OMDataSource classes created.

I think we can stop this by implementing the getOMElement and  serialize
method like this,

public getOMElement(
            final javax.xml.namespace.QName parentQName,
            final factory) { dataSource =
                new org.apache.axis2.databinding.ADBDataSource(this,

                    public void
serialize( throws {
                        OperationContent.this.serialize(MY_QNAME, factory,
        return new
                MY_QNAME, factory, dataSource);


    public void serialize(final javax.xml.namespace.QName parentQName,
                          final factory,
                 xmlWriter) throws {

        // serialize metho implementation
        localOperation1Content.serialize(MY_QNAME, factory, xmlWriter);


In here it creates only one OMDataSource object per ADB Object structure and
directly calls the serialize method.
the serialize method is a public method of the ADB bean class itself.

Is there any pirticular reason to use and OMDataSource in every bean? Would
this cause any other problems?
Can someone having a better OM knowledge look into this?

I ran all the adb-codegen testcase with this change and it worked fine.
Here with I have attached the patch


Amila Suriarachchi,
WSO2 Inc.

View raw message