axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r542784 - in /webservices/axis2/trunk/java/modules: integration/test/org/apache/axis2/engine/ kernel/src/org/apache/axis2/client/ kernel/src/org/apache/axis2/receivers/ kernel/src/org/apache/axis2/transport/http/
Date Wed, 30 May 2007 09:36:16 GMT
Author: deepal
Date: Wed May 30 02:36:13 2007
New Revision: 542784

URL: http://svn.apache.org/viewvc?view=rev&rev=542784
Log: (empty)

Modified:
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLMultipleSyncTest.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/OperationClient.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/Options.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/AbstractInOutAsyncMessageReceiver.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPConstants.java

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLMultipleSyncTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLMultipleSyncTest.java?view=diff&rev=542784&r1=542783&r2=542784
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLMultipleSyncTest.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLMultipleSyncTest.java
Wed May 30 02:36:13 2007
@@ -79,6 +79,7 @@
         OMElement payload = TestingUtils.createDummyOMElement();
         Options options = new Options();
         options.setTo(targetEPR);
+        options.setCallTransportCleanup(true);
         options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
         ConfigurationContext configContext =
                 ConfigurationContextFactory.createConfigurationContextFromFileSystem(null,
null);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/OperationClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/OperationClient.java?view=diff&rev=542784&r1=542783&r2=542784
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/OperationClient.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/OperationClient.java
Wed May 30 02:36:13 2007
@@ -138,9 +138,7 @@
      *                   client.
      */
     public final void execute(boolean block) throws AxisFault {
-        if (sc.isCachingOperationContext()) {
-            sc.setLastOperationContext(oc);
-        }
+        sc.setLastOperationContext(oc);
         executeImpl(block);
     }
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/Options.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/Options.java?view=diff&rev=542784&r1=542783&r2=542784
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/Options.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/Options.java Wed
May 30 02:36:13 2007
@@ -187,6 +187,9 @@
      */
     private transient MetaDataEntry metaListener = null;
 
+    //This property can be used to specify to call the auto transport clean up
+    private transient boolean callTransportCleanup ;
+
     //----------------------------------------------------------------
     // end MetaData section
     //----------------------------------------------------------------
@@ -1645,5 +1648,14 @@
             log.warn(getLogCorrelationIDString() + ":" + methodname + "(): ****WARNING****
" +
                     myClassName + ".activate(configurationContext) needs to be invoked.");
         }
+    }
+
+
+    public boolean isCallTransportCleanup() {
+        return callTransportCleanup;
+    }
+
+    public void setCallTransportCleanup(boolean callTransportCleanup) {
+        this.callTransportCleanup = callTransportCleanup;
     }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java?view=diff&rev=542784&r1=542783&r2=542784
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
Wed May 30 02:36:13 2007
@@ -510,7 +510,13 @@
         operationClient.execute(true);
         MessageContext response = operationClient
                 .getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
-        return response.getEnvelope().getBody().getFirstElement();
+        if(options.isCallTransportCleanup()){
+            response.getEnvelope().build();
+            cleanupTransport();
+            return response.getEnvelope().getBody().getFirstElement();
+        } else {
+            return response.getEnvelope().getBody().getFirstElement();
+        }
     }
 
     /**
@@ -681,7 +687,7 @@
 
     /**
      * Sets whether or not to cache the last OperationContext
-     *
+     * @deprecated
      * @param cachingOpContext true if we should hold onto the last active OperationContext
      */
     public void setCachingOperationContext(boolean cachingOpContext) {
@@ -724,6 +730,12 @@
         } else {
             configContext.terminate();
         }
+    }
+
+    public void cleanupTransport() throws AxisFault{
+        MessageContext outMessageContext =
+                getLastOperationContext().getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
+        outMessageContext.getTransportOut().getSender().cleanup(outMessageContext);
     }
 
     /**

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/AbstractInOutAsyncMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/AbstractInOutAsyncMessageReceiver.java?view=diff&rev=542784&r1=542783&r2=542784
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/AbstractInOutAsyncMessageReceiver.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/AbstractInOutAsyncMessageReceiver.java
Wed May 30 02:36:13 2007
@@ -40,6 +40,7 @@
                         new AxisEngine(messageCtx.getOperationContext().getServiceContext()
                                 .getConfigurationContext());
                 engine.send(result);
+                result.getTransportOut().getSender().cleanup(result);
             }
 
             public void handleFault(AxisFault fault) throws AxisFault {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java?view=diff&rev=542784&r1=542783&r2=542784
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
Wed May 30 02:36:13 2007
@@ -31,18 +31,7 @@
 import org.apache.axis2.util.JavaUtils;
 import org.apache.axis2.util.Utils;
 import org.apache.axis2.wsdl.WSDLConstants;
-import org.apache.commons.httpclient.Credentials;
-import org.apache.commons.httpclient.Header;
-import org.apache.commons.httpclient.HeaderElement;
-import org.apache.commons.httpclient.HostConfiguration;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpMethod;
-import org.apache.commons.httpclient.HttpMethodBase;
-import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
-import org.apache.commons.httpclient.NTCredentials;
-import org.apache.commons.httpclient.NameValuePair;
-import org.apache.commons.httpclient.UsernamePasswordCredentials;
-import org.apache.commons.httpclient.HttpVersion;
+import org.apache.commons.httpclient.*;
 import org.apache.commons.httpclient.auth.AuthPolicy;
 import org.apache.commons.httpclient.auth.AuthScope;
 import org.apache.commons.httpclient.protocol.Protocol;
@@ -615,7 +604,22 @@
                         .setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
             }
         } else {
-            httpClient = new HttpClient();
+            HttpConnectionManager connManager =
+                    (HttpConnectionManager) msgContext.getProperty(
+                            HTTPConstants.MUTTITHREAD_HTTP_CONNECTION_MANAGER);
+            if(connManager==null){
+                connManager =
+                        new SimpleHttpConnectionManager();
+                msgContext.getConfigurationContext().
+                        setProperty(
+                                HTTPConstants.MUTTITHREAD_HTTP_CONNECTION_MANAGER,
+                                connManager);
+            }
+            if(msgContext.getOptions().isUseSeparateListener()){
+                httpClient = new HttpClient(connManager);
+            } else {
+                httpClient = new HttpClient(connManager);
+            }
         }
 
         // Get the timeout values set in the runtime

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPConstants.java?view=diff&rev=542784&r1=542783&r2=542784
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPConstants.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPConstants.java
Wed May 30 02:36:13 2007
@@ -434,6 +434,8 @@
      */
     public static final String CACHED_HTTP_CLIENT = "CACHED_HTTP_CLIENT";
 
+    public static final String MUTTITHREAD_HTTP_CONNECTION_MANAGER = "MUTTITHREAD_HTTP_CONNECTION_MANAGER";
+
     /**
      * Field CACHED_HTTP_CLIENT
      */



---------------------------------------------------------------------
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