axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r357916 - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/client/ core/src/org/apache/axis2/context/ core/src/org/apache/axis2/deployment/ core/src/org/apache/axis2/description/ core/src/org/apache/axis2/engine/ core/src...
Date Tue, 20 Dec 2005 05:34:41 GMT
Author: chinthaka
Date: Mon Dec 19 21:34:00 2005
New Revision: 357916

URL: http://svn.apache.org/viewcvs?rev=357916&view=rev
Log:
Memory profiling stage 1 completed.
Now OperationContext, MessageContext are garbage collected. 
Before this fix, I could run only 1259 request before getting an OutofMemoryError. But now
I successfully exceeded 6000 requests for the same service (I stopped at that point, but I
think I can go beyond that also).

I have to make ServiceContext and SGContext garbage collectable. 

- removed unnecessary info logs of the logger.

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/InOutMEPClient.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/MEPClient.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceGroupContext.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOutAxisOperation.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Phase.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractInOutAsyncMessageReceiver.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractInOutSyncMessageReceiver.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/RESTSender.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SOAPOverHTTPSender.java
    webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/misc/MiscTest.java
    webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilder.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/InOutMEPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/InOutMEPClient.java?rev=357916&r1=357915&r2=357916&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/InOutMEPClient.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/InOutMEPClient.java
Mon Dec 19 21:34:00 2005
@@ -120,6 +120,8 @@
             ListenerManager.stop(serviceContext.getConfigurationContext(),
                     clientOptions.getListenerTransport().getName().getLocalPart());
         }
