axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shan...@apache.org
Subject svn commit: r805347 [12/31] - in /webservices/axis2/trunk/c/src: core/addr/ core/clientapi/ core/context/ core/deployment/ core/description/ core/engine/ core/phaseresolver/ core/receivers/ core/transport/amqp/receiver/ core/transport/amqp/receiver/qpi...
Date Tue, 18 Aug 2009 10:15:53 GMT
Modified: webservices/axis2/trunk/c/src/core/engine/conf.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/engine/conf.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/engine/conf.c (original)
+++ webservices/axis2/trunk/c/src/core/engine/conf.c Tue Aug 18 10:15:49 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -55,7 +54,7 @@
     axutil_hash_t *faulty_svcs;
     axutil_hash_t *faulty_modules;
     axis2_char_t *axis2_repo;
-	axis2_char_t *axis2_xml;
+    axis2_char_t *axis2_xml;
     axis2_dep_engine_t *dep_engine;
     axutil_array_list_t *handlers;
     axis2_bool_t enable_mtom;
@@ -67,12 +66,15 @@
 
     /** Base description struct */
     axis2_desc_t *base;
-	
-	/** Mark whether conf is built using axis2 xml*/
-	axis2_bool_t axis2_flag;
 
-    /* This is a hack to keep rampart_context at client side */
-    void *security_context;
+    /** Mark whether conf is built using axis2 XML*/
+    axis2_bool_t axis2_flag;
+
+#if 0
+/* this seemed to be not used after 1.6.0 */
+/* This is a hack to keep rampart_context at client side */
+void *security_context;
+#endif
 };
 
 AXIS2_EXTERN axis2_conf_t *AXIS2_CALL
@@ -86,23 +88,18 @@
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    conf = (axis2_conf_t *) AXIS2_MALLOC(env->allocator, sizeof(axis2_conf_t));
-
-    if (!conf)
+    conf = (axis2_conf_t *)AXIS2_MALLOC(env->allocator, sizeof(axis2_conf_t));
+    if(!conf)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory");
         return NULL;
     }
 
-	memset ((void *)conf, 0, sizeof (axis2_conf_t));
-
-    conf->enable_mtom = AXIS2_FALSE;
-    conf->enable_security = AXIS2_FALSE;
-	conf->axis2_flag = AXIS2_FALSE;
+    memset((void *)conf, 0, sizeof(axis2_conf_t));
 
-    conf->param_container = (axutil_param_container_t *) axutil_param_container_create(env);
-    if (!conf->param_container)
+    conf->param_container = (axutil_param_container_t *)axutil_param_container_create(env);
+    if(!conf->param_container)
     {
         axis2_conf_free(conf, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -111,7 +108,7 @@
     }
 
     conf->svc_grps = axutil_hash_make(env);
-    if (!conf->svc_grps)
+    if(!conf->svc_grps)
     {
         axis2_conf_free(conf, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -119,18 +116,18 @@
         return NULL;
     }
 
-    for (i = 0; i < AXIS2_TRANSPORT_ENUM_MAX; i++)
+    for(i = 0; i < AXIS2_TRANSPORT_ENUM_MAX; i++)
     {
         conf->transports_in[i] = NULL;
     }
 
-    for (i = 0; i < AXIS2_TRANSPORT_ENUM_MAX; i++)
+    for(i = 0; i < AXIS2_TRANSPORT_ENUM_MAX; i++)
     {
         conf->transports_out[i] = NULL;
     }
 
     conf->engaged_module_list = axutil_array_list_create(env, 0);
-    if (!conf->engaged_module_list)
+    if(!conf->engaged_module_list)
     {
         axis2_conf_free(conf, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -139,7 +136,7 @@
     }
 
     conf->handlers = axutil_array_list_create(env, 0);
-    if (!conf->handlers)
+    if(!conf->handlers)
     {
         axis2_conf_free(conf, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -148,166 +145,152 @@
     }
 
     conf->in_phases_upto_and_including_post_dispatch = axutil_array_list_create(env, 0);
-    if (!conf->in_phases_upto_and_including_post_dispatch)
+    if(!conf->in_phases_upto_and_including_post_dispatch)
     {
         axis2_conf_free(conf, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                "Creating in phases list upto and including post dispatch failed");
-
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+            "Creating in phases list upto and including post dispatch failed");
         return NULL;
     }
     else
     {
         axis2_disp_t *uri_dispatch = NULL;
-        axis2_disp_t *add_dispatch = NULL;
+        axis2_disp_t *addr_dispatch = NULL;
 
         phase = axis2_phase_create(env, AXIS2_PHASE_TRANSPORT_IN);
-        if (!phase)
+        if(!phase)
         {
             axis2_conf_free(conf, env);
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating phase %s failed", 
-                    AXIS2_PHASE_TRANSPORT_IN);
-
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating phase %s failed",
+                AXIS2_PHASE_TRANSPORT_IN);
             return NULL;
         }
 
         /* In case of using security we need to find the service/operation parameters before the 
          * dispatch phase. This is required to give parameters to the security inflow.*/
-
         uri_dispatch = axis2_req_uri_disp_create(env);
-        if (uri_dispatch)
+        if(uri_dispatch)
         {
             axis2_handler_t *handler = NULL;
             handler = axis2_disp_get_base(uri_dispatch, env);
             axis2_disp_free(uri_dispatch, env);
             axis2_phase_add_handler_at(phase, env, 0, handler);
-            axutil_array_list_add(conf->handlers, env,
-                                  axis2_handler_get_handler_desc(handler, env));
+            axutil_array_list_add(conf->handlers, env, axis2_handler_get_handler_desc(handler, env));
         }
 
-        add_dispatch = axis2_addr_disp_create(env);
-        if (add_dispatch)
+        addr_dispatch = axis2_addr_disp_create(env);
+        if(addr_dispatch)
         {
             axis2_handler_t *handler = NULL;
-            handler = axis2_disp_get_base(add_dispatch, env);
-            axis2_disp_free(add_dispatch, env);
+            handler = axis2_disp_get_base(addr_dispatch, env);
+            axis2_disp_free(addr_dispatch, env);
             axis2_phase_add_handler_at(phase, env, 1, handler);
-            axutil_array_list_add(conf->handlers, env,
-                                  axis2_handler_get_handler_desc(handler, env));
+            axutil_array_list_add(conf->handlers, env, axis2_handler_get_handler_desc(handler, env));
         }
-        status = axutil_array_list_add(conf->
-                                       in_phases_upto_and_including_post_dispatch,
-                                       env, phase);
-        if (AXIS2_FAILURE == status)
+
+        status
+            = axutil_array_list_add(conf->in_phases_upto_and_including_post_dispatch, env, phase);
+        if(AXIS2_SUCCESS != status)
         {
             axis2_conf_free(conf, env);
             axis2_phase_free(phase, env);
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                "Adding phase %s into in phases upto and including post "\
-                "dispatch list failed", AXIS2_PHASE_TRANSPORT_IN);
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                "Adding phase %s into in phases upto and including post dispatch list failed",
+                AXIS2_PHASE_TRANSPORT_IN);
             return NULL;
-
         }
 
         phase = axis2_phase_create(env, AXIS2_PHASE_PRE_DISPATCH);
-        if (!phase)
+        if(!phase)
         {
             axis2_conf_free(conf, env);
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating phase %s failed", 
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating phase %s failed",
                 AXIS2_PHASE_PRE_DISPATCH);
             return NULL;
         }
-        status = axutil_array_list_add(conf->
-                                       in_phases_upto_and_including_post_dispatch,
-                                       env, phase);
-        if (AXIS2_FAILURE == status)
+
+        status
+            = axutil_array_list_add(conf->in_phases_upto_and_including_post_dispatch, env, phase);
+        if(AXIS2_SUCCESS != status)
         {
             axis2_conf_free(conf, env);
             axis2_phase_free(phase, env);
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                "Adding phase %s into in phases upto and including post "\
-                "dispatch list failed", AXIS2_PHASE_PRE_DISPATCH);
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                "Adding phase %s into in phases upto and including post dispatch list failed",
+                AXIS2_PHASE_PRE_DISPATCH);
             return NULL;
         }
     }
 
     conf->all_svcs = axutil_hash_make(env);
