added Object getValue()/setValue(Object) methods.
makes it a lot easier to build nodes with registered types as values.

Fixed output() method to serialize any children node may have.
SOAPHeader has its value handled by MessageElement now.

*********************************************
org.apache.axis.message.SOAPHeader.java
77d76
<     protected Object    value = null;
140,147d138
<     public Object getValue() {
<         return value;
<     }
< 
<     public void setValue(Object value) {
<         this.value = value;
<     }
< 
152,158d142
<     protected void outputImpl(SerializationContext context) throws
Exception {
<         if (value == null) {
<             super.outputImpl(context);
<         } else {
<             context.serialize(new QName(namespaceURI,name), attributes,
value, value.getClass() );
<         }
<     }

**************************************************
org.apache.axis.message.MessageElement.java
61a62
> import org.apache.axis.encoding.Serializer;
81a83
> import java.util.Iterator;
88a91,92
>       private Object mValue=null;
> 
208a213,242
>       public Object getValue(){
>               if(mValue==null){
>                       QName myType=getType();
>                       if(myType==null){
>                               String
typeStr=attributes.getValue(Constants.NSPREFIX_SCHEMA_XSI,Constants.ATTR_TYP
E);
>                               if(typeStr!=null){
>                                       int colPos=typeStr.indexOf(':');
>                                       if(colPos!=-1){
>                                               myType=new
QName(typeStr.substring(0,colPos),typeStr.substring(colPos+1));
>                                       }else{
>                                               myType=new
QName("",typeStr);
>                                       }
>                                       setType(myType);
>                               }else{
>                                       myType=new
QName(this.getNamespaceURI(),this.getName());
>                               }
>                       }
>                       try{
>                               mValue=getValueAsType(myType);
>                       }catch(Exception e){
>                               category.debug("getValue()",e);
>                       }
>               }
>               return mValue;
>       }
> 
>       public void setValue(Object newValue){
>               this.mValue=newValue;
>       }
> 
311a346,348
>               if(typeQName==null){
>                       setType(type);
>               }
495a533,540
>               if(mValue!=null){
>                       Serializer
typeSerial=context.getSerializerForJavaType(mValue.getClass());
>                       if(typeSerial!=null){
>                               typeSerial.serialize(new QName(namespaceURI,
name),attributes,mValue,context);
>                               return;
>                       }
>               }
> 
507a553,558
>               if(children!=null){
>                       for(Iterator it=children.iterator();it.hasNext();){
>                               MessageElement
child=(MessageElement)it.next();
>                               child.output(context);
>                       }
>               }

**************************************************
org.apache.axis.encoding.SerializationContextImpl.java
819c819
<         return null;
---
>         return ser;



