axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject cvs commit: xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apachesoap WSIFPort_ApacheSOAP.java WSIFOperation_ApacheSOAP.java
Date Wed, 10 Jul 2002 13:01:03 GMT
antelder    2002/07/10 06:01:02

  Modified:    java/src/org/apache/wsif/providers/soap/apachesoap
                        WSIFPort_ApacheSOAP.java
                        WSIFOperation_ApacheSOAP.java
  Log:
  Improve performance of the SOAP provider by caching the Call object in the port and only
initilising it on the 1st operation execute request.
  
  Revision  Changes    Path
  1.8       +27 -21    xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apachesoap/WSIFPort_ApacheSOAP.java
  
  Index: WSIFPort_ApacheSOAP.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apachesoap/WSIFPort_ApacheSOAP.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WSIFPort_ApacheSOAP.java	27 Jun 2002 14:46:41 -0000	1.7
  +++ WSIFPort_ApacheSOAP.java	10 Jul 2002 13:01:02 -0000	1.8
  @@ -112,7 +112,7 @@
   
       protected Port port;
       protected Definition definition;
  -    protected SOAPMappingRegistry smr;
  +    protected Call call;
   
       protected SOAPTransport st;
       protected URL url;
  @@ -120,9 +120,11 @@
       protected String partSerializerName = null;
       private static final boolean DEBUG = false; //for internal use only
       private WSIFDynamicTypeMap wsifTypeMap = null;
  -    private HashMap localTypeMap = new HashMap();
  +    private HashMap localTypeMap;
       private List jmsAddressPropVals = null;
   
  +    private static final String LITERAL_ENCODING = "literal";
  +    
       /**
        * Create dynamic port instance from WDL model defintion and port.
        * <p><b>NOTE:</b> this constructor is doing full initialization
  @@ -143,8 +145,6 @@
           setPort(port);
           wsifTypeMap = typeMap;
   
  -        smr = createSOAPMappingRegistry();
  -
           JMSAddress ja =
               (JMSAddress) getExtElem(port,
                   JMSAddress.class,
  @@ -212,16 +212,12 @@
               }
           }
           
  -        // Prepare mappings for use by all operations created from this port.
  -        prepareTypeMappings();
  -
           if (Tr.ON)
               Tr.exit(deep());
       }
   
  -    public static SOAPMappingRegistry createSOAPMappingRegistry() {
  -        Tr.entry(null);
  -        Call call = new Call();
  +    public static SOAPMappingRegistry createSOAPMappingRegistry(Call call) {
  +        Tr.entry(call);
           SOAPMappingRegistry smr = call.getSOAPMappingRegistry();
   
           // Add mapping registry entry for dateTime
  @@ -306,25 +302,36 @@
           return smr;
       }
   
  +    public Call getCall() {
  +        Tr.entry(this);
  +        if ( call == null ) {
  +           call = new Call();
  +           call.setSOAPMappingRegistry( createSOAPMappingRegistry( call ) );
  +           prepareTypeMappings();
  +        }
  +        Tr.exit(call);
  +        return call;
  +    }
  +
       public SOAPMappingRegistry getSOAPMappingRegistry() {
           Tr.entry(this);
  +        SOAPMappingRegistry smr = getCall().getSOAPMappingRegistry();
           Tr.exit(smr);
           return smr;
       }
   
  -    public void setSOAPMappingRegistry(SOAPMappingRegistry smr) {
  -        Tr.entry(this, smr);
  -        this.smr = smr;
  -        Tr.exit();
  -    }
  -    
       protected HashMap getLocalTypeMap() {
  +    	if (localTypeMap == null ) {
  +    		localTypeMap = new HashMap();
  +    		// need to ensure prepareTypeMappings is run
  +    	    getCall();
  +    	}
       	return localTypeMap;
       }
   
       private void prepareTypeMappings() {
           prepareTypeMappings(
  -            this.smr,
  +            getSOAPMappingRegistry(),
               this.wsifTypeMap,
               partSerializerName,
               localTypeMap);
  @@ -352,7 +359,6 @@
   
           Serializer literalSerializer = partSer;
           Deserializer literalDeserializer = partSer;
  -        String literalEncoding = "literal";
           Serializer soapSerializer = beanSer;
           Deserializer soapDeserializer = beanSer;
           String soapEncoding = Constants.NS_URI_SOAP_ENC;
  @@ -389,13 +395,13 @@
               // Set up literal encoding mappings
               try {
                   ser = null;
  -                ser = theSMR.querySerializer(javaClass, literalEncoding);
  +                ser = theSMR.querySerializer(javaClass, LITERAL_ENCODING);
               } catch (IllegalArgumentException iae) {
               }
               // Only add a mapping if a serializer does not already exist
               if (ser == null) {
                   theSMR.mapTypes(
  -                    literalEncoding,
  +                    LITERAL_ENCODING,
                       typeName,
                       javaClass,
                       literalSerializer,
  @@ -751,7 +757,7 @@
   
               buff += "\nport:" + Tr.brief(port);
               buff += " definition:" + Tr.brief(definition);
  -            buff += " soapMappingRegistry:" + smr;
  +            buff += " call:" + call;
               buff += " soapTransport:" + st;
               buff += " url:" + url;
               buff += " style:" + style;
  
  
  
  1.14      +11 -14    xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apachesoap/WSIFOperation_ApacheSOAP.java
  
  Index: WSIFOperation_ApacheSOAP.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apachesoap/WSIFOperation_ApacheSOAP.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- WSIFOperation_ApacheSOAP.java	9 Jul 2002 10:37:12 -0000	1.13
  +++ WSIFOperation_ApacheSOAP.java	10 Jul 2002 13:01:02 -0000	1.14
  @@ -420,18 +420,9 @@
           if (!prepared)
               prepare(input, output);
   
  -        String encodingStyleURI = inputEncodingStyle;
  +        Call call = portInstance.getCall();
   
  -        Call call = new Call();
  -        call.setEncodingStyleURI(encodingStyleURI);
  -
  -        SOAPMappingRegistry reg = null;
  -
  -        reg = portInstance.getSOAPMappingRegistry();
  -
  -        if (reg != null) {
  -            call.setSOAPMappingRegistry(reg);
  -        }
  +        call.setEncodingStyleURI( getInputEncodingStyle() );
   
           SOAPTransport st = getTransport();
           if (st != null)
  @@ -821,7 +812,8 @@
           }
   
           HashMap mapOfUserTypes = new HashMap();  							
  -        SOAPMappingRegistry smr = WSIFPort_ApacheSOAP.createSOAPMappingRegistry();
  +        SOAPMappingRegistry smr = 
  +           WSIFPort_ApacheSOAP.createSOAPMappingRegistry( new Call() );
           
           setupTypeMappings(mapOfUserTypes, smr);
   
  @@ -1211,11 +1203,16 @@
       private void setCallContext(Call call) {
           Object o;
           String name;
  +
  +        // clear out any old header values
  +        call.setHeader( null );
  +        addHTTPHeader(call, WSIFConstants.CONTEXT_HTTP_USER, null);
  +        addHTTPHeader(call, WSIFConstants.CONTEXT_HTTP_PSWD, null);
  +        
           if (context == null) {
  -            addHTTPHeader(call, WSIFConstants.CONTEXT_HTTP_USER, null);
  -            addHTTPHeader(call, WSIFConstants.CONTEXT_HTTP_PSWD, null);
               return;
           }
  +
           name = WSIFConstants.CONTEXT_HTTP_USER;
           try {
               o = context.getObjectPart(name);
  
  
  

Mime
View raw message