-    if (!conf->all_svcs)
+    if(!conf->all_svcs)
     {
         axis2_conf_free(conf, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Creating all services map failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating all services map failed");
         return NULL;
     }
 
     conf->all_init_svcs = axutil_hash_make(env);
-    if (!conf->all_init_svcs)
+    if(!conf->all_init_svcs)
     {
         axis2_conf_free(conf, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Creating all init services map failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating all init services map failed");
         return NULL;
     }
 
     conf->msg_recvs = axutil_hash_make(env);
-    if (!conf->msg_recvs)
+    if(!conf->msg_recvs)
     {
         axis2_conf_free(conf, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Creating message receivers map failed.");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating message receivers map failed.");
         return NULL;
     }
 
     conf->faulty_svcs = axutil_hash_make(env);
-    if (!conf->faulty_svcs)
+    if(!conf->faulty_svcs)
     {
         axis2_conf_free(conf, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Creating fault services map failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating fault services map failed");
         return NULL;
     }
 
     conf->faulty_modules = axutil_hash_make(env);
-    if (!conf->faulty_modules)
+    if(!conf->faulty_modules)
     {
         axis2_conf_free(conf, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Creating fault modules map failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating fault modules map failed");
         return NULL;
     }
 
     conf->all_modules = axutil_hash_make(env);
-    if (!conf->all_modules)
+    if(!conf->all_modules)
     {
         axis2_conf_free(conf, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Creating all modules map failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating all modules map failed");
         return NULL;
     }
 
     conf->name_to_version_map = axutil_hash_make(env);
-    if (!conf->name_to_version_map)
+    if(!conf->name_to_version_map)
     {
         axis2_conf_free(conf, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Creating name to version map failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating name to version map failed");
         return NULL;
     }
 
     conf->base = axis2_desc_create(env);
-    if (!conf->base)
+    if(!conf->base)
     {
         axis2_conf_free(conf, env);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
             "Creating Axis2 configuration base description failed");
         return NULL;
     }
@@ -322,60 +305,65 @@
 {
     int i = 0;
 
-    if (conf->param_container)
+    if(!conf)
+    {
+        /* nothing to free */
+        return;
+    }
+
+    if(conf->param_container)
     {
         axutil_param_container_free(conf->param_container, env);
     }
 
-    if (conf->svc_grps)
+    if(conf->svc_grps)
     {
         axutil_hash_index_t *hi = NULL;
         void *val = NULL;
-        for (hi = axutil_hash_first(conf->svc_grps, env); hi;
-             hi = axutil_hash_next(env, hi))
+        for(hi = axutil_hash_first(conf->svc_grps, env); hi; hi = axutil_hash_next(env, hi))
         {
             axis2_svc_grp_t *svc_grp = NULL;
             axutil_hash_this(hi, NULL, NULL, &val);
-            svc_grp = (axis2_svc_grp_t *) val;
-            if (svc_grp)
+            svc_grp = (axis2_svc_grp_t *)val;
+            if(svc_grp)
+            {
                 axis2_svc_grp_free(svc_grp, env);
+            }
         }
         axutil_hash_free(conf->svc_grps, env);
     }
 
-    for (i = 0; i < AXIS2_TRANSPORT_ENUM_MAX; i++)
+    for(i = 0; i < AXIS2_TRANSPORT_ENUM_MAX; i++)
     {
-        if (conf->transports_in[i])
+        if(conf->transports_in[i])
         {
             axis2_transport_in_desc_free(conf->transports_in[i], env);
         }
     }
 
-    for (i = 0; i < AXIS2_TRANSPORT_ENUM_MAX; i++)
+    for(i = 0; i < AXIS2_TRANSPORT_ENUM_MAX; i++)
     {
-        if (conf->transports_out[i])
+        if(conf->transports_out[i])
         {
             axis2_transport_out_desc_free(conf->transports_out[i], env);
         }
     }
 
-    if (conf->dep_engine)
+    if(conf->dep_engine)
     {
         axis2_dep_engine_free(conf->dep_engine, env);
     }
 
-    if (conf->all_modules)
+    if(conf->all_modules)
     {
         axutil_hash_index_t *hi = NULL;
         void *val = NULL;
-        for (hi = axutil_hash_first(conf->all_modules, env); hi;
-             hi = axutil_hash_next(env, hi))
+        for(hi = axutil_hash_first(conf->all_modules, env); hi; hi = axutil_hash_next(env, hi))
         {
             axis2_module_desc_t *module_desc = NULL;
-
             axutil_hash_this(hi, NULL, NULL, &val);
-            module_desc = (axis2_module_desc_t *) val;
-            if (module_desc)
+            module_desc = (axis2_module_desc_t *)val;
+            if(module_desc)
             {
                 axis2_module_desc_free(module_desc, env);
             }
@@ -383,18 +371,17 @@
         axutil_hash_free(conf->all_modules, env);
     }
 
-    if (conf->name_to_version_map)
+    if(conf->name_to_version_map)
     {
         axutil_hash_index_t *hi = NULL;
         void *val = NULL;
-        for (hi = axutil_hash_first(conf->name_to_version_map, env); hi;
-             hi = axutil_hash_next(env, hi))
+        for(hi = axutil_hash_first(conf->name_to_version_map, env); hi; hi = axutil_hash_next(env,
+            hi))
         {
             axis2_char_t *module_ver = NULL;
-
             axutil_hash_this(hi, NULL, NULL, &val);
-            module_ver = (axis2_char_t *) val;
-            if (module_ver)
+            module_ver = (axis2_char_t *)val;
+            if(module_ver)
             {
                 AXIS2_FREE(env->allocator, module_ver);
             }
@@ -402,106 +389,99 @@
         axutil_hash_free(conf->name_to_version_map, env);
     }
 
-    if (conf->engaged_module_list)
+    if(conf->engaged_module_list)
     {
-        int i = 0;
-        for (i = 0; i < axutil_array_list_size(conf->engaged_module_list, env); i++)
+        for(i = 0; i < axutil_array_list_size(conf->engaged_module_list, env); i++)
         {
             axutil_qname_t *module_desc_qname = NULL;
-            module_desc_qname = (axutil_qname_t *)
-                axutil_array_list_get(conf->engaged_module_list, env, i);
-            if (module_desc_qname)
+            module_desc_qname = (axutil_qname_t *)axutil_array_list_get(conf->engaged_module_list,
+                env, i);
+            if(module_desc_qname)
+            {
                 axutil_qname_free(module_desc_qname, env);
+            }
         }
         axutil_array_list_free(conf->engaged_module_list, env);
     }
 
-    if (conf->out_phases)
+    if(conf->out_phases)
     {
-        int i = 0;
-        for (i = 0; i < axutil_array_list_size(conf->out_phases, env); i++)
+        for(i = 0; i < axutil_array_list_size(conf->out_phases, env); i++)
         {
             axis2_phase_t *phase = NULL;
-            phase = (axis2_phase_t *)
-                axutil_array_list_get(conf->out_phases, env, i);
-            if (phase)
+            phase = (axis2_phase_t *)axutil_array_list_get(conf->out_phases, env, i);
+            if(phase)
+            {
                 axis2_phase_free(phase, env);
+            }
         }
         axutil_array_list_free(conf->out_phases, env);
     }
 
-    if (conf->in_fault_phases)
+    if(conf->in_fault_phases)
     {
-        int i = 0;
-        for (i = 0; i < axutil_array_list_size(conf->in_fault_phases, env); i++)
+        for(i = 0; i < axutil_array_list_size(conf->in_fault_phases, env); i++)
         {
             axis2_phase_t *phase = NULL;
-            phase = (axis2_phase_t *)
-                axutil_array_list_get(conf->in_fault_phases, env, i);
-            if (phase)
+            phase = (axis2_phase_t *)axutil_array_list_get(conf->in_fault_phases, env, i);
+            if(phase)
+            {
                 axis2_phase_free(phase, env);
+            }
         }
         axutil_array_list_free(conf->in_fault_phases, env);
     }
 
-    if (conf->out_fault_phases)
+    if(conf->out_fault_phases)
     {
-        /*This is added because in a recent change this is cloned. */
-
-        int i = 0;
-        for (i = 0; i < axutil_array_list_size(conf->out_fault_phases, env);
-             i++)
+        for(i = 0; i < axutil_array_list_size(conf->out_fault_phases, env); i++)
         {
             axis2_phase_t *phase = NULL;
-            phase = (axis2_phase_t *)
-                axutil_array_list_get(conf->out_fault_phases, env, i);
-            if (phase)
+            phase = (axis2_phase_t *)axutil_array_list_get(conf->out_fault_phases, env, i);
+            if(phase)
+            {
                 axis2_phase_free(phase, env);
+            }
         }
-
         axutil_array_list_free(conf->out_fault_phases, env);
     }
 
-    if (conf->in_phases_upto_and_including_post_dispatch)
+    if(conf->in_phases_upto_and_including_post_dispatch)
     {
-        int i = 0;
-        for (i = 0; i < axutil_array_list_size(conf->
-                                   in_phases_upto_and_including_post_dispatch,
-                                   env); i++)
+        for(i = 0; i < axutil_array_list_size(conf-> in_phases_upto_and_including_post_dispatch,
+            env); i++)
         {
             axis2_phase_t *phase = NULL;
-            phase = (axis2_phase_t *) axutil_array_list_get(conf->
-                                    in_phases_upto_and_including_post_dispatch,
-                                    env, i);
-
-            if (phase)
+            phase = (axis2_phase_t *)axutil_array_list_get(
+                conf-> in_phases_upto_and_including_post_dispatch, env, i);
+            if(phase)
+            {
                 axis2_phase_free(phase, env);
+            }
         }
-        axutil_array_list_free(conf->
-                               in_phases_upto_and_including_post_dispatch, env);
+        axutil_array_list_free(conf-> in_phases_upto_and_including_post_dispatch, env);
     }
 
-    if (conf->all_svcs)
+    if(conf->all_svcs)
     {
         axutil_hash_free(conf->all_svcs, env);
     }
 
-    if (conf->all_init_svcs)
+    if(conf->all_init_svcs)
     {
         axutil_hash_free(conf->all_init_svcs, env);
     }
 
-    if (conf->msg_recvs)
+    if(conf->msg_recvs)
     {
         axutil_hash_index_t *hi = NULL;
         void *val = NULL;
-        for (hi = axutil_hash_first(conf->msg_recvs, env); hi;
-             hi = axutil_hash_next(env, hi))
+        for(hi = axutil_hash_first(conf->msg_recvs, env); hi; hi = axutil_hash_next(env, hi))
         {
             axis2_msg_recv_t *msg_recv = NULL;
             axutil_hash_this(hi, NULL, NULL, &val);
-            msg_recv = (axis2_msg_recv_t *) val;
-            if (msg_recv)
+            msg_recv = (axis2_msg_recv_t *)val;
+            if(msg_recv)
             {
                 axis2_msg_recv_free(msg_recv, env);
                 msg_recv = NULL;
@@ -510,63 +490,59 @@
         axutil_hash_free(conf->msg_recvs, env);
     }
 
-    if (conf->faulty_svcs)
+    if(conf->faulty_svcs)
     {
         axutil_hash_free(conf->faulty_svcs, env);
     }
 
-    if (conf->faulty_modules)
+    if(conf->faulty_modules)
     {
         axutil_hash_index_t *hi = NULL;
         void *val = NULL;
-        for (hi = axutil_hash_first(conf->faulty_modules, env); hi;
-             hi = axutil_hash_next(env, hi))
+        for(hi = axutil_hash_first(conf->faulty_modules, env); hi; hi = axutil_hash_next(env, hi))
         {
             axis2_module_desc_t *module_desc = NULL;
             axutil_hash_this(hi, NULL, NULL, &val);
-            module_desc = (axis2_module_desc_t *) val;
-            if (module_desc)
+            module_desc = (axis2_module_desc_t *)val;
+            if(module_desc)
+            {
                 axis2_module_desc_free(module_desc, env);
+            }
         }
         axutil_hash_free(conf->faulty_modules, env);
     }
 
-    if (conf->handlers)
+    if(conf->handlers)
     {
         int i = 0;
-        for (i = 0; i < axutil_array_list_size(conf->handlers, env); i++)
+        for(i = 0; i < axutil_array_list_size(conf->handlers, env); i++)
         {
             axis2_handler_desc_t *handler_desc = NULL;
-            handler_desc = (axis2_handler_desc_t *)
-                axutil_array_list_get(conf->handlers, env, i);
-
-            if (handler_desc)
+            handler_desc = (axis2_handler_desc_t *)axutil_array_list_get(conf->handlers, env, i);
+            if(handler_desc)
+            {
                 axis2_handler_desc_free(handler_desc, env);
+            }
         }
         axutil_array_list_free(conf->handlers, env);
     }
 
-    if (conf->axis2_repo)
+    if(conf->axis2_repo)
     {
         AXIS2_FREE(env->allocator, conf->axis2_repo);
     }
 
-    if (conf->base)
+    if(conf->base)
     {
         axis2_desc_free(conf->base, env);
     }
 
-    if (conf->axis2_xml)
-    {
-        AXIS2_FREE (env->allocator, conf->axis2_xml);
-    }
-
-    if (conf)
+    if(conf->axis2_xml)
     {
-        AXIS2_FREE(env->allocator, conf);
+        AXIS2_FREE(env->allocator, conf->axis2_xml);
     }
 
-    return;
+    AXIS2_FREE(env->allocator, conf);
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
@@ -579,24 +555,22 @@
     axutil_hash_index_t *index_i = NULL;
     axis2_char_t *svc_name = NULL;
     const axis2_char_t *svc_grp_name = NULL;
-    int k = 0;
 
     AXIS2_PARAM_CHECK(env->error, svc_grp, AXIS2_FAILURE);
 
     svcs = axis2_svc_grp_get_all_svcs(svc_grp, env);
-    if (!conf->all_svcs)
+    if(!conf->all_svcs)
     {
         conf->all_svcs = axutil_hash_make(env);
-        if (!conf->all_svcs)
+        if(!conf->all_svcs)
         {
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating all services map failed");
             return AXIS2_FAILURE;
         }
     }
 
-    k = axutil_hash_count(svcs);
     index_i = axutil_hash_first(svcs, env);
-    while (index_i)
+    while(index_i)
     {
         void *value = NULL;
         axis2_svc_t *desc = NULL;
@@ -604,20 +578,17 @@
         const axutil_qname_t *svc_qname = NULL;
 
         axutil_hash_this(index_i, NULL, NULL, &value);
-        desc = (axis2_svc_t *) value;
+        desc = (axis2_svc_t *)value;
         svc_qname = axis2_svc_get_qname(desc, env);
         svc_name = axutil_qname_get_localpart(svc_qname, env);
-
         temp_svc = axutil_hash_get(conf->all_svcs, svc_name, AXIS2_HASH_KEY_STRING);
 
         /* No two service names deployed in the engine can be same */
-        if (temp_svc)
+        if(temp_svc)
         {
             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_TWO_SVCS_CANNOT_HAVE_SAME_NAME, AXIS2_FAILURE);
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                "There is already a service called %s in the all services list of axis2 configuration.", 
-                svc_name);
-
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "There is already a service called %s in the "
+                "all services list of axis2 configuration.", svc_name);
             return AXIS2_FAILURE;
         }
 
@@ -627,23 +598,23 @@
     svcs = axis2_svc_grp_get_all_svcs(svc_grp, env);
     index_i = axutil_hash_first(svcs, env);
 
-    while (index_i)
+    while(index_i)
     {
         void *value = NULL;
         axis2_svc_t *desc = NULL;
 
         axutil_hash_this(index_i, NULL, NULL, &value);
-        desc = (axis2_svc_t *) value;
+        desc = (axis2_svc_t *)value;
         svc_name = axutil_qname_get_localpart(axis2_svc_get_qname(desc, env), env);
         axutil_hash_set(conf->all_svcs, svc_name, AXIS2_HASH_KEY_STRING, desc);
         index_i = axutil_hash_next(env, index_i);
     }
 
     svc_grp_name = axis2_svc_grp_get_name(svc_grp, env);
-    if (!conf->svc_grps)
+    if(!conf->svc_grps)
     {
         conf->svc_grps = axutil_hash_make(env);
-        if (!conf->svc_grps)
+        if(!conf->svc_grps)
         {
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating service group map failed");
             return AXIS2_FAILURE;
@@ -663,17 +634,14 @@
 {
     AXIS2_PARAM_CHECK(env->error, svc_grp_name, NULL);
 
-    if (!conf->svc_grps)
+    if(!conf->svc_grps)
     {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_CONF,
-                        AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_CONF, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
             "Axis2 configuration does not contain a service group map");
         return NULL;
     }
-    return (axis2_svc_grp_t *) (axutil_hash_get(conf->svc_grps,
-                                                svc_grp_name,
-                                                AXIS2_HASH_KEY_STRING));
+    return (axis2_svc_grp_t *)(axutil_hash_get(conf->svc_grps, svc_grp_name, AXIS2_HASH_KEY_STRING));
 }
 
 AXIS2_EXTERN axutil_hash_t *AXIS2_CALL
@@ -700,72 +668,62 @@
     /* We need to first create a service group with the same name as the 
      * service and make it the parent of service */
     svc_grp_name = axis2_svc_get_name(svc, env);
-    if (!svc_grp_name)
+    if(!svc_grp_name)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Service has no name set");
-
         return AXIS2_FAILURE;
     }
 
     svc_grp = axis2_svc_grp_create(env);
-    if (!svc_grp)
+    if(!svc_grp)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
             "Creating service group as parent of service %s failed", svc_grp_name);
-
-            return AXIS2_FAILURE;
+        return AXIS2_FAILURE;
     }
 
     status = axis2_svc_grp_set_name(svc_grp, env, svc_grp_name);
-    if (AXIS2_SUCCESS != status)
+    if(AXIS2_SUCCESS != status)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Setting name to service group failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Setting name to service group failed");
         return status;
     }
 
     status = axis2_svc_grp_set_parent(svc_grp, env, conf);
-    if (AXIS2_SUCCESS != status)
+    if(AXIS2_SUCCESS != status)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Setting parent to service group %s failed", svc_grp_name);
-
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Setting parent to service group %s failed",
+            svc_grp_name);
         return status;
     }
 
     phase_resolver = axis2_phase_resolver_create_with_config_and_svc(env, conf, svc);
-
-    if (!phase_resolver)
+    if(!phase_resolver)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating phase resolver failed for service %s", 
-                axis2_svc_get_name(svc, env));
-
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating phase resolver failed for service %s",
+            axis2_svc_get_name(svc, env));
         return AXIS2_FAILURE;
     }
 
     status = axis2_phase_resolver_build_execution_chains_for_svc(phase_resolver, env);
     axis2_phase_resolver_free(phase_resolver, env);
