axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r575097 - in /webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws: client/dispatch/ client/proxy/ message/ message/impl/
Date Wed, 12 Sep 2007 22:01:57 GMT
Author: rott
Date: Wed Sep 12 15:01:56 2007
New Revision: 575097

URL: http://svn.apache.org/viewvc?rev=575097&view=rev
Log:
Ensure the parser is forwarded all the way to the END_DOCUMENT event so it can be closed and
memory freed up, where appropriate.

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/JAXBDispatch.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/XMLDispatch.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/XMLPart.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageImpl.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartBase.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/JAXBDispatch.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/JAXBDispatch.java?rev=575097&r1=575096&r2=575097&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/JAXBDispatch.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/JAXBDispatch.java
Wed Sep 12 15:01:56 2007
@@ -171,6 +171,8 @@
             }
         } catch (Exception e) {
             throw ExceptionFactory.makeWebServiceException(e);
+        } finally {
+            message.close();
         }
 
         return value;

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/XMLDispatch.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/XMLDispatch.java?rev=575097&r1=575096&r2=575097&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/XMLDispatch.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/XMLDispatch.java
Wed Sep 12 15:01:56 2007
@@ -24,6 +24,7 @@
 import org.apache.axis2.jaxws.message.Block;
 import org.apache.axis2.jaxws.message.Message;
 import org.apache.axis2.jaxws.message.Protocol;
+import org.apache.axis2.jaxws.message.XMLPart;
 import org.apache.axis2.jaxws.message.factory.BlockFactory;
 import org.apache.axis2.jaxws.message.factory.MessageFactory;
 import org.apache.axis2.jaxws.message.factory.SOAPEnvelopeBlockFactory;
@@ -186,6 +187,8 @@
                 log.debug("An error occured while creating the block");
             }
             throw ExceptionFactory.makeWebServiceException(e);
+        } finally {
+            message.close();
         }
 
         if (log.isDebugEnabled()) {

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java?rev=575097&r1=575096&r2=575097&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java
Wed Sep 12 15:01:56 2007
@@ -351,24 +351,29 @@
     protected Object createResponse(Method method, Object[] args, MessageContext responseContext,
                                     OperationDescription operationDesc) throws Throwable
{
         Message responseMsg = responseContext.getMessage();
+        try {
 
-        if (log.isDebugEnabled()) {
-            log.debug("Processing the response Message to create the return value(s).");
-        }
+            if (log.isDebugEnabled()) {
+                log.debug("Processing the response Message to create the return value(s).");
+            }
 
-        // Find out if there was a fault on the response and create the appropriate 
-        // exception type.
-        if (hasFaultResponse(responseContext)) {
-            Throwable t = getFaultResponse(responseContext, operationDesc);
-            throw t;
-        }
+            // Find out if there was a fault on the response and create the appropriate 
+            // exception type.
+            if (hasFaultResponse(responseContext)) {
+                Throwable t = getFaultResponse(responseContext, operationDesc);
+                throw t;
+            }
 
-        Object object = MethodMarshallerFactory.getMarshaller(operationDesc, false)
-                .demarshalResponse(responseMsg, args, operationDesc);
-        if (log.isDebugEnabled()) {
-            log.debug("The response was processed and the return value created successfully.");
+            Object object =
+                    MethodMarshallerFactory.getMarshaller(operationDesc, true)
+                                       .demarshalResponse(responseMsg, args, operationDesc);
+            if (log.isDebugEnabled()) {
+                log.debug("The response was processed and the return value created successfully.");
+            }
+            return object;
+        } finally {
+            responseMsg.close();
         }
-        return object;
     }
 
     protected static Throwable getFaultResponse(MessageContext msgCtx,

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/XMLPart.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/XMLPart.java?rev=575097&r1=575096&r2=575097&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/XMLPart.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/XMLPart.java
Wed Sep 12 15:01:56 2007
@@ -317,4 +317,9 @@
      * @return String
      */
     public String getXMLPartContentType();
+
+    /**    
+     * Used primarily to ensure the parser is forwarded to the end so it can be closed.
+     */
+    public void close();
 }   

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageImpl.java?rev=575097&r1=575096&r2=575097&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageImpl.java
Wed Sep 12 15:01:56 2007
@@ -623,4 +623,11 @@
     public boolean isDoingSWA() {
         return doingSWA;
     }
+    
+    public void close() {
+        if (xmlPart != null) {
+              xmlPart.close();
+        }
+     }
+
 }

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartBase.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartBase.java?rev=575097&r1=575096&r2=575097&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartBase.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartBase.java
Wed Sep 12 15:01:56 2007
@@ -19,6 +19,8 @@
 package org.apache.axis2.jaxws.message.impl;
 
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.impl.builder.StAXBuilder;
 import org.apache.axiom.soap.SOAP11Constants;
 import org.apache.axiom.soap.SOAP12Constants;
 import org.apache.axis2.jaxws.ExceptionFactory;
@@ -673,6 +675,20 @@
             consumed = false;
 		}
 	}
+    
+    public void close() {
+        OMElement om = getContentAsOMElement();
+        if (om !=null) {
+            OMXMLParserWrapper builder = om.getBuilder();
+            if (builder instanceof StAXBuilder) {
+                 StAXBuilder staxBuilder = (StAXBuilder) builder;
+                 staxBuilder.releaseParserOnClose(true);
+                 if (!staxBuilder.isClosed()) {
+                     staxBuilder.close();
+                 }
+            }
+        }
+     }
 	
 	
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message