You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sa...@apache.org on 2007/05/01 14:19:43 UTC

svn commit: r534032 - in /webservices/axis2/trunk/c: include/axis2_const.h samples/server/axis2.xml src/core/engine/ctx_handler.c

Author: samisa
Date: Tue May  1 05:19:43 2007
New Revision: 534032

URL: http://svn.apache.org/viewvc?view=rev&rev=534032
Log:
Fixed the pool switching logic to drop allocating op_ctx from global pool

Modified:
    webservices/axis2/trunk/c/include/axis2_const.h
    webservices/axis2/trunk/c/samples/server/axis2.xml
    webservices/axis2/trunk/c/src/core/engine/ctx_handler.c

Modified: webservices/axis2/trunk/c/include/axis2_const.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_const.h?view=diff&rev=534032&r1=534031&r2=534032
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_const.h (original)
+++ webservices/axis2/trunk/c/include/axis2_const.h Tue May  1 05:19:43 2007
@@ -317,6 +317,8 @@
 #define AXIS2_ATTACHMENT_TEMP_DIR "attachmentDIR"
 #define AXIS2_CACHE_ATTACHMENTS "cacheAttachments"
 #define AXIS2_FILE_SIZE_THRESHOLD "sizeThreshold"
+/* op_ctx persistance */
+#define AXIS2_PERSIST_OP_CTX "persistOperationContext"
 
 /******************************************************************************/
 

Modified: webservices/axis2/trunk/c/samples/server/axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/axis2.xml?view=diff&rev=534032&r1=534031&r2=534032
==============================================================================
--- webservices/axis2/trunk/c/samples/server/axis2.xml (original)
+++ webservices/axis2/trunk/c/samples/server/axis2.xml Tue May  1 05:19:43 2007
@@ -2,17 +2,12 @@
     <!-- ================================================= -->
     <!-- Parameters -->
     <!-- ================================================= -->
-    <parameter name="hotdeployment" locked="false">false</parameter>
-    <parameter name="hotupdate" locked="false">false</parameter>
+    <!-- Uncomment following to enable MTOM support -->
     <!--parameter name="enableMTOM" locked="false">true</parameter-->
-    <!-- Uncomment this to enable REST support -->
     <parameter name="enableREST" locked="false">true</parameter>
 
-
-    <parameter name="userName" locked="false">admin</parameter>
-    <parameter name="password" locked="false">axis2</parameter>
-
-    <parameter name="seralizeLocation" locked="false">.</parameter>
+    <!-- Uncomment following to persist op_ctx, useful with RM -->
+    <!--parameter name="persistOperationContext" locked="false">true</parameter-->
 
     <!--if you want to extract the service archive file and work with that please uncomment this-->
     <!--else , it wont extract archive file or does not take into consideration if someone drop-->

Modified: webservices/axis2/trunk/c/src/core/engine/ctx_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/engine/ctx_handler.c?view=diff&rev=534032&r1=534031&r2=534032
==============================================================================
--- webservices/axis2/trunk/c/src/core/engine/ctx_handler.c (original)
+++ webservices/axis2/trunk/c/src/core/engine/ctx_handler.c Tue May  1 05:19:43 2007
@@ -145,24 +145,46 @@
     else if (op) /*  2. if no op_ctx, create new op_ctx */
     {
         axis2_conf_ctx_t *conf_ctx = NULL;
-        axutil_allocator_switch_to_global_pool(env->allocator);
+        axis2_bool_t use_pools = AXIS2_FALSE;
+        axutil_param_t *param =  axis2_msg_ctx_get_parameter(msg_ctx, env,
+            AXIS2_PERSIST_OP_CTX);
+
+        use_pools = (param && 0 == axutil_strcmp(AXIS2_VALUE_TRUE,
+                axutil_param_get_value(param, env)));
+        if (use_pools)
+        {
+            axutil_allocator_switch_to_global_pool(env->allocator);
+        }
         op_ctx = axis2_op_ctx_create(env, op, NULL);
         if (!op_ctx)
         {
             return AXIS2_FAILURE;
         }
 
-         axis2_msg_ctx_set_op_ctx(msg_ctx, env, op_ctx);
+        axis2_msg_ctx_set_op_ctx(msg_ctx, env, op_ctx);
 
         axis2_op_register_op_ctx(op, env, msg_ctx, op_ctx);
 
         conf_ctx =  axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
         if (conf_ctx)
         {
+            if (!use_pools)
+            {
+                axutil_allocator_switch_to_global_pool(env->allocator);
+            }
+            
             svc_grp_ctx =  axis2_conf_ctx_fill_ctxs(conf_ctx, env, msg_ctx);
-        }
 
-        axutil_allocator_switch_to_local_pool(env->allocator);
+            if (!use_pools)
+            {
+                axutil_allocator_switch_to_local_pool(env->allocator);
+            }
+        }
+        
+        if (use_pools)
+        {
+            axutil_allocator_switch_to_local_pool(env->allocator);
+        }
     }
 
     if (!svc_grp_ctx && (axis2_msg_ctx_get_server_side(msg_ctx, env)))



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