-    if (AXIS2_SUCCESS != status)
+    if(AXIS2_SUCCESS != status)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Building chains failed within phase resolver for service %s", axis2_svc_get_name(svc, env));
-
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Building chains failed within phase resolver "
+            "for service %s", axis2_svc_get_name(svc, env));
         return status;
     }
 
     status = axis2_svc_grp_add_svc(svc_grp, env, svc);
-
-    if (AXIS2_SUCCESS != status)
+    if(AXIS2_SUCCESS != status)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Adding service %s to service group %s failed", svc_grp_name, svc_grp_name);
-
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Adding service %s to service group %s failed",
+            svc_grp_name, svc_grp_name);
         return status;
     }
 
     status = axis2_conf_add_svc_grp(conf, env, svc_grp);
-
     return status;
 }
 
@@ -803,19 +761,16 @@
 
     AXIS2_PARAM_CHECK(env->error, param, AXIS2_FAILURE);
 
-    if (axis2_conf_is_param_locked(conf, env, param_name))
+    if(axis2_conf_is_param_locked(conf, env, param_name))
     {
-        AXIS2_ERROR_SET(env->error,
-                        AXIS2_ERROR_PARAMETER_LOCKED_CANNOT_OVERRIDE,
-                        AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Parameter %s is locked for Axis2 configuration", param_name);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_PARAMETER_LOCKED_CANNOT_OVERRIDE, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Parameter %s is locked for Axis2 configuration",
+            param_name);
         return AXIS2_FAILURE;
     }
     else
     {
-        status = axutil_param_container_add_param(conf->param_container, env,
-                                                  param);
+        status = axutil_param_container_add_param(conf->param_container, env, param);
     }
     return status;
 }
@@ -828,13 +783,10 @@
 {
     AXIS2_PARAM_CHECK(env->error, name, NULL);
 
-    if (!conf->param_container)
+    if(!conf->param_container)
     {
-        AXIS2_ERROR_SET(env->error,
-                        AXIS2_ERROR_INVALID_STATE_PARAM_CONTAINER,
-                        AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Param container is not set in axis2 configuraion");
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_PARAM_CONTAINER, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Param container is not set in axis2 configuraion");
         return NULL;
     }
 
@@ -871,7 +823,7 @@
     const axutil_env_t * env,
     const AXIS2_TRANSPORT_ENUMS trans_enum)
 {
-    return (axis2_transport_in_desc_t *) conf->transports_in[trans_enum];
+    return (axis2_transport_in_desc_t *)conf->transports_in[trans_enum];
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
@@ -917,7 +869,7 @@
     const axis2_conf_t * conf,
     const axutil_env_t * env)
 {
-    return (axis2_transport_in_desc_t **) conf->transports_in;
+    return (axis2_transport_in_desc_t **)conf->transports_in;
 }
 
 AXIS2_EXTERN axis2_module_desc_t *AXIS2_CALL
@@ -934,27 +886,25 @@
 
     AXIS2_PARAM_CHECK(env->error, qname, NULL);
 
-    name = axutil_qname_to_string((axutil_qname_t *) qname, env);
-    ret = (axis2_module_desc_t *) axutil_hash_get(conf->all_modules,
-                                                  name, AXIS2_HASH_KEY_STRING);
-    if (ret)
+    name = axutil_qname_to_string((axutil_qname_t *)qname, env);
+    ret = (axis2_module_desc_t *)axutil_hash_get(conf->all_modules, name, AXIS2_HASH_KEY_STRING);
+    if(ret)
     {
         return ret;
     }
     module_name = axutil_qname_get_localpart(qname, env);
-    if (!module_name)
+    if(!module_name)
     {
         return NULL;
     }
     def_mod_ver = axis2_conf_get_default_module_version(conf, env, module_name);
     mod_qname = axis2_core_utils_get_module_qname(env, name, def_mod_ver);
-    if (!mod_qname)
+    if(!mod_qname)
     {
         return NULL;
     }
     name = axutil_qname_to_string(mod_qname, env);
-    ret = (axis2_module_desc_t *) axutil_hash_get(conf->all_modules,
-                                                  name, AXIS2_HASH_KEY_STRING);
+    ret = (axis2_module_desc_t *)axutil_hash_get(conf->all_modules, name, AXIS2_HASH_KEY_STRING);
     axutil_qname_free(mod_qname, env);
     mod_qname = NULL;
     return ret;
@@ -1005,7 +955,7 @@
     const axis2_conf_t * conf,
     const axutil_env_t * env)
 {
-    return (axis2_transport_out_desc_t **) conf->transports_out;
+    return (axis2_transport_out_desc_t **)conf->transports_out;
 }
 
 AXIS2_EXTERN axutil_hash_t *AXIS2_CALL