> -----Original Message-----
> From: R J Scheuerle Jr [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 21, 2002 1:45 PM
> To: [EMAIL PROTECTED]
> Cc: '[EMAIL PROTECTED]'
> Subject: RE: Experiments on type serialization. (feedback 
> very welcome)
> 
> 
> Taras,
> 
> Could you resend this patch to me.
> 
> Thanks
> 
> Rich Scheuerle
> XML & Web Services Development
> 512-838-5115  (IBM TL 678-5115)
> 
> 
>                                                               
>                                                               
>                       Taras Shkvarchuk                        
>                                                               
>                       <tarass@grandcent        To:       
> "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>              
>                       ral.com>                 cc:            
>                                                               
>                                                Subject:  RE: 
> Experiments on type serialization. (feedback very welcome)     
>                       02/21/2002 03:21                        
>                                                               
>                       PM                                      
>                                                               
>                       Please respond to                       
>                                                               
>                       axis-dev                                
>                                                               
>                                                               
>                                                               
>                                                               
>                                                               
> 
> 
> 
> Ok sure. I will look into some pooling.
> What about the regular [PATCH] I submitted on serialization of
> MessageElement's children, setting/getting its type.
> 
> RE: [PATCH] message.MessageElement get/setValue() and child 
> serialization.
> (the reply has updated diff)
> [PATCH] encoding.SerializationContextImpl 
> getSerializerForJavaType() always
> returned null
> 
> Thanks,
> -Taras
> 
> > -----Original Message-----
> > From: R J Scheuerle Jr [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, February 21, 2002 11:27 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Experiments on type serialization. (feedback
> > very welcome)
> >
> >
> > Rich Scheuerle
> > XML & Web Services Development
> > 512-838-5115  (IBM TL 678-5115)
> > ----- Forwarded by R J Scheuerle Jr/Austin/IBM on 02/21/2002
> > 01:26 PM -----
> >
> >
> >
> >
> >                       R J Scheuerle Jr
> >
> >                                                To:
> > [EMAIL PROTECTED]
> >                       02/21/2002 11:08         cc:
> > "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> >                       AM                       From:    R J
> > Scheuerle Jr/Austin/IBM@IBMUS
> >                                                Subject: Re:
> > Experiments on type serialization. (feedback very welcome)
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Taras,
> >
> > I looked at the code and I am not sure that this an
> > appropriate time to
> > make "performance optimization" changes.
> > I agree that Axis could be improved, but moving the
> > deserialization type
> > determination into BodyBuilder seems
> > to break some well defined logical boundaries.  (Plus as you
> > pointed out,
> > some of the tests fail when your changes
> > are enabled.)
> >
> > Perhaps someone (not me) who is more knowledgeable of the 
> SOAPElement
> > construction could address your
> > concerns about the large number of temporary objects
> > constructed by Axis.
> > Perhaps some of these objects could be
> > pooled.
> >
> > If you would like to examine the ramifications of pooling 
> some of the
> > objects versus moving logical function, that would
> > be a great help to the group.
> >
> > Thanks,
> >
> > Rich Scheuerle
> > XML & Web Services Development
> > 512-838-5115  (IBM TL 678-5115)
> >
> >
> >
> >
> >                       Taras Shkvarchuk
> >
> >                       <tarass@grandcent        To:
> > "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> >                       ral.com>                 cc:
> >
> >                                                Subject:
> > Experiments on type serialization. (feedback very welcome)
> >                       02/15/2002 07:32
> >
> >                       AM
> >
> >                       Please respond to
> >
> >                       axis-dev
> >
> >
> >
> >
> >
> >
> >
> >
> > Right now AXIS is always building a DOM like structure from
> > MessageElement
> > object. On top of that all SAX events are recorded for type
> > deserialization.
> > This leads to one memory hungry application.
> >
> > I was running some tests to serialize a Map of Strings (using my own
> > deserializer for testing purposes).
> > On a 6MB XML sample with 55618 map nodes, AXIS took 67.66MB
> > of ram, and ran
> > for 8.7sec on a PIII-850.
> > On a 1MB body with 10618 nodes, AXIS took 13.6MB, and ran 
> for 2.3 sec.
> > This is raw parser time not including transport, etc... whole
> > transaction
> > is
> > attached at the end of the message.
> >
> > What I was playing with was direct serialization into 
> types, and also
> > ability to turn off SAX recording.
> > With my patches I was able to serialize 6MB message using
> > only 10.0MB in
> > 5.52sec
> > And with SAX recoding 31.5MB was used in 6.65 sec.
> >
> > There maybe not such a dramatic speed improvement, but memory
> > utilization
> > is
> > much better. Java's garbage collector will be happy :)
> >
> > My changes passed functional tests partially (dies on the one with
> > phasers).
> > So there is some more debugging for me to do, but the idea 
> seems to be
> > functional.
> > you can control it from MessageContext by calling:
> > msgContext.setResolveTypes(true);
> > msgContext.setRecordingEvents(false);
> >
> > I will attach the complete source of the changes files, if
> > anyone feels
> > like
> > looking at what ever part of it is working.
> >
> > Bellow is a breakdown of 2 tests.
> > in this tests there was 1 text/plain attachment with contents of
> > "ATTACHMENT
> > DATA"
> > Data was not read out of them, just counted number of
> > attachments present.
> >
> > ****************************************************
> > 6MB original:
> > [PERFLOG] START - used 0.0 KB in 0.0 sec
> > [PERFLOG] Req Ready - used 713.1328125 KB in 1.432 sec
> > [PERFLOG] Invoked - used 21.133033752441406 MB in 2.414 sec
> > Attchment count:1
> > [PERFLOG] AttachExtracted - used 0.9609375 KB in 0.0 sec
> > ResolveTypes:false
> > Record Events:true
> > [PERFLOG] Extracted ENV - used 38.475128173828125 MB in 5.157 sec
> > [PERFLOG] Have Node - used 0.8359375 KB in 0.0 sec
> > Total elements in list:55618
> > [PERFLOG] Finished - used 29.194740295410156 MB in 3.565 sec
> > [PERFLOG] TOTAL - used 89.50175476074219 MB in 12.568 sec
> >
> > ****************************************************
> > 1MB original:
> > [PERFLOG] START - used 0.0 KB in 0.0 sec
> > [PERFLOG] Req Ready - used 1.3937301635742188 MB in 1.432 sec
> > [PERFLOG] Invoked - used 673.7265625 KB in 3.405 sec
> > Attchment count:1
> > [PERFLOG] AttachExtracted - used 0.8828125 KB in 0.0 sec
> > ResolveTypes:false
> > Record Events:true
> > [PERFLOG] Extracted ENV - used 6.904670715332031 MB in 1.573 sec
> > I am of type:null
> > [PERFLOG] Have Node - used 0.828125 KB in 0.0 sec
> > Total elements in list:10618
> > [PERFLOG] Finished - used 6.6721954345703125 MB in 0.771 sec
> > [PERFLOG] TOTAL - used 15.630882263183594 MB in 7.181 sec
> >
> >
> > ****************************************************
> > 6MB direct serialization w/o SAX recoding:
> > [PERFLOG] START - used 0.0 KB in 0.0 sec
> > [PERFLOG] Req Ready - used 713.1328125 KB in 1.402 sec
> > [PERFLOG] Invoked - used 21.133033752441406 MB in 2.374 sec
> > Attchment count:1
> > [PERFLOG] AttachExtracted - used 0.9609375 KB in 0.0 sec
> > ResolveTypes:true
> > Record Events:false
> > [PERFLOG] Extracted ENV - used 10.00848388671875 MB in 5.528 sec
> > [PERFLOG] Have Node - used 0.828125 KB in 0.0 sec
> > Total elements in list:55618
> > [PERFLOG] Finished - used 0.796875 KB in 0.0 sec
> > [PERFLOG] TOTAL - used 31.84105682373047 MB in 9.384 sec
> >
> >
> > ****************************************************
> > 6MB direct serialization with SAX recoding:
> >
> > [PERFLOG] START - used 0.0 KB in 0.0 sec
> > [PERFLOG] Req Ready - used 713.1328125 KB in 1.582 sec
> > [PERFLOG] Invoked - used 21.133033752441406 MB in 2.403 sec
> > Attchment count:1
> > [PERFLOG] AttachExtracted - used 0.9609375 KB in 0.0 sec
> > ResolveTypes:true
> > Record Events:true
> > [PERFLOG] Extracted ENV - used 31.537750244140625 MB in 6.65 sec
> > [PERFLOG] Have Node - used 0.8359375 KB in 0.0 sec
> > Total elements in list:55618
> > [PERFLOG] Finished - used 0.796875 KB in 0.0 sec
> > [PERFLOG] TOTAL - used 53.370330810546875 MB in 10.705 sec
> >
> >
> >
> >
> > **** Attachment BodyBuilder.java has been removed from this 
> note on 21
> >          February 2002 by R J Scheuerle Jr ****; **** Attachment
> >          MessageElement.java has been removed from this note
> > on 21 February
> >          2002 by R J Scheuerle Jr ****; **** Attachment
> > RPCHandler.java has
> >          been removed from this note on 21 February 2002 by R
> > J Scheuerle
> >          Jr ****; **** Attachment SOAPHandler.java has been
> > removed from
> >          this note on 21 February 2002 by R J Scheuerle Jr 
> ****; ****
> >          Attachment DeserializationContext.java has been
> > removed from this
> >          note on 21 February 2002 by R J Scheuerle Jr ****;
> > **** Attachment
> >          DeserializationContextImpl.java has been removed
> > from this note on
> >          21 February 2002 by R J Scheuerle Jr ****; **** Attachment
> >          DeserializerImpl.java has been removed from this note on 21
> >          February 2002 by R J Scheuerle Jr ****; **** Attachment
> >          SerializationContextImpl.java has been removed from
> > this note on
> >          21 February 2002 by R J Scheuerle Jr ****; **** Attachment
> >          MessageContext.java has been removed from this note
> > on 21 February
> >          2002 by R J Scheuerle Jr ****
> >
> 
> 
> 

Reply via email to