+
+
     }
 
     protected void configureTransportInformation(MessageContext msgCtx) throws AxisFault
{
@@ -371,33 +373,33 @@
 
         engine.send(msgctx);
 
-        // create the response
-        MessageContext response = new MessageContext(msgctx.getConfigurationContext(),
+        // create the responseMessageContext
+        MessageContext responseMessageContext = new MessageContext(msgctx.getConfigurationContext(),
                 msgctx.getSessionContext(), msgctx.getTransportIn(),
                 msgctx.getTransportOut());
 
-        response.setProperty(MessageContext.TRANSPORT_IN,
+        responseMessageContext.setProperty(MessageContext.TRANSPORT_IN,
                 msgctx.getProperty(MessageContext.TRANSPORT_IN));
-        msgctx.getAxisOperation().registerOperationContext(response, msgctx.getOperationContext());
-        response.setServerSide(false);
-        response.setServiceContext(msgctx.getServiceContext());
-        response.setServiceGroupContext(msgctx.getServiceGroupContext());
+        msgctx.getAxisOperation().registerOperationContext(responseMessageContext, msgctx.getOperationContext());
+        responseMessageContext.setServerSide(false);
+        responseMessageContext.setServiceContext(msgctx.getServiceContext());
+        responseMessageContext.setServiceGroupContext(msgctx.getServiceGroupContext());
 
-        // If request is REST we assume the response is REST, so set the variable
-        response.setDoingREST(msgctx.isDoingREST());
+        // If request is REST we assume the responseMessageContext is REST, so set the variable
+        responseMessageContext.setDoingREST(msgctx.isDoingREST());
 
-        SOAPEnvelope resenvelope = TransportUtils.createSOAPMessage(response,
+        SOAPEnvelope resenvelope = TransportUtils.createSOAPMessage(responseMessageContext,
                 msgctx.getEnvelope().getNamespace().getName());
 
         if (resenvelope != null) {
-            response.setEnvelope(resenvelope);
+            responseMessageContext.setEnvelope(resenvelope);
             engine = new AxisEngine(msgctx.getConfigurationContext());
-            engine.receive(response);
+            engine.receive(responseMessageContext);
         } else {
             throw new AxisFault(Messages.getMessage("blockingInvocationExpectsResponse"));
         }
 
-        return response;
+        return responseMessageContext;
     }
 
     /**

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/MEPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/MEPClient.java?rev=357916&r1=357915&r2=357916&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/MEPClient.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/MEPClient.java Mon
Dec 19 21:34:00 2005
@@ -221,7 +221,7 @@
         msgCtx.setWSAAction(clientOptions.getAction());
         msgCtx.setSoapAction(clientOptions.getSoapAction());
         msgCtx.setProperty(Constants.Configuration.IS_USING_SEPARATE_LISTENER,
-                new Boolean(clientOptions.isUseSeparateListener()));
+                Boolean.valueOf(clientOptions.isUseSeparateListener()));
 
         // we are not setting the properties here. Those will be set, when we
         // create the operation context

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java?rev=357916&r1=357915&r2=357916&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
Mon Dec 19 21:34:00 2005
@@ -50,6 +50,10 @@
         this.axisConfiguration = axisConfiguration;
     }
 
+    protected void finalize() throws Throwable {
+        super.finalize();    //To change body of overridden methods use File | Settings |
File Templates.
+    }
+
     /**
      * Searches for a ServiceGroupContext in the map with given id as the key.
      * <pre>

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceGroupContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceGroupContext.java?rev=357916&r1=357915&r2=357916&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceGroupContext.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceGroupContext.java
Mon Dec 19 21:34:00 2005
@@ -25,7 +25,7 @@
 import java.util.Map;
 
 public class ServiceGroupContext extends AbstractContext {
-    private String axisServiceGroupName = null;
+    private String axisServiceGroupName;
     private transient AxisServiceGroup axisServiceGroup;
     private String id;
     private Map serviceContextMap;

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java?rev=357916&r1=357915&r2=357916&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
Mon Dec 19 21:34:00 2005
@@ -219,7 +219,7 @@
         }
 
         axisConfig.addModule(modulemetadata);
-        log.info(Messages.getMessage(DeploymentErrorMsgs.ADDING_NEW_MODULE));
+        log.debug(Messages.getMessage(DeploymentErrorMsgs.ADDING_NEW_MODULE));
     }
 
     private void addServiceGroup(AxisServiceGroup serviceGroup, ArrayList serviceList)
@@ -493,7 +493,7 @@
                                         axisConfig);
 
                                 addServiceGroup(sericeGroup, serviceList);
-                                log.info(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_WS,
+                                log.debug(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_WS,
                                         currentArchiveFile.getName()));
                             } catch (DeploymentException de) {
                                 log.info(Messages.getMessage(DeploymentErrorMsgs.INVALID_SERVICE,

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOutAxisOperation.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOutAxisOperation.java?rev=357916&r1=357915&r2=357916&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOutAxisOperation.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOutAxisOperation.java
Mon Dec 19 21:34:00 2005
@@ -43,18 +43,19 @@
     public void addMessageContext(MessageContext msgContext, OperationContext opContext)
             throws AxisFault {
         HashMap mep = opContext.getMessageContexts();
-        MessageContext immsgContext = (MessageContext) mep.get(MESSAGE_LABEL_IN_VALUE);
+        MessageContext inMsgContext = (MessageContext) mep.get(MESSAGE_LABEL_IN_VALUE);
         MessageContext outmsgContext = (MessageContext) mep.get(MESSAGE_LABEL_OUT_VALUE);
 
-        if ((immsgContext != null) && (outmsgContext != null)) {
+        if ((inMsgContext != null) && (outmsgContext != null)) {
             throw new AxisFault("Invalid messge addition , operation context completed");
         }
 
-        if (immsgContext == null) {
+        if (inMsgContext == null) {
             mep.put(MESSAGE_LABEL_IN_VALUE, msgContext);
         } else {
             mep.put(MESSAGE_LABEL_OUT_VALUE, msgContext);
             opContext.setComplete(true);
+            opContext.cleanup();
         }
     }
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Phase.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Phase.java?rev=357916&r1=357915&r2=357916&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Phase.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Phase.java Mon Dec
19 21:34:00 2005
@@ -369,7 +369,7 @@
         while (currentIndex < handlers.size()) {
             Handler handler = (Handler) handlers.get(currentIndex);
 
-            log.info("Invoking Handler '" + handler.getName() + "' in Phase '" + phaseName
+ "'");
+            log.debug("Invoking Handler '" + handler.getName() + "' in Phase '" + phaseName
+ "'");
             handler.invoke(msgctx);
 
             if (msgctx.isPaused()) {

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractInOutAsyncMessageReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractInOutAsyncMessageReceiver.java?rev=357916&r1=357915&r2=357916&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractInOutAsyncMessageReceiver.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractInOutAsyncMessageReceiver.java
Mon Dec 19 21:34:00 2005
@@ -57,6 +57,7 @@
             public void run() {
                 try {
                     MessageContext newmsgCtx = Utils.createOutMessageContext(messageCtx);
+                    newmsgCtx.getOperationContext().addMessageContext(newmsgCtx);
 
                     invokeBusinessLogic(messageCtx, newmsgCtx, callback);
                 } catch (AxisFault e) {

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractInOutSyncMessageReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractInOutSyncMessageReceiver.java?rev=357916&r1=357915&r2=357916&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractInOutSyncMessageReceiver.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractInOutSyncMessageReceiver.java
Mon Dec 19 21:34:00 2005
@@ -32,6 +32,7 @@
 
     public final void receive(MessageContext msgContext) throws AxisFault {
         MessageContext outMsgContext = Utils.createOutMessageContext(msgContext);
+        outMsgContext.getOperationContext().addMessageContext(outMsgContext);
 
         invokeBusinessLogic(msgContext, outMsgContext);
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/RESTSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/RESTSender.java?rev=357916&r1=357915&r2=357916&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/RESTSender.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/RESTSender.java
Mon Dec 19 21:34:00 2005
@@ -217,8 +217,6 @@
             httpContentType = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
         }
 
-        msgContext.setProperty(CommonsHTTPTransportSender.HTTP_METHOD, postMethod);
-
         String charEncoding =
                 (String) msgContext.getProperty(MessageContext.CHARACTER_SET_ENCODING);
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SOAPOverHTTPSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SOAPOverHTTPSender.java?rev=357916&r1=357915&r2=357916&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SOAPOverHTTPSender.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SOAPOverHTTPSender.java
Mon Dec 19 21:34:00 2005
@@ -50,8 +50,6 @@
 
         PostMethod postMethod = new PostMethod(url.toString());
 
-        msgContext.setProperty(CommonsHTTPTransportSender.HTTP_METHOD, postMethod);
-
         String charEncoding =
                 (String) msgContext.getProperty(MessageContext.CHARACTER_SET_ENCODING);
 

Modified: webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/misc/MiscTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/misc/MiscTest.java?rev=357916&r1=357915&r2=357916&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/misc/MiscTest.java (original)
+++ webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/misc/MiscTest.java Mon
Dec 19 21:34:00 2005
@@ -18,7 +18,6 @@
 
 import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.SessionContext;
 
 import java.lang.reflect.InvocationTargetException;
 
@@ -31,13 +30,7 @@
         super(testName);
     }
 
-    public void testSessionContext() {
-        SessionContext sc = new SessionContext(null);
-        String key = "Hello";
-        Object val = new Object();
-        sc.setProperty(key, val);
-        assertEquals(sc.getProperty(key), val);
-    }
+    
 
 
     public void testAxisFault() {

Modified: webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java?rev=357916&r1=357915&r2=357916&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java
(original)
+++ webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java
Mon Dec 19 21:34:00 2005
@@ -15,7 +15,6 @@
  */
 package org.apache.axis2.tool.codegen;
 
-import org.apache.axis2.tool.codegen.eclipse.util.UIConstants;
 import org.apache.axis2.wsdl.builder.WOMBuilderFactory;
 import org.apache.axis2.wsdl.codegen.CommandLineOption;
 import org.apache.axis2.wsdl.codegen.CommandLineOptionConstants;
@@ -42,22 +41,7 @@
      */
     private String mapLanguagesWithCombo(String UILangValue)
     {
-       if (UIConstants.JAVA.equals(UILangValue))
-       {
-          return CommandLineOptionConstants.LanguageNames.JAVA;
-       }
-       else if (UIConstants.C_SHARP.equals(UILangValue))
-       {
-          return CommandLineOptionConstants.LanguageNames.C_SHARP;
-       }
-       else if (UIConstants.C_PLUS_PLUS.equals(UILangValue))
-       {
-          return CommandLineOptionConstants.LanguageNames.C_PLUS_PLUS;
-       }
-       else
-       {
-          return null;
-       }
+       return UILangValue; // TODO : Ajith please fix this.
     }
     /**
      * Creates a list of parameters for the code generator based on the decisions made by
the user on the OptionsPage

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilder.java?rev=357916&r1=357915&r2=357916&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilder.java
Mon Dec 19 21:34:00 2005
@@ -16,8 +16,6 @@
 
 package org.apache.axis2.soap.impl.llom.builder;
 
-import javax.xml.stream.XMLStreamReader;
-
 import org.apache.axis2.om.OMAbstractFactory;
 import org.apache.axis2.om.OMDocument;
 import org.apache.axis2.om.OMElement;
@@ -26,18 +24,12 @@
 import org.apache.axis2.om.OMNode;
 import org.apache.axis2.om.impl.OMNodeEx;
 import org.apache.axis2.om.impl.llom.builder.StAXOMBuilder;
-import org.apache.axis2.soap.SOAP11Constants;
-import org.apache.axis2.soap.SOAP12Constants;
-import org.apache.axis2.soap.SOAPBody;
-import org.apache.axis2.soap.SOAPConstants;
-import org.apache.axis2.soap.SOAPEnvelope;
-import org.apache.axis2.soap.SOAPFactory;
-import org.apache.axis2.soap.SOAPHeader;
-import org.apache.axis2.soap.SOAPMessage;
-import org.apache.axis2.soap.SOAPProcessingException;
+import org.apache.axis2.soap.*;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import javax.xml.stream.XMLStreamReader;
+
 /**
  * Class StAXSOAPModelBuilder
  */
@@ -149,10 +141,10 @@
         if(isTempSOAPFactory) {
 	        if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(namespaceName)) {
 	            soapFactory = OMAbstractFactory.getSOAP12Factory();
-	            log.info("Starting Process SOAP 1.2 message");
+	            log.info("Starting to process SOAP 1.2 message");
 	        } else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(namespaceName)) {
 	            soapFactory = OMAbstractFactory.getSOAP11Factory();
-	            log.info("Starting Process SOAP 1.1 message");
+	            log.info("Starting to pocess SOAP 1.1 message");
 	
 	        } else {
 	            throw new SOAPProcessingException("Only SOAP 1.1 or SOAP 1.2 messages are supported
in the" +
@@ -216,7 +208,7 @@
         }
 
 
-        log.info("Build the OMElelment " + node.getLocalName() +
+        log.debug("Build the OMElelment " + node.getLocalName() +
                 "By the StaxSOAPModelBuilder");
         return node;
     }



Mime
View raw message