@@ -1029,43 +979,42 @@
     const axis2_conf_t * conf,
     const axutil_env_t * env)
 {
-    axutil_hash_t *sgs = NULL;
-    axutil_hash_index_t *index_i = NULL;
-    axutil_hash_index_t *index_j = NULL;
-    void *value = NULL;
-    void *value2 = NULL;
-    axis2_svc_grp_t *axis_svc_grp = NULL;
-    axutil_hash_t *svcs = NULL;
-    axis2_svc_t *svc = NULL;
-    axis2_char_t *svc_name = NULL;
+    /*axutil_hash_t *sgs = NULL;
+     axutil_hash_index_t *index_i = NULL;
+     axutil_hash_index_t *index_j = NULL;
+     void *value = NULL;
+     void *value2 = NULL;
+     axis2_svc_grp_t *axis_svc_grp = NULL;
+     axutil_hash_t *svcs = NULL;
+     axis2_svc_t *svc = NULL;
+     axis2_char_t *svc_name = NULL;
+     */
 
     /* Do we need to do all the following of retrieving all service groups and
      * then add all services from each group to conf->all_svcs and then finally 
      * return conf->all_svcs?. We have already done this when
      * adding each service group to the conf, so just returning conf->all_svcs
      * here would be enough - Damitha */
-    sgs = axis2_conf_get_all_svc_grps(conf, env);
-    index_i = axutil_hash_first(sgs, env);
-    while (index_i)
-    {
-        axutil_hash_this(index_i, NULL, NULL, &value);
-        axis_svc_grp = (axis2_svc_grp_t *) value;
-        svcs = axis2_svc_grp_get_all_svcs(axis_svc_grp, env);
-        index_j = axutil_hash_first(svcs, env);
-        while (index_j)
-        {
-            axutil_hash_this(index_j, NULL, NULL, &value2);
-            svc = (axis2_svc_t *) value2;
-            svc_name =
-                axutil_qname_get_localpart(axis2_svc_get_qname(svc, env), env);
-            axutil_hash_set(conf->all_svcs, svc_name,
-                            AXIS2_HASH_KEY_STRING, svc);
+    /*sgs = axis2_conf_get_all_svc_grps(conf, env);
+     index_i = axutil_hash_first(sgs, env);
+     while(index_i)
+     {
+     axutil_hash_this(index_i, NULL, NULL, &value);
+     axis_svc_grp = (axis2_svc_grp_t *)value;
+     svcs = axis2_svc_grp_get_all_svcs(axis_svc_grp, env);
+     index_j = axutil_hash_first(svcs, env);
+     while(index_j)
+     {
+     axutil_hash_this(index_j, NULL, NULL, &value2);
+     svc = (axis2_svc_t *)value2;
+     svc_name = axutil_qname_get_localpart(axis2_svc_get_qname(svc, env), env);
+     axutil_hash_set(conf->all_svcs, svc_name, AXIS2_HASH_KEY_STRING, svc);
 
-            index_j = axutil_hash_next(env, index_j);
-        }
+     index_j = axutil_hash_next(env, index_j);
+     }
 
-        index_i = axutil_hash_next(env, index_i);
-    }
+     index_i = axutil_hash_next(env, index_i);
+     }*/
     return conf->all_svcs;
 }
 
@@ -1086,23 +1035,23 @@
 
     sgs = axis2_conf_get_all_svc_grps(conf, env);
     index_i = axutil_hash_first(sgs, env);
-    while (index_i)
+    while(index_i)
     {
         axutil_hash_this(index_i, NULL, NULL, &value);
-        axis_svc_grp = (axis2_svc_grp_t *) value;
+        axis_svc_grp = (axis2_svc_grp_t *)value;
         svcs = axis2_svc_grp_get_all_svcs(axis_svc_grp, env);
         index_j = axutil_hash_first(svcs, env);
-        while (index_j)
+        while(index_j)
         {
             axutil_param_t *param = NULL;
             axutil_hash_this(index_j, NULL, NULL, &value2);
-            svc = (axis2_svc_t *) value2;
-            svc_name =
-                axutil_qname_get_localpart(axis2_svc_get_qname(svc, env), env);
+            svc = (axis2_svc_t *)value2;
+            svc_name = axutil_qname_get_localpart(axis2_svc_get_qname(svc, env), env);
             param = axis2_svc_get_param(svc, env, AXIS2_LOAD_SVC_STARTUP);
-            if (param)
-                axutil_hash_set(conf->all_init_svcs, svc_name,
-                                AXIS2_HASH_KEY_STRING, svc);
+            if(param)
+            {
+                axutil_hash_set(conf->all_init_svcs, svc_name, AXIS2_HASH_KEY_STRING, svc);
+            }
 
             index_j = axutil_hash_next(env, index_j);
         }
@@ -1125,23 +1074,20 @@
 
     AXIS2_PARAM_CHECK(env->error, module_name, AXIS2_FALSE);
 
-    def_mod = axis2_conf_get_default_module(conf, env, axutil_qname_get_localpart(module_name, env));
-    if (def_mod)
+    def_mod
+        = axis2_conf_get_default_module(conf, env, axutil_qname_get_localpart(module_name, env));
+    if(def_mod)
     {
         def_mod_qname = axis2_module_desc_get_qname(def_mod, env);
     }
 
     size = axutil_array_list_size(conf->engaged_module_list, env);
-
-    for (i = 0; i < size; i++)
+    for(i = 0; i < size; i++)
     {
         axutil_qname_t *qname = NULL;
-
-        qname = (axutil_qname_t *) axutil_array_list_get(conf->engaged_module_list, env, i);
-
-        if (axutil_qname_equals(module_name, env, qname) ||
-            (def_mod_qname &&
-             axutil_qname_equals(def_mod_qname, env, qname)))
+        qname = (axutil_qname_t *)axutil_array_list_get(conf->engaged_module_list, env, i);
+        if(axutil_qname_equals(module_name, env, qname) || (def_mod_qname && axutil_qname_equals(
+            def_mod_qname, env, qname)))
         {
             return AXIS2_TRUE;
         }
@@ -1166,7 +1112,7 @@
 {
     AXIS2_PARAM_CHECK(env->error, phases_info, AXIS2_FAILURE);
 
-    if (conf->phases_info)
+    if(conf->phases_info)
     {
         axis2_phases_info_free(phases_info, env);
         conf->phases_info = NULL;
@@ -1184,13 +1130,12 @@
 {
     AXIS2_PARAM_CHECK(env->error, key, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, msg_recv, AXIS2_FAILURE);
-    if (!conf->msg_recvs)
+    if(!conf->msg_recvs)
     {
         conf->msg_recvs = axutil_hash_make(env);
-        if (!conf->msg_recvs)
+        if(!conf->msg_recvs)
         {
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                "Creating message receiver map failed");
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating message receiver map failed");
             return AXIS2_FAILURE;
         }
     }
@@ -1204,8 +1149,7 @@
     const axutil_env_t * env,
     axis2_char_t * key)
 {
-    return (axis2_msg_recv_t *) axutil_hash_get(conf->msg_recvs, key,
-                                                AXIS2_HASH_KEY_STRING);
+    return (axis2_msg_recv_t *)axutil_hash_get(conf->msg_recvs, key, AXIS2_HASH_KEY_STRING);
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
@@ -1216,7 +1160,7 @@
 {
     AXIS2_PARAM_CHECK(env->error, out_phases, AXIS2_FAILURE);
 
-    if (conf->out_phases)
+    if(conf->out_phases)
     {
         axutil_array_list_free(conf->out_phases, env);
         conf->out_phases = NULL;
@@ -1241,7 +1185,7 @@
 {
     AXIS2_PARAM_CHECK(env->error, list, AXIS2_FAILURE);
 
-    if (conf->in_fault_phases)
+    if(conf->in_fault_phases)
     {
         axutil_array_list_free(conf->in_fault_phases, env);
         conf->in_fault_phases = NULL;
@@ -1258,7 +1202,7 @@
 {
     AXIS2_PARAM_CHECK(env->error, list, AXIS2_FAILURE);
 
-    if (conf->out_fault_phases)
+    if(conf->out_fault_phases)
     {
         axutil_array_list_free(conf->out_fault_phases, env);
         conf->out_fault_phases = NULL;
@@ -1288,13 +1232,11 @@
     axis2_module_desc_set_parent(module, env, conf);
 
     module_qname = axis2_module_desc_get_qname(module, env);
-    if (module_qname)
+    if(module_qname)
     {
         axis2_char_t *module_name = NULL;
-        module_name =
-            axutil_qname_to_string((axutil_qname_t *) module_qname, env);
-        axutil_hash_set(conf->all_modules, module_name, AXIS2_HASH_KEY_STRING,
-                        module);
+        module_name = axutil_qname_to_string((axutil_qname_t *)module_qname, env);
+        axutil_hash_set(conf->all_modules, module_name, AXIS2_HASH_KEY_STRING, module);
     }
 
     return AXIS2_SUCCESS;
@@ -1315,72 +1257,63 @@
     axis2_disp_checker_t *disp_checker = NULL;
 
     dispatch = axis2_phase_create(env, AXIS2_PHASE_DISPATCH);
-    if (!dispatch)
+    if(!dispatch)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating phase %s failed", 
-            AXIS2_PHASE_DISPATCH);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating phase %s failed", AXIS2_PHASE_DISPATCH);
         return AXIS2_FAILURE;
     }
 
     rest_dispatch = axis2_rest_disp_create(env);
-    if (!rest_dispatch)
+    if(!rest_dispatch)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Creating rest dispatcher failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating rest dispatcher failed");
         return AXIS2_FAILURE;
     }
 
     handler = axis2_disp_get_base(rest_dispatch, env);
     axis2_disp_free(rest_dispatch, env);
     axis2_phase_add_handler_at(dispatch, env, 0, handler);
-    axutil_array_list_add(conf->handlers, env,
-                          axis2_handler_get_handler_desc(handler, env));
+    axutil_array_list_add(conf->handlers, env, axis2_handler_get_handler_desc(handler, env));
 
     soap_msg_body_based_dispatch = axis2_soap_body_disp_create(env);
-    if (!soap_msg_body_based_dispatch)
+    if(!soap_msg_body_based_dispatch)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Creating soap body based dispatcher failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating soap body based dispatcher failed");
         return AXIS2_FAILURE;
     }
 
     handler = axis2_disp_get_base(soap_msg_body_based_dispatch, env);
     axis2_disp_free(soap_msg_body_based_dispatch, env);
     axis2_phase_add_handler_at(dispatch, env, 1, handler);
-    axutil_array_list_add(conf->handlers, env,
-                          axis2_handler_get_handler_desc(handler, env));
+    axutil_array_list_add(conf->handlers, env, axis2_handler_get_handler_desc(handler, env));
 
     soap_action_based_dispatch = axis2_soap_action_disp_create(env);
-    if (!soap_action_based_dispatch)
+    if(!soap_action_based_dispatch)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Creating soap action based dispatcher failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating soap action based dispatcher failed");
         return AXIS2_FAILURE;
     }
 
     handler = axis2_disp_get_base(soap_action_based_dispatch, env);
     axis2_disp_free(soap_action_based_dispatch, env);
     axis2_phase_add_handler_at(dispatch, env, 2, handler);
-    axutil_array_list_add(conf->handlers, env,
-                          axis2_handler_get_handler_desc(handler, env));	
+    axutil_array_list_add(conf->handlers, env, axis2_handler_get_handler_desc(handler, env));
 
-    status = axutil_array_list_add(conf->
-                                   in_phases_upto_and_including_post_dispatch,
-                                   env, dispatch);
-    if (AXIS2_SUCCESS != status)
+    status
+        = axutil_array_list_add(conf-> in_phases_upto_and_including_post_dispatch, env, dispatch);
+    if(AXIS2_SUCCESS != status)
     {
         axis2_phase_free(dispatch, env);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Adding dispatcher into in phases upto and including post "\
-            "dispatch list failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+            "Adding dispatcher into in phases upto and including post dispatch list failed");
         return status;
     }
 
     post_dispatch = axis2_phase_create(env, AXIS2_PHASE_POST_DISPATCH);
-    if (!post_dispatch)
+    if(!post_dispatch)
     {
         axis2_phase_free(dispatch, env);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating phase %s failed", 
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating phase %s failed",
             AXIS2_PHASE_POST_DISPATCH);
         return AXIS2_FAILURE;
     }
@@ -1389,24 +1322,19 @@
     handler = axis2_disp_checker_get_base(disp_checker, env);
     axis2_disp_checker_free(disp_checker, env);
     axis2_phase_add_handler_at(post_dispatch, env, 0, handler);
-    axutil_array_list_add(conf->handlers, env,
-                          axis2_handler_get_handler_desc(handler, env));
-
+    axutil_array_list_add(conf->handlers, env, axis2_handler_get_handler_desc(handler, env));
     handler = axis2_ctx_handler_create(env, NULL);
     axis2_phase_add_handler_at(post_dispatch, env, 1, handler);
-    axutil_array_list_add(conf->handlers, env,
-                          axis2_handler_get_handler_desc(handler, env));
+    axutil_array_list_add(conf->handlers, env, axis2_handler_get_handler_desc(handler, env));
 
-    status = axutil_array_list_add(conf->
-                                   in_phases_upto_and_including_post_dispatch,
-                                   env, post_dispatch);
-    if (AXIS2_SUCCESS != status)
+    status = axutil_array_list_add(conf-> in_phases_upto_and_including_post_dispatch, env,
+        post_dispatch);
+    if(AXIS2_SUCCESS != status)
     {
         axis2_phase_free(dispatch, env);
         axis2_phase_free(post_dispatch, env);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Adding post dispatcher into in phases upto and including post "\
-            "dispatch list failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+            "Adding post dispatcher into in phases upto and including post dispatch list failed");
         return status;
     }
     return AXIS2_SUCCESS;
@@ -1425,22 +1353,20 @@
 
     AXIS2_PARAM_CHECK(env->error, dispatch, AXIS2_FAILURE);
 
-    status = axutil_array_list_add(conf->
-                                   in_phases_upto_and_including_post_dispatch,
-                                   env, dispatch);
-    if (AXIS2_FAILURE == status)
-    {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Adding dispatcher into in phases upto and including post "\
-            "dispatch list failed");
+    status
+        = axutil_array_list_add(conf-> in_phases_upto_and_including_post_dispatch, env, dispatch);
+    if(AXIS2_FAILURE == status)
+    {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+            "Adding dispatcher into in phases upto and including post dispatch list failed");
         return AXIS2_FAILURE;
     }
 
     post_dispatch = axis2_phase_create(env, AXIS2_PHASE_POST_DISPATCH);
-    if (!post_dispatch)
+    if(!post_dispatch)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Creating phase %s failed", AXIS2_PHASE_POST_DISPATCH);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating phase %s failed",
+            AXIS2_PHASE_POST_DISPATCH);
         axis2_phase_free(dispatch, env);
         return AXIS2_FAILURE;
     }
@@ -1450,17 +1376,15 @@
     handler = axis2_disp_checker_get_base(disp_checker, env);
     axis2_phase_add_handler_at(post_dispatch, env, 0, handler);
 
-    status = axutil_array_list_add(conf->
-                                   in_phases_upto_and_including_post_dispatch,
-                                   env, post_dispatch);
-    if (AXIS2_FAILURE == status)
+    status = axutil_array_list_add(conf-> in_phases_upto_and_including_post_dispatch, env,
+        post_dispatch);
+    if(AXIS2_FAILURE == status)
     {
         axis2_phase_free(dispatch, env);
         axis2_phase_free(post_dispatch, env);
         axis2_disp_checker_free(disp_checker, env);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Adding post dispatcher into in phases upto and including post "\
-            "dispatch list failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+            "Adding post dispatcher into in phases upto and including post dispatch list failed");
         return AXIS2_FAILURE;
     }
     return AXIS2_SUCCESS;
@@ -1487,10 +1411,10 @@
     axis2_char_t *file_name = NULL;
 
     AXIS2_PARAM_CHECK(env->error, module_ref, AXIS2_FAILURE);
-	AXIS2_PARAM_CHECK (env->error, conf, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, conf, AXIS2_FAILURE);
 
     module_desc = axis2_conf_get_module(conf, env, module_ref);
-    if (!module_desc)
+    if(!module_desc)
     {
         axutil_file_t *file = NULL;
         const axis2_char_t *repos_path = NULL;
@@ -1505,82 +1429,82 @@
         axis2_char_t *axis2_xml = NULL;
 
         file_name = axutil_qname_get_localpart(module_ref, env);
-        file = (axutil_file_t *) axis2_arch_reader_create_module_arch(env, file_name);
+        file = (axutil_file_t *)axis2_arch_reader_create_module_arch(env, file_name);
         /* This flag is to check whether conf is built using axis2
          * xml configuration file instead of a repository. */
-		flag = axis2_conf_get_axis2_flag (conf, env);
+        flag = axis2_conf_get_axis2_flag(conf, env);
 
-		if (!flag)
-		{
-        	repos_path = axis2_conf_get_repo(conf, env);
-        	temp_path1 = axutil_stracat(env, repos_path, AXIS2_PATH_SEP_STR);
-        	temp_path2 = axutil_stracat(env, temp_path1, AXIS2_MODULE_FOLDER);
-        	temp_path3 = axutil_stracat(env, temp_path2, AXIS2_PATH_SEP_STR);
-        	path = axutil_stracat(env, temp_path3, file_name);
-        	AXIS2_FREE(env->allocator, temp_path1);
-        	AXIS2_FREE(env->allocator, temp_path2);
-        	AXIS2_FREE(env->allocator, temp_path3);
-		}
-		else
-		{
-			/**
-			 * This case is to obtain module path from the axis2.xml
-			 */
-			axis2_xml = (axis2_char_t *)axis2_conf_get_axis2_xml (conf, env);
-			module_dir_param = axis2_conf_get_param (conf, env, AXIS2_MODULE_DIR);
+        if(!flag)
+        {
+            repos_path = axis2_conf_get_repo(conf, env);
+            temp_path1 = axutil_stracat(env, repos_path, AXIS2_PATH_SEP_STR);
+            temp_path2 = axutil_stracat(env, temp_path1, AXIS2_MODULE_FOLDER);
+            temp_path3 = axutil_stracat(env, temp_path2, AXIS2_PATH_SEP_STR);
+            path = axutil_stracat(env, temp_path3, file_name);
+            AXIS2_FREE(env->allocator, temp_path1);
+            AXIS2_FREE(env->allocator, temp_path2);
+            AXIS2_FREE(env->allocator, temp_path3);
+        }
+        else
+        {
+            /**
+             * This case is to obtain module path from the axis2.xml
+             */
+            axis2_xml = (axis2_char_t *)axis2_conf_get_axis2_xml(conf, env);
+            module_dir_param = axis2_conf_get_param(conf, env, AXIS2_MODULE_DIR);
 
-            if (module_dir_param)
+            if(module_dir_param)
             {
-                module_dir = (axis2_char_t *) axutil_param_get_value (module_dir_param, env);
+                module_dir = (axis2_char_t *)axutil_param_get_value(module_dir_param, env);
             }
             else
             {
-                AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
-                        "moduleDir parameter not available in axis2.xml.");
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                    "moduleDir parameter not available in axis2.xml.");
 
                 return AXIS2_FAILURE;
             }
 
-			temp_path1 = axutil_strcat (env, module_dir, AXIS2_PATH_SEP_STR, NULL);
-			path = axutil_strcat (env, temp_path1, file_name, NULL);
-		}
-		
+            temp_path1 = axutil_strcat(env, module_dir, AXIS2_PATH_SEP_STR, NULL);
+            path = axutil_strcat(env, temp_path1, file_name, NULL);
+        }
+
         axutil_file_set_path(file, env, path);
         file_data = axis2_arch_file_data_create_with_type_and_file(env, AXIS2_MODULE, file);
-		if (!flag)
+        if(!flag)
         {
-        	dep_engine = axis2_dep_engine_create_with_repos_name(env, repos_path);
+            dep_engine = axis2_dep_engine_create_with_repos_name(env, repos_path);
         }
-		else
+        else
         {
-			dep_engine = axis2_dep_engine_create_with_axis2_xml (env, axis2_xml);
+            dep_engine = axis2_dep_engine_create_with_axis2_xml(env, axis2_xml);
         }
-		
+
         axis2_dep_engine_set_current_file_item(dep_engine, env, file_data);
 
         /* this module_dir set the path of the module directory
-         * petaining to this module. This value will use inside the
+         * Pertaining to this module. This value will use inside the
          * axis2_dep_engine_build_module function
          */
 
-		axis2_dep_engine_set_module_dir (dep_engine, env, path);
+        axis2_dep_engine_set_module_dir(dep_engine, env, path);
 
-        if (path)
+        if(path)
         {
-            AXIS2_FREE (env->allocator, path);
+            AXIS2_FREE(env->allocator, path);
         }
 
-        if (file_data)
+        if(file_data)
         {
             axis2_arch_file_data_free(file_data, env);
         }
 
         module_desc = axis2_dep_engine_build_module(dep_engine, env, file, conf);
-        axutil_file_free (file, env);
+        axutil_file_free(file, env);
         is_new_module = AXIS2_TRUE;
     }
-	
-    if (module_desc)
+
+    if(module_desc)
     {
         int size = 0;
         int i = 0;
@@ -1588,12 +1512,12 @@
 
         size = axutil_array_list_size(conf->engaged_module_list, env);
         module_qname = axis2_module_desc_get_qname(module_desc, env);
-        for (i = 0; i < size; i++)
+        for(i = 0; i < size; i++)
         {
             axutil_qname_t *qname = NULL;
 
-            qname = (axutil_qname_t *) axutil_array_list_get(conf->engaged_module_list, env, i);
-            if (axutil_qname_equals(module_qname, env, qname))
+            qname = (axutil_qname_t *)axutil_array_list_get(conf->engaged_module_list, env, i);
+            if(axutil_qname_equals(module_qname, env, qname))
             {
                 to_be_engaged = AXIS2_FALSE;
             }
@@ -1602,13 +1526,13 @@
     else
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_MODULE, AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Either module description not set or building"\
-                "module description failed for module %s", file_name);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Either module description not set or building"
+            "module description failed for module %s", file_name);
 
         return AXIS2_FAILURE;
     }
 
-    if (to_be_engaged)
+    if(to_be_engaged)
     {
         axis2_phase_resolver_t *phase_resolver = NULL;
         axutil_qname_t *module_qref_l = NULL;
@@ -1618,23 +1542,24 @@
         module_qname = axis2_module_desc_get_qname(module_desc, env);
         module_name = axutil_qname_get_localpart(module_qname, env);
         phase_resolver = axis2_phase_resolver_create_with_config(env, conf);
-        if (!phase_resolver)
+        if(!phase_resolver)
         {
             return AXIS2_FAILURE;
         }
 
         status = axis2_phase_resolver_engage_module_globally(phase_resolver, env, module_desc);
         axis2_phase_resolver_free(phase_resolver, env);
-        if (!status)
+        if(!status)
         {
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Engaging module %s globally failed", module_name);
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Engaging module %s globally failed",
+                module_name);
             return status;
         }
-        module_qref_l = axutil_qname_clone((axutil_qname_t *) module_qname, env);
+        module_qref_l = axutil_qname_clone((axutil_qname_t *)module_qname, env);
         status = axutil_array_list_add(conf->engaged_module_list, env, module_qref_l);
     }
 
-    if (is_new_module)
+    if(is_new_module)
     {
         status = axis2_conf_add_module(conf, env, module_desc);
     }
@@ -1656,7 +1581,7 @@
     const axutil_env_t * env,
     axis2_char_t * repos_path)
 {
-    if (conf->axis2_repo)
+    if(conf->axis2_repo)
     {
         AXIS2_FREE(env->allocator, conf->axis2_repo);
         conf->axis2_repo = NULL;
@@ -1665,13 +1590,12 @@
     return AXIS2_SUCCESS;
 }
 
-
 AXIS2_EXTERN const axis2_char_t *AXIS2_CALL
 axis2_conf_get_axis2_xml(
     const axis2_conf_t * conf,
     const axutil_env_t * env)
 {
-    return axutil_strdup (env, conf->axis2_xml);
+    return axutil_strdup(env, conf->axis2_xml);
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
@@ -1680,12 +1604,11 @@
     const axutil_env_t * env,
     axis2_char_t * axis2_xml)
 {
-    AXIS2_PARAM_CHECK (env->error, axis2_xml, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, axis2_xml, AXIS2_FAILURE);
     conf->axis2_xml = axutil_strdup(env, axis2_xml);
     return AXIS2_SUCCESS;
 }
 
-
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_conf_set_dep_engine(
     axis2_conf_t * conf,
@@ -1706,7 +1629,7 @@
     AXIS2_PARAM_CHECK(env->error, module_name, NULL);
 
     def_ver_map = conf->name_to_version_map;
-    if (!def_ver_map)
+    if(!def_ver_map)
     {
         return NULL;
     }
@@ -1730,7 +1653,7 @@
     all_modules = conf->all_modules;
     mod_ver = axis2_conf_get_default_module_version(conf, env, module_name);
 
-    if (!mod_ver)
+    if(!mod_ver)
     {
         mod_name = axutil_strdup(env, module_name);
     }
@@ -1745,14 +1668,12 @@
     AXIS2_FREE(env->allocator, mod_name);
     mod_name = NULL;
 
-    if (!mod_qname)
+    if(!mod_qname)
     {
         return NULL;
     }
-    ret_mod = (axis2_module_desc_t *) axutil_hash_get(all_modules,
-                                                      axutil_qname_to_string
-                                                      (mod_qname, env),
-                                                      AXIS2_HASH_KEY_STRING);
+    ret_mod = (axis2_module_desc_t *)axutil_hash_get(all_modules, axutil_qname_to_string(mod_qname,
+        env), AXIS2_HASH_KEY_STRING);
 
     return ret_mod;
 }
@@ -1774,15 +1695,14 @@
      */
     name_to_ver_map = conf->name_to_version_map;
 
-    if (!axutil_hash_get(name_to_ver_map, module_name, AXIS2_HASH_KEY_STRING))
+    if(!axutil_hash_get(name_to_ver_map, module_name, AXIS2_HASH_KEY_STRING))
     {
         axis2_char_t *new_entry = axutil_strdup(env, module_version);
-        if (!new_entry)
+        if(!new_entry)
         {
             return AXIS2_FAILURE;
         }
-        axutil_hash_set(name_to_ver_map, module_name, AXIS2_HASH_KEY_STRING,
-                        new_entry);
+        axutil_hash_set(name_to_ver_map, module_name, AXIS2_HASH_KEY_STRING, new_entry);
         return AXIS2_SUCCESS;
     }
     return AXIS2_FAILURE;
@@ -1800,9 +1720,8 @@
 
     AXIS2_PARAM_CHECK(env->error, module_name, AXIS2_FAILURE);
 
-    module_qname = axis2_core_utils_get_module_qname(env, module_name,
-                                                     version_id);
-    if (!module_qname)
+    module_qname = axis2_core_utils_get_module_qname(env, module_name, version_id);
+    if(!module_qname)
     {
         return AXIS2_FAILURE;
     }
@@ -1829,7 +1748,6 @@
     return AXIS2_SUCCESS;
 }
 
-
 AXIS2_EXTERN axis2_bool_t AXIS2_CALL
 axis2_conf_get_axis2_flag(
     axis2_conf_t * conf,
@@ -1868,6 +1786,8 @@
     return AXIS2_SUCCESS;
 }
 
+#if 0
+/* this seemed to be not used after 1.6.0 */
 AXIS2_EXTERN void *AXIS2_CALL
 axis2_conf_get_security_context(
     axis2_conf_t * conf,
@@ -1887,6 +1807,7 @@
     conf->security_context = (void *) security_context;
     return AXIS2_SUCCESS;
 }
+#endif
 
 AXIS2_EXTERN axutil_param_container_t *AXIS2_CALL
 axis2_conf_get_param_container(
@@ -1905,9 +1826,10 @@
 }
 
 AXIS2_EXTERN axutil_array_list_t * AXIS2_CALL
-axis2_conf_get_handlers(const axis2_conf_t * conf,
+axis2_conf_get_handlers(
+    const axis2_conf_t * conf,
     const axutil_env_t * env)
 {
-	return conf->handlers;
+    return conf->handlers;
 }
 

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?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/engine/ctx_handler.c (original)
+++ webservices/axis2/trunk/c/src/core/engine/ctx_handler.c Tue Aug 18 10:15:49 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -30,7 +29,8 @@
  * and the operation.
  */
 
-axis2_status_t AXIS2_CALL axis2_ctx_handler_invoke(
+axis2_status_t AXIS2_CALL
+axis2_ctx_handler_invoke(
     axis2_handler_t * handler,
     const axutil_env_t * env,
     struct axis2_msg_ctx *msg_ctx);
@@ -44,10 +44,10 @@
     axis2_handler_desc_t *handler_desc = NULL;
     axutil_string_t *handler_string = NULL;
 
-    if (string)
+    if(string)
     {
-        handler_string = axutil_string_clone((axutil_string_t *) string, env);
-        if (!(handler_string))
+        handler_string = axutil_string_clone((axutil_string_t *)string, env);
+        if(!(handler_string))
         {
             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
             return NULL;
@@ -56,16 +56,15 @@
     else
     {
         /* create default string */
-        handler_string =
-            axutil_string_create_const(env, (axis2_char_t **) & AXIS2_CTX_HANDLER_NAME);
-        if (!handler_string)
+        handler_string = axutil_string_create_const(env, (axis2_char_t **)&AXIS2_CTX_HANDLER_NAME);
+        if(!handler_string)
         {
             return NULL;
         }
     }
 
     handler = axis2_handler_create(env);
-    if (!handler)
+    if(!handler)
     {
         return NULL;
     }
@@ -73,7 +72,7 @@
     /* handler desc of base handler */
     handler_desc = axis2_handler_desc_create(env, handler_string);
     axutil_string_free(handler_string, env);
-    if (!handler_desc)
+    if(!handler_desc)
     {
         axis2_handler_free(handler, env);
         return NULL;
@@ -99,20 +98,18 @@
     axis2_svc_grp_ctx_t *svc_grp_ctx = NULL;
 
     AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
-    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Entry:axis2_ctx_handler_invoke"); 
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Entry:axis2_ctx_handler_invoke");
 
     op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
     svc_ctx = axis2_msg_ctx_get_svc_ctx(msg_ctx, env);
 
-    if (op_ctx && svc_ctx)
+    if(op_ctx && svc_ctx)
     {
         svc_grp_ctx = axis2_svc_ctx_get_parent(svc_ctx, env);
-        if (svc_grp_ctx)
+        if(svc_grp_ctx)
         {
-            axutil_string_t *svc_grp_ctx_id_str =
-                axutil_string_create(env,
-                                     axis2_svc_grp_ctx_get_id(svc_grp_ctx,
-                                                              env));
+            axutil_string_t *svc_grp_ctx_id_str = axutil_string_create(env,
+                axis2_svc_grp_ctx_get_id(svc_grp_ctx, env));
             axis2_msg_ctx_set_svc_grp_ctx_id(msg_ctx, env, svc_grp_ctx_id_str);
             axutil_string_free(svc_grp_ctx_id_str, env);
         }
@@ -120,16 +117,16 @@
     }
 
     op = axis2_msg_ctx_get_op(msg_ctx, env);
-    if (op)
+    if(op)
     {
         op_ctx = axis2_op_find_existing_op_ctx(op, env, msg_ctx);
     }
 
-    if (op_ctx)
+    if(op_ctx)
     {
         axis2_op_register_op_ctx(op, env, msg_ctx, op_ctx);
         svc_ctx = axis2_op_ctx_get_parent(op_ctx, env);
-        if (svc_ctx)
+        if(svc_ctx)
         {
             axutil_string_t *svc_grp_ctx_id_str = NULL;
             const axis2_char_t *grp_ctx_id = NULL;
@@ -138,33 +135,32 @@
             axis2_msg_ctx_set_svc_ctx(msg_ctx, env, svc_ctx);
             axis2_msg_ctx_set_svc_grp_ctx(msg_ctx, env, svc_grp_ctx);
             grp_ctx_id = axis2_svc_grp_ctx_get_id(svc_grp_ctx, env);
-            svc_grp_ctx_id_str =
-                axutil_string_create(env, grp_ctx_id);
+            svc_grp_ctx_id_str = axutil_string_create(env, grp_ctx_id);
             axis2_msg_ctx_set_svc_grp_ctx_id(msg_ctx, env, svc_grp_ctx_id_str);
             axutil_string_free(svc_grp_ctx_id_str, env);
         }
 
         return AXIS2_SUCCESS;
     }
-    else if (op)                /*  2. if no op_ctx, create new op_ctx */
+    else if(op) /*  2. if no op_ctx, create new op_ctx */
     {
         axis2_conf_ctx_t *conf_ctx = NULL;
         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)));
+        use_pools = (param && 0 == axutil_strcmp(AXIS2_VALUE_TRUE, axutil_param_get_value(param,
+            env)));
 
-        if (use_pools)
+        if(use_pools)
         {
             axutil_allocator_switch_to_global_pool(env->allocator);
         }
         op_ctx = axis2_op_ctx_create(env, op, NULL);
-        if (!op_ctx)
+        if(!op_ctx)
         {
             axis2_char_t *op_name = axutil_qname_get_localpart(axis2_op_get_qname(op, env), env);
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                    "Could not create Operation context for operatoin %s", op_name);
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                "Could not create Operation context for operatoin %s", op_name);
 
             return AXIS2_FAILURE;
         }
@@ -174,34 +170,34 @@
         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(conf_ctx)
         {
-            if (!use_pools)
+            if(!use_pools)
             {
                 axutil_allocator_switch_to_global_pool(env->allocator);
             }
 
             svc_grp_ctx = axis2_conf_ctx_fill_ctxs(conf_ctx, env, msg_ctx);
 
-            if (!use_pools)
+            if(!use_pools)
             {
                 axutil_allocator_switch_to_local_pool(env->allocator);
             }
         }
 
-        if (use_pools)
+        if(use_pools)
         {
             axutil_allocator_switch_to_local_pool(env->allocator);
         }
     }
 
-    if (!svc_grp_ctx && (axis2_msg_ctx_get_server_side(msg_ctx, env)))
+    if(!svc_grp_ctx && (axis2_msg_ctx_get_server_side(msg_ctx, env)))
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Service group context not found"); 
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Service group context not found");
         return AXIS2_FAILURE;
     }
 
-    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Exit:axis2_ctx_handler_invoke"); 
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Exit:axis2_ctx_handler_invoke");
 
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/src/core/engine/disp.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/engine/disp.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/engine/disp.c (original)
+++ webservices/axis2/trunk/c/src/core/engine/disp.c Tue Aug 18 10:15:49 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -36,7 +35,7 @@
     axutil_string_t *name;
 
     /** derived struct */
-    void *derived;              /* deep copy */
+    void *derived; /* deep copy */
     int derived_type;
 };
 
@@ -49,7 +48,7 @@
     axis2_handler_desc_t *handler_desc = NULL;
 
     disp = AXIS2_MALLOC(env->allocator, sizeof(axis2_disp_t));
-    if (!disp)
+    if(!disp)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
@@ -58,10 +57,10 @@
     disp->name = NULL;
     disp->base = NULL;
 
-    if (name)
+    if(name)
     {
-        disp->name = axutil_string_clone((axutil_string_t *) name, env);
-        if (!(disp->name))
+        disp->name = axutil_string_clone((axutil_string_t *)name, env);
+        if(!(disp->name))
         {
             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
             axis2_disp_free(disp, env);
@@ -71,10 +70,8 @@
     else
     {
         /* create default name */
-        disp->name =
-            axutil_string_create_const(env,
-                                       (axis2_char_t **) & AXIS2_DISP_NAME);
-        if (!(disp->name))
+        disp->name = axutil_string_create_const(env, (axis2_char_t **)&AXIS2_DISP_NAME);
+        if(!(disp->name))
         {
             axis2_disp_free(disp, env);
             return NULL;
@@ -82,7 +79,7 @@
     }
 
     disp->base = axis2_handler_create(env);
-    if (!disp->base)
+    if(!disp->base)
     {
         axis2_disp_free(disp, env);
         return NULL;
@@ -90,7 +87,7 @@
 
     /* handler desc of base handler */
     handler_desc = axis2_handler_desc_create(env, disp->name);
-    if (!handler_desc)
+    if(!handler_desc)
     {
         axis2_disp_free(disp, env);
         return NULL;
@@ -123,15 +120,15 @@
     const axutil_env_t * env,
     axutil_string_t * name)
 {
-    if (disp->name)
+    if(disp->name)
     {
         axutil_string_free(disp->name, env);
     }
 
-    if (name)
+    if(name)
     {
         disp->name = axutil_string_clone(name, env);
-        if (!(disp->name))
+        if(!(disp->name))
             return AXIS2_FAILURE;
     }
 
@@ -151,20 +148,20 @@
 
     axis_service = axis2_msg_ctx_get_svc(msg_ctx, env);
 
-    if (!axis_service)
+    if(!axis_service)
     {
         axis_service = axis2_msg_ctx_find_svc(msg_ctx, env);
-        if (axis_service)
+        if(axis_service)
         {
             axis2_msg_ctx_set_svc(msg_ctx, env, axis_service);
         }
     }
     op = axis2_msg_ctx_get_op(msg_ctx, env);
-    if (!op)
+    if(!op)
     {
         op = axis2_msg_ctx_find_op(msg_ctx, env, axis_service);
 
-        if (op)
+        if(op)
         {
             axis2_msg_ctx_set_op(msg_ctx, env, op);
         }
@@ -178,7 +175,7 @@
     struct axis2_disp *disp,
     const axutil_env_t * env)
 {
-    if (disp->name)
+    if(disp->name)
     {
         axutil_string_free(disp->name, env);
     }

Modified: webservices/axis2/trunk/c/src/core/engine/disp_checker.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/engine/disp_checker.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/engine/disp_checker.c (original)
+++ webservices/axis2/trunk/c/src/core/engine/disp_checker.c Tue Aug 18 10:15:49 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -29,8 +28,7 @@
 #include <axiom_soap.h>
 #include <axiom.h>
 
-const axis2_char_t *AXIS2_DISP_CHECKER_NAME =
-    "dispatch_post_conditions_evaluator";
+const axis2_char_t *AXIS2_DISP_CHECKER_NAME = "dispatch_post_conditions_evaluator";
 
 struct axis2_disp_checker
 {
@@ -42,7 +40,8 @@
     axutil_string_t *name;
 };
 
-axis2_status_t AXIS2_CALL axis2_disp_checker_invoke(
+axis2_status_t AXIS2_CALL
+axis2_disp_checker_invoke(
     axis2_handler_t * handler,
     const axutil_env_t * env,
     axis2_msg_ctx_t * msg_ctx);
@@ -55,7 +54,7 @@
     axis2_handler_desc_t *handler_desc = NULL;
 
     disp_checker = AXIS2_MALLOC(env->allocator, sizeof(axis2_disp_checker_t));
-    if (!disp_checker)
+    if(!disp_checker)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
@@ -65,28 +64,25 @@
     disp_checker->base = NULL;
 
     /* create default name */
-    disp_checker->name = axutil_string_create_const(env,
-                                                    (axis2_char_t **) &
-                                                    AXIS2_DISP_CHECKER_NAME);
+    disp_checker->name = axutil_string_create_const(env, (axis2_char_t **)&AXIS2_DISP_CHECKER_NAME);
 
-    if (!(disp_checker->name))
+    if(!(disp_checker->name))
     {
         axis2_disp_checker_free(disp_checker, env);
         return NULL;
     }
 
     disp_checker->base = axis2_handler_create(env);
-    if (!disp_checker->base)
+    if(!disp_checker->base)
     {
         axis2_disp_checker_free(disp_checker, env);
         return NULL;
     }
-    axis2_handler_set_invoke(disp_checker->base, env,
-                             axis2_disp_checker_invoke);
+    axis2_handler_set_invoke(disp_checker->base, env, axis2_disp_checker_invoke);
 
     /* handler desc of base handler */
     handler_desc = axis2_handler_desc_create(env, disp_checker->name);
-    if (!handler_desc)
+    if(!handler_desc)
     {
         axis2_disp_checker_free(disp_checker, env);
         return NULL;
@@ -118,16 +114,16 @@
     const axutil_env_t * env,
     const axutil_string_t * name)
 {
-    if (disp_checker->name)
+    if(disp_checker->name)
     {
         axutil_string_free(disp_checker->name, env);
         disp_checker->name = NULL;
     }
 
-    if (name)
+    if(name)
     {
-        disp_checker->name = axutil_string_clone((axutil_string_t *) name, env);
-        if (!(disp_checker->name))
+        disp_checker->name = axutil_string_clone((axutil_string_t *)name, env);
+        if(!(disp_checker->name))
             return AXIS2_FAILURE;
     }
 
@@ -139,7 +135,7 @@
     axis2_disp_checker_t * disp_checker,
     const axutil_env_t * env)
 {
-    if (disp_checker->name)
+    if(disp_checker->name)
     {
         axutil_string_free(disp_checker->name, env);
     }
@@ -173,118 +169,116 @@
     AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
 
     /*if is client side, no point in proceeding */
-    if (!(axis2_msg_ctx_get_server_side(msg_ctx, env)))
+    if(!(axis2_msg_ctx_get_server_side(msg_ctx, env)))
         return AXIS2_SUCCESS;
 
     op = axis2_msg_ctx_get_op(msg_ctx, env);
 
-    if (!op)
+    if(!op)
     {
         op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
-        if (op_ctx)
+        if(op_ctx)
         {
             axis2_op_t *op = axis2_op_ctx_get_op(op_ctx, env);
-            if (op)
+            if(op)
                 axis2_msg_ctx_set_op(msg_ctx, env, op);
         }
     }
 
     svc = axis2_msg_ctx_get_svc(msg_ctx, env);
 
-    if (!svc)
+    if(!svc)
     {
         svc_ctx = axis2_msg_ctx_get_svc_ctx(msg_ctx, env);
-        if (svc_ctx)
+        if(svc_ctx)
         {
             axis2_svc_t *tsvc = axis2_svc_ctx_get_svc(svc_ctx, env);
-            if (tsvc)
+            if(tsvc)
                 axis2_msg_ctx_set_svc(msg_ctx, env, tsvc);
         }
     }
     endpoint_ref = axis2_msg_ctx_get_to(msg_ctx, env);
 
-    if (endpoint_ref)
+    if(endpoint_ref)
     {
         address = axis2_endpoint_ref_get_address(endpoint_ref, env);
     }
 
     svc = axis2_msg_ctx_get_svc(msg_ctx, env);
-    if (!svc)
+    if(!svc)
     {
-        AXIS2_LOG_INFO(env->log,
-                       "Service Not found. Endpoint reference is : %s",
-                       (address) ? address : "NULL");
-        if (axis2_msg_ctx_get_is_soap_11(msg_ctx, env))
+        AXIS2_LOG_INFO(env->log, "Service Not found. Endpoint reference is : %s",
+            (address) ? address : "NULL");
+        if(axis2_msg_ctx_get_is_soap_11(msg_ctx, env))
         {
             soap_version = AXIOM_SOAP11;
-            fault_code =
-                AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX ":"
-                AXIOM_SOAP11_FAULT_CODE_RECEIVER;
-        }
-        else
-        {
-            fault_code =
-                AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX ":"
-                AXIOM_SOAP12_SOAP_FAULT_VALUE_RECEIVER;
-
-        }
-
-        soap_envelope =
-            axiom_soap_envelope_create_default_soap_envelope(env, soap_version);
-        soap_body = axiom_soap_envelope_get_body(soap_envelope, env);
-        soap_fault =
-            axiom_soap_fault_create_default_fault(env, soap_body, fault_code,
-                                                  "Service Not Found",
-                                                  soap_version);
-
-        wsa_action = (axis2_char_t *)axis2_msg_ctx_get_wsa_action (msg_ctx, 
-                                                                   env);
-        sprintf (exception, "Service Not Found, Endpoint referance address is %s and wsa\
- actions is %s", address, wsa_action);
+fault_code        =
+        AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX ":"
+        AXIOM_SOAP11_FAULT_CODE_RECEIVER;
+    }
+    else
+    {
+        fault_code =
+        AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX ":"
+        AXIOM_SOAP12_SOAP_FAULT_VALUE_RECEIVER;
 
-        axiom_soap_fault_set_exception (soap_fault, env, exception);
-        axis2_msg_ctx_set_fault_soap_envelope(msg_ctx, env, soap_envelope);
-        return AXIS2_FAILURE;
     }
 
-    op = axis2_msg_ctx_get_op(msg_ctx, env);
-    if (!op)
-    {
-        AXIS2_LOG_INFO(env->log,
-                       "Operation Not found. Endpoint reference is : %s",
-                       (address) ? address : "NULL");
-        if (axis2_msg_ctx_get_is_soap_11(msg_ctx, env))
-        {
-            soap_version = AXIOM_SOAP11;
-            fault_code =
-                AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX ":"
-                AXIOM_SOAP11_FAULT_CODE_RECEIVER;
-        }
-        else
-        {
-            fault_code =
-                AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX ":"
-                AXIOM_SOAP12_SOAP_FAULT_VALUE_RECEIVER;
-        }
+    soap_envelope =
+    axiom_soap_envelope_create_default_soap_envelope(env, soap_version);
+    soap_body = axiom_soap_envelope_get_body(soap_envelope, env);
+    soap_fault =
+    axiom_soap_fault_create_default_fault(env, soap_body, fault_code,
+        "Service Not Found",
+        soap_version);
+
+    wsa_action = (axis2_char_t *)axis2_msg_ctx_get_wsa_action (msg_ctx,
+        env);
+    sprintf (exception, "Service Not Found, Endpoint referance address is %s and wsa\
+ actions is %s", address, wsa_action);
 
+    axiom_soap_fault_set_exception (soap_fault, env, exception);
+    axis2_msg_ctx_set_fault_soap_envelope(msg_ctx, env, soap_envelope);
+    return AXIS2_FAILURE;
+}
 
-        soap_envelope =
-            axiom_soap_envelope_create_default_soap_envelope(env, soap_version);
-        soap_body = axiom_soap_envelope_get_body(soap_envelope, env);
-        soap_fault =
-            axiom_soap_fault_create_default_fault(env, soap_body, fault_code,
-                                                  "Operation Not Found",
-                                                  soap_version);
-
-        wsa_action = (axis2_char_t *)axis2_msg_ctx_get_wsa_action (msg_ctx, 
-                                                                   env);
-        sprintf (exception, "Operation Not Found, Endpoint referance address is %s and wsa\
+op = axis2_msg_ctx_get_op(msg_ctx, env);
+if (!op)
+{
+    AXIS2_LOG_INFO(env->log,
+        "Operation Not found. Endpoint reference is : %s",
+        (address) ? address : "NULL");
+    if (axis2_msg_ctx_get_is_soap_11(msg_ctx, env))
+    {
+        soap_version = AXIOM_SOAP11;
+        fault_code =
+        AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX ":"
+        AXIOM_SOAP11_FAULT_CODE_RECEIVER;
+    }
+    else
+    {
+        fault_code =
+        AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX ":"
+        AXIOM_SOAP12_SOAP_FAULT_VALUE_RECEIVER;
+    }
+
+    soap_envelope =
+    axiom_soap_envelope_create_default_soap_envelope(env, soap_version);
+    soap_body = axiom_soap_envelope_get_body(soap_envelope, env);
+    soap_fault =
+    axiom_soap_fault_create_default_fault(env, soap_body, fault_code,
+        "Operation Not Found",
+        soap_version);
+
+    wsa_action = (axis2_char_t *)axis2_msg_ctx_get_wsa_action (msg_ctx,
+        env);
+    sprintf (exception, "Operation Not Found, Endpoint referance address is %s and wsa\
  actions is %s", address, wsa_action);
 
-        axiom_soap_fault_set_exception (soap_fault, env, exception);
-        axis2_msg_ctx_set_fault_soap_envelope(msg_ctx, env, soap_envelope);
-        return AXIS2_FAILURE;
-    }
-    return AXIS2_SUCCESS;
+    axiom_soap_fault_set_exception (soap_fault, env, exception);
+    axis2_msg_ctx_set_fault_soap_envelope(msg_ctx, env, soap_envelope);
+    return AXIS2_FAILURE;
+}
+return AXIS2_SUCCESS;
 }
 



Mime
View raw message