axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r447276 - in /webservices/axis2/trunk/c: include/axis2_phase_holder.h include/axis2_phase_resolver.h modules/core/phaseresolver/phase_holder.c modules/core/phaseresolver/phase_resolver.c
Date Mon, 18 Sep 2006 06:17:32 GMT
Author: samisa
Date: Sun Sep 17 23:17:31 2006
New Revision: 447276

URL: http://svn.apache.org/viewvc?view=rev&rev=447276
Log:
Fixed API and doc comments

Modified:
    webservices/axis2/trunk/c/include/axis2_phase_holder.h
    webservices/axis2/trunk/c/include/axis2_phase_resolver.h
    webservices/axis2/trunk/c/modules/core/phaseresolver/phase_holder.c
    webservices/axis2/trunk/c/modules/core/phaseresolver/phase_resolver.c

Modified: webservices/axis2/trunk/c/include/axis2_phase_holder.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_phase_holder.h?view=diff&rev=447276&r1=447275&r2=447276
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_phase_holder.h (original)
+++ webservices/axis2/trunk/c/include/axis2_phase_holder.h Sun Sep 17 23:17:31 2006
@@ -20,13 +20,14 @@
 /** 
  * @defgroup axis2_phase_holder phase holder
  * @ingroup axis2_phase_resolver
- * Description
+ * phase holder is used by phase resolver to hold information related to
+ * phases and handlers within a phase. This struct hold the list of phases 
+ * found in the services.xml and axis2.xml.
  * @{
  */
 
 /**
  * @file axis2_phase_holder.h
- * @brief Axis2 Wsdl soap op interface
  */
 
 #include <axis2_const.h>
@@ -46,23 +47,24 @@
 {
 #endif
 
-    struct axis2_phase;
-    struct axis2_handler_desc;
-    struct axis2_handler;
-    struct axis2_phase_rule;
     /** Type name for struct axis2_phase_holder */
     typedef struct axis2_phase_holder axis2_phase_holder_t;
     /** Type name for struct axis2_phase_holder_ops  */
     typedef struct axis2_phase_holder_ops axis2_phase_holder_ops_t;
 
+    struct axis2_phase;
+    struct axis2_handler_desc;
+    struct axis2_handler;
+    struct axis2_phase_rule;
+
     /**
-     * Wsdl Phase Holder ops struct
-     * Encapsulator struct for ops of axis2_phase_holder
+     * phase holder ops struct.
+     * Encapsulator struct for ops of axis2_phase_holder.
      */
     struct axis2_phase_holder_ops
     {
         /** 
-         * De-allocate memory
+         * Frees phase holder.
          * @param phase_holder pointer to phase holder
          * @param env pointer to environment struct
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
@@ -73,10 +75,11 @@
                     const axis2_env_t *env);
 
         /**
-         * Method isPhaseExist
+         * Checks if the named phase exist.
          * @param phase_holder pointer to phase holder
          * @param env pointer to environment struct
-         * @param phase_name pointer to phase name
+         * @param phase_name phase name string
+         * @return AXIS2_TRUE if the named phase exist, else AXIS2_FALSE
          */
         axis2_bool_t (AXIS2_CALL *
                 is_phase_exist)(
@@ -85,6 +88,7 @@
                     const axis2_char_t *phase_name);
 
         /**
+         * Adds given handler to phase holder.
          * @param phase_holder pointer to phase holder
          * @param env pointer to environment struct
          * @para handler pointer to handler
@@ -97,11 +101,12 @@
                     struct axis2_handler_desc *handler);
 
         /**
-         * this method is used to get the actual phase object given in the phase
-         * array list
+         * Gets the named phase from phase array list.
          * @param phase_holder pointer to phase holder
          * @param env pointer to environment struct
          * @param phase_name pointer to phase name
+         * @return pointer to named phase if it exists, else NULL. Returns a 
+         * reference, not a cloned copy 
          */
         struct axis2_phase *(AXIS2_CALL *
                 get_phase)(
@@ -110,13 +115,14 @@
                     const axis2_char_t *phase_name);
 
         /**
-         * This method is to build the transport phase , here load the corresponding 
-         * handlers and added them
-         * in to correct phase
+         * Builds the transport phase. This method loads the corresponding 
+         * handlers and added them into correct phase. 
          * @param phase_holder pointer to phase holder
          * @param env pointer to environment struct
-         * @param phase pointer to phase
-         * @param handlers pointer to handlers
+         * @param phase pointer to phase, phase holder does not assume the 
+         * ownership the phase
+         * @param handlers pointer to array list of handlers, phase holder does 
+         * not assume the ownership of the list
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
         axis2_status_t (AXIS2_CALL *
@@ -128,7 +134,7 @@
     };
 
     /**
-     * phase holder struct  
+     * phase holder struct.
      */
     struct axis2_phase_holder
     {
@@ -137,7 +143,7 @@
     };
 
     /**
-     * Creates phase holder struct
+     * Creates phase holder struct.
      * @param env pointer to environment struct
      * @return pointer to newly created phase holder
      */
@@ -146,9 +152,9 @@
         const axis2_env_t *env);
 
     /**
-     * Creates phase holder struct
+     * Creates phase holder struct with given list of phases.
      * @param env pointer to environment struct
-     * @param phases pointer to phases
+     * @param phases pointer to array list of phases
      * @return pointer to newly created phase holder
      */
     AXIS2_EXTERN axis2_phase_holder_t *AXIS2_CALL
@@ -156,34 +162,30 @@
         const axis2_env_t *env,
         axis2_array_list_t *phases);
 
-/*************************** Function macros **********************************/
-
-/** Frees the phase holder.
+/** Frees phase holder.
     @sa axis2_phase_holder_ops#free */
 #define AXIS2_PHASE_HOLDER_FREE(phase_holder, env) \
       ((phase_holder)->ops->free (phase_holder, env))
 
-/** Is phase exist.
+/** Checks of a named phase exist.
     @sa axis2_phase_holder_ops#is_phase_exist */
 #define AXIS2_PHASE_HOLDER_IS_PHASE_EXIST(phase_holder, env, phase_name) \
       ((phase_holder)->ops->is_phase_exist (phase_holder, env, phase_name))
 
-/** Add handler.
+/** Adds handler.
     @sa axis2_phase_holder_ops#add_handler */
 #define AXIS2_PHASE_HOLDER_ADD_HANDLER(phase_holder, env, handler) \
       ((phase_holder)->ops->add_handler (phase_holder, env, handler))
 
-/** Gets the phase.
+/** Gets named phase.
     @sa axis2_phase_holder_ops#get_phase */
 #define AXIS2_PHASE_HOLDER_GET_PHASE(phase_holder, env, phase_name) \
       ((phase_holder)->ops->get_phase (phase_holder, env, phase_name))
 
-/** Build transport handler chain.
+/** Builds transport handler chain.
     @sa axis2_phase_holder_ops#build_transport_handler_chain */
 #define AXIS2_PHASE_HOLDER_BUILD_TRANSPORT_HANDLER_CHAIN(phase_holder, env, phase, handlers) \
       ((phase_holder)->ops->build_transport_handler_chain (phase_holder, env, phase, handlers))
-
-/*************************** End of function macros ***************************/
 
 /** @} */
 

Modified: webservices/axis2/trunk/c/include/axis2_phase_resolver.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_phase_resolver.h?view=diff&rev=447276&r1=447275&r2=447276
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_phase_resolver.h (original)
+++ webservices/axis2/trunk/c/include/axis2_phase_resolver.h Sun Sep 17 23:17:31 2006
@@ -24,15 +24,17 @@
  * @}
  */
 
-/** @defgroup axis2_phase_res phsae resolver
+/** 
+ * @defgroup axis2_phase_res phase resolver
  * @ingroup axis2_phase_resolver
- * Description.
+ * holds phase information in relation to a given service. Encapsulates a 
+ * reference to axis configuration, the service the phase resolver related to 
+ * and a phase holder instance that holds the list of phases.
  * @{
  */
 
 /**
  * @file axis2_phase_resolver.h
- * @brief Axis2 Wsdl soap op interface
  */
 
 #include <axis2_const.h>
@@ -57,6 +59,11 @@
 {
 #endif
 
+    /** Type name for axis2_phase_resolver */
+    typedef struct axis2_phase_resolver axis2_phase_resolver_t;
+    /** Type name for axis2_phase_resolver_ops */
+    typedef struct axis2_phase_resolver_ops axis2_phase_resolver_ops_t;
+
     struct axis2_phase;
     struct axis2_handler_desc;
     struct axis2_module_desc;
@@ -66,20 +73,16 @@
     struct axis2_conf;
     struct axis2_op;
     struct axis2_phase_holder;
-    /** Type name for axis2_phase_resolver */
-    typedef struct axis2_phase_resolver axis2_phase_resolver_t;
-    /** Type name for axis2_phase_resolver_ops */
-    typedef struct axis2_phase_resolver_ops axis2_phase_resolver_ops_t;
 
     /**
-     * Wsdl Phase Resolver ops struct
-     * Encapsulator struct for ops of axis2_phase_resolver
+     * phase resolver ops struct.
+     * Encapsulator struct for ops of axis2_phase_resolver.
      */
     struct axis2_phase_resolver_ops
     {
         /** 
-         * De-allocate memory
-         * @param phase_recolver pointer to phase resolver
+         * Frees phase resolver.
+         * @param phase_resolver pointer to phase resolver
          * @param env pointer to environment struct
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
@@ -89,6 +92,8 @@
                     const axis2_env_t *env);
 
         /**
+         * Builds the execution chains. Execution chains are collection of 
+         * phases that are invoked in the execution path.
          * @param phase_resolver pointer to phase resolver
          * @param env pointer to environment struct
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
@@ -99,7 +104,7 @@
                     const axis2_env_t *env);
 
         /**
-         * To build the opration for the opeartion which the module going to be added
+         * Builds execution chains for given operation.
          * @param phase_resolver pointer to phase resolver
          * @param env pointer to environment struct
          * @param op pointer to operation
@@ -112,7 +117,7 @@
                     struct axis2_op *op);
 
         /**
-         * Method buildTranspotsChains
+         * Builds transport chains.
          * @param phase_resolver pointer to phase resolver
          * @param env pointer to environment struct
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
@@ -124,6 +129,9 @@
 
 
         /**
+         * Engages the given module globally. Engaging a module globally means 
+         * that the given module would be engaged to all operations in all 
+         * services.
          * @param phase_resolver pointer to phase resolver
          * @param env pointer to environment struct
          * @param module pointer to module
@@ -136,11 +144,13 @@
                     struct axis2_module_desc *module);
 
         /**
-         * To engage modules come form global
+         * Engages the given global module to the given service. This means 
+         * the given module would be engaged to all operations of the given 
+         * service. 
          * @param phase_resolver pointer to phase resolver
          * @param env pointer to environment struct
          * @param svc pointer to service
-         * @param module_desc pointer to module descriptoin
+         * @param module_desc pointer to module description
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
         axis2_status_t (AXIS2_CALL *
@@ -151,10 +161,13 @@
                     struct axis2_module_desc *module_desc);
 
         /**
+         * Engages the given module to the given service. This means 
+         * the given module would be engaged to all operations of the given 
+         * service. 
          * @param phase_resolver pointer to phase resolver
-         * @param env pointer to environmnet struct
+         * @param env pointer to environment struct
          * @param svc pointer to service
-         * @param module_desc pointedr to module description
+         * @param module_desc pointer to module description
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
         axis2_status_t (AXIS2_CALL *
@@ -165,6 +178,7 @@
                     struct axis2_module_desc *module_desc);
 
         /**
+         * Engages the given module to the given operation.
          * @param phase_resolver pointer to phase resolver
          * @param env pointer to environment struct
          * @param axis_op pointer to axis operation
@@ -182,16 +196,16 @@
     };
 
     /**
-     * Phase Resolver struct  
+     * phase resolver struct.
      */
     struct axis2_phase_resolver
     {
-        /** Operations of phase resolver */
+        /** operations of phase resolver */
         axis2_phase_resolver_ops_t *ops;
     };
 
     /**
-     * Creates phase resolver struct
+     * Creates phase resolver struct.
      * @param env pointer to environment struct
      * @return pointer to newly created phase resolver
      */
@@ -200,9 +214,11 @@
         const axis2_env_t *env);
 
     /**
-     * default constructor , to obuild chains for GlobalDescription
+     * Creates phase resolver struct with given configuration.
      * @param env pointer to environment struct
-     * @param axis2_config pointer to aixs2 configuratoin
+     * @param axis2_config pointer to aixs2 configuration, phase resolver 
+     * created would not assume ownership of configuration
+     * @return pointer to newly created phase resolver
      */
     AXIS2_EXTERN axis2_phase_resolver_t *AXIS2_CALL
     axis2_phase_resolver_create_with_config (
@@ -210,9 +226,13 @@
         struct axis2_conf *axis2_config);
 
     /**
+     * Creates phase resolver struct with given configuration and service.
      * @param env pointer to environment struct
-     * @param aixs2_config pointer to aixs2_config
-     * @param svc pointer to service
+     * @param aixs2_config pointer to aixs2 configuration,  phase resolver 
+     * created would not assume ownership of configuration
+     * @param svc pointer to service,  phase resolver 
+     * created would not assume ownership of service
+     * @return pointer to newly created phase resolver
      */
     AXIS2_EXTERN axis2_phase_resolver_t *AXIS2_CALL
     axis2_phase_resolver_create_with_config_and_svc (
@@ -220,24 +240,22 @@
         struct axis2_conf *axis2_config,
         struct axis2_svc *svc);
 
-/*************************** Function macros **********************************/
-
-/** Frees the phase resolver.
+/** Frees phase resolver.
     @sa axis2_phase_resolver_ops#free */
 #define AXIS2_PHASE_RESOLVER_FREE(phase_resolver, env) \
       ((phase_resolver)->ops->free (phase_resolver, env))
 
-/** Build chains.
+/** Builds execution chains.
     @sa axis2_phase_resolver_ops#build_chains */
 #define AXIS2_PHASE_RESOLVER_BUILD_CHAINS(phase_resolver, env) \
       ((phase_resolver)->ops->build_chains (phase_resolver, env))
 
-/** Build module operations.
+/** Builds module operations.
     @sa axis2_phase_resolver_ops#build_module_op */
 #define AXIS2_PHASE_RESOLVER_BUILD_MODULE_OP(phase_resolver, env, op) \
       ((phase_resolver)->ops->build_module_op (phase_resolver, env, op))
 
-/** Build transport chains.
+/** Builds transport chains.
     @sa axis2_phase_resolver_ops#build_transport_chains */
 #define AXIS2_PHASE_RESOLVER_BUILD_TRANSPORT_CHAINS(phase_resolver, env) \
       ((phase_resolver)->ops->build_transport_chains (phase_resolver, env))
@@ -247,7 +265,7 @@
 #define AXIS2_PHASE_RESOLVER_ENGAGE_MODULE_GLOBALLY(phase_resolver, env, module) \
       ((phase_resolver)->ops->engage_module_globally (phase_resolver, env, module))
 
-/** Engages module to service from global.
+/** Engages module to service from global module.
     @sa axis2_phase_resolver_ops#engage_module_to_svc_from_global */
 #define AXIS2_PHASE_RESOLVER_ENGAGE_MODULE_TO_SVC_FROM_GLOBAL(phase_resolver, env, svc, module_desc) \
       ((phase_resolver)->ops->engage_module_to_svc_from_global (phase_resolver, env, svc, module_desc))
@@ -263,8 +281,7 @@
       ((phase_resolver)->ops->engage_module_to_op (phase_resolver, env, axis_op, module_desc))
 
 
-/*************************** End of function macros ***************************/
-    /** @} */
+/** @} */
 
 #ifdef __cplusplus
 }

Modified: webservices/axis2/trunk/c/modules/core/phaseresolver/phase_holder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/phaseresolver/phase_holder.c?view=diff&rev=447276&r1=447275&r2=447276
==============================================================================
--- webservices/axis2/trunk/c/modules/core/phaseresolver/phase_holder.c (original)
+++ webservices/axis2/trunk/c/modules/core/phaseresolver/phase_holder.c Sun Sep 17 23:17:31 2006
@@ -16,11 +16,6 @@
 
 #include <axis2_phase_holder.h>
 
-/**
- * @brief Wsdl phase holder struct impl
- * Phase Holder
- * This class hold all the phases found in the services.xml and server.xml
- */
 typedef struct axis2_phase_holder_impl
 {
     axis2_phase_holder_t phase_holder;
@@ -30,10 +25,8 @@
 
 #define AXIS2_INTF_TO_IMPL(phase_holder) ((axis2_phase_holder_impl_t *)phase_holder)
 
-/************************* Function prototypes ********************************/
-
 axis2_status_t AXIS2_CALL
-axis2_phase_holder_free (
+axis2_phase_holder_free(
     axis2_phase_holder_t *phase_holder,
     const axis2_env_t *env);
 
@@ -62,8 +55,6 @@
     axis2_phase_t *phase,
     axis2_array_list_t *handlers);
 
-/************************** End of function prototypes ************************/
-
 AXIS2_EXTERN axis2_phase_holder_t *AXIS2_CALL
 axis2_phase_holder_create(
     const axis2_env_t *env)
@@ -75,7 +66,7 @@
     phase_holder_impl = (axis2_phase_holder_impl_t *) AXIS2_MALLOC(env->
             allocator, sizeof(axis2_phase_holder_impl_t));
 
-    if(NULL == phase_holder_impl)
+    if (NULL == phase_holder_impl)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
@@ -85,8 +76,8 @@
     phase_holder_impl->phase_holder.ops = NULL;
 
     phase_holder_impl->phase_holder.ops =
-        AXIS2_MALLOC (env->allocator, sizeof(axis2_phase_holder_ops_t));
-    if(NULL == phase_holder_impl->phase_holder.ops)
+        AXIS2_MALLOC(env->allocator, sizeof(axis2_phase_holder_ops_t));
+    if (NULL == phase_holder_impl->phase_holder.ops)
     {
         axis2_phase_holder_free(&(phase_holder_impl->phase_holder), env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -108,7 +99,7 @@
 
 AXIS2_EXTERN axis2_phase_holder_t *AXIS2_CALL
 axis2_phase_holder_create_with_phases(
-    const axis2_env_t *env, 
+    const axis2_env_t *env,
     axis2_array_list_t *phases)
 {
     axis2_phase_holder_impl_t *phase_holder_impl = NULL;
@@ -117,17 +108,13 @@
 
     if (!phases)
         return NULL;
-    /*AXIS2_PARAM_CHECK(env->error, phases, NULL);*/
 
     phase_holder_impl = (axis2_phase_holder_impl_t *)axis2_phase_holder_create(env);
-
     phase_holder_impl->phase_list = phases;
 
     return &(phase_holder_impl->phase_holder);
 }
 
-/***************************Function implementation****************************/
-
 axis2_status_t AXIS2_CALL
 axis2_phase_holder_free(
     axis2_phase_holder_t *phase_holder,
@@ -139,19 +126,13 @@
 
     phase_holder_impl = AXIS2_INTF_TO_IMPL(phase_holder);
 
-    /*if(NULL != phase_holder_impl->phase_list)
-    {
-        AXIS2_ARRAY_LIST_FREE(phase_holder_impl->phase_list, env);
-        phase_holder_impl->phase_list = NULL;
-    }*/
-
-    if(NULL != phase_holder->ops)
+    if (NULL != phase_holder->ops)
     {
         AXIS2_FREE(env->allocator, phase_holder->ops);
         phase_holder->ops = NULL;
     }
 
-    if(phase_holder_impl)
+    if (phase_holder_impl)
     {
         AXIS2_FREE(env->allocator, phase_holder_impl);
         phase_holder_impl = NULL;
@@ -160,12 +141,6 @@
     return AXIS2_SUCCESS;
 }
 
-/**
- * Method isPhaseExist
- *
- * @param phaseName
- * @return
- */
 axis2_bool_t AXIS2_CALL
 axis2_phase_holder_is_phase_exist(
     axis2_phase_holder_t *phase_holder,
@@ -198,11 +173,6 @@
     return AXIS2_FALSE;
 }
 
-/**
- * Method addHandler
- *
- * @param handler
- */
 axis2_status_t AXIS2_CALL
 axis2_phase_holder_add_handler(
     axis2_phase_holder_t *phase_holder,
@@ -238,12 +208,6 @@
     return status;
 }
 
-/**
- * this method is used to get the actual phase object given in the phase array list
- *
- * @param phaseName
- * @return
- */
 axis2_phase_t *AXIS2_CALL
 axis2_phase_holder_get_phase(
     const axis2_phase_holder_t *phase_holder,
@@ -268,7 +232,7 @@
         phase = (axis2_phase_t *) AXIS2_ARRAY_LIST_GET(phase_holder_impl->
                 phase_list, env, i);
         phase_name_l = AXIS2_PHASE_GET_NAME(phase, env);
-        if(0 == AXIS2_STRCMP(phase_name_l, phase_name))
+        if (0 == AXIS2_STRCMP(phase_name_l, phase_name))
         {
             return phase;
         }
@@ -277,13 +241,6 @@
     return NULL;
 }
 
-/**
- * This method is to build the transport phase , here load the corresponding handlers and added them
- * in to correct phase
- *
- * @param phase
- * @param handlers
- */
 axis2_status_t AXIS2_CALL
 axis2_phase_holder_build_transport_handler_chain(
     axis2_phase_holder_t *phase_holder,
@@ -308,11 +265,11 @@
         handler_desc = (axis2_handler_desc_t *) AXIS2_ARRAY_LIST_GET(
                     handlers, env, i);
         status = AXIS2_HANDLER_INIT(handler, env, handler_desc);
-        if(AXIS2_FAILURE == status)
+        if (AXIS2_FAILURE == status)
             return status;
 
         status = AXIS2_HANDLER_DESC_SET_HANDLER(handler_desc, env, handler);
-        if(AXIS2_FAILURE == status)
+        if (AXIS2_FAILURE == status)
             return status;
 
         status = AXIS2_PHASE_ADD_HANDLER(phase, env, handler);

Modified: webservices/axis2/trunk/c/modules/core/phaseresolver/phase_resolver.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/phaseresolver/phase_resolver.c?view=diff&rev=447276&r1=447275&r2=447276
==============================================================================
--- webservices/axis2/trunk/c/modules/core/phaseresolver/phase_resolver.c (original)
+++ webservices/axis2/trunk/c/modules/core/phaseresolver/phase_resolver.c Sun Sep 17 23:17:31 2006
@@ -1,74 +1,49 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #include <axis2_phase_resolver.h>
 #include <axis2_property.h>
 
-/**
- * @brief Wsdl phase holder struct impl
- * Phase Resolver
- * This class hold all the phases found in the services.xml and server.xml
- */
 typedef struct axis2_phase_resolver_impl
 {
     axis2_phase_resolver_t phase_resolver;
-    /**
-     * Field axisConfig
-     */
+
+    /** axis2 configuration */
     axis2_conf_t *axis2_config;
 
-    /**
-     * Field axisService
-     */
+    /** service */
     axis2_svc_t *svc;
 
-    /**
-     * Field phaseHolder
-     */
+    /** phase holder */
     axis2_phase_holder_t *phase_holder;
 }
 axis2_phase_resolver_impl_t;
 
 #define AXIS2_INTF_TO_IMPL(phase_resolver) ((axis2_phase_resolver_impl_t *)phase_resolver)
 
-/************************* Function prototypes ********************************/
-
 axis2_status_t AXIS2_CALL
-   axis2_phase_resolver_free (
-        axis2_phase_resolver_t *phase_resolver,
-        const axis2_env_t *env);
+axis2_phase_resolver_free(
+    axis2_phase_resolver_t *phase_resolver,
+    const axis2_env_t *env);
 
 axis2_status_t AXIS2_CALL
-    axis2_phase_resolver_build_chains(
-       axis2_phase_resolver_t *phase_resolver,
-       const axis2_env_t *env);
+axis2_phase_resolver_build_chains(
+    axis2_phase_resolver_t *phase_resolver,
+    const axis2_env_t *env);
 
-/**
- * Opeations defined in modules are engaged in this function. This function
- * is called from axis2_svc's add_module_ops method.
- */
 axis2_status_t AXIS2_CALL
 axis2_phase_resolver_build_module_op(
     axis2_phase_resolver_t *phase_resolver,
@@ -76,14 +51,14 @@
     axis2_op_t *op);
 
 /**
- * All the engaged modules defined in axis2.xml and services.xml which are 
+ * All the engaged modules defined in axis2.xml and services.xml which are
  * engaged to operation passed as parameter. The operation passed is a new
  * operation for which no modules are yet engaged. First all engaged modules
  * in axis2_conf are retrieved and all handlers in their flows are added to
  * operation flows. These modules are added to services and operations engaged
- * module list. Then all handlers from services flows are retreived and
+ * module list. Then all handlers from services flows are retrieved and
  * added to operation flows.
- * Type varible is used to differenciate chains
+ * Type variable is used to differentiate chains
  * type = 1 inflow
  * type = 2 out flow
  * type = 3 fault in flow
@@ -107,36 +82,18 @@
     const axis2_env_t *env,
     axis2_transport_in_desc_t *transport);
 
-/**
- *
- * @param transport
- */
 static axis2_status_t
 axis2_phase_resolver_build_out_transport_chains(
     axis2_phase_resolver_t *phase_resolver,
     const axis2_env_t *env,
     axis2_transport_out_desc_t *transport);
 
-/**
- * First module is engaged to global chain(phase list in the axis2 configuration).
- * Then for each service in each service group of configuration the module 
- * operations are added. Also for each service in service group the module is 
- * engaged. Module is added to each services engaged module list. 
- * module qname is added to for each service group.
- */
 axis2_status_t AXIS2_CALL
 axis2_phase_resolver_engage_module_globally(
     axis2_phase_resolver_t *phase_resolver,
     const axis2_env_t *env,
     axis2_module_desc_t *module);
 
-/**
- * For each operation in the service module is engaged. First for each
- * operation, retrieve it's already engaged modules and check whether
- * this module is already engaged. Handlers from module_desc's flows are 
- * added to operation flows. Module_desc is added to each operations
- * engaged module list.
- */
 axis2_status_t AXIS2_CALL
 axis2_phase_resolver_engage_module_to_svc_from_global(
     axis2_phase_resolver_t *phase_resolver,
@@ -164,20 +121,18 @@
     axis2_op_t *axis_op,
     axis2_module_desc_t *module_desc);
 
-/************************** End of function prototypes ************************/
-
 AXIS2_EXTERN axis2_phase_resolver_t *AXIS2_CALL
 axis2_phase_resolver_create(
     const axis2_env_t *env)
 {
     axis2_phase_resolver_impl_t *resolver_impl = NULL;
-    
-   AXIS2_ENV_CHECK(env, NULL);
-   
-   resolver_impl = (axis2_phase_resolver_impl_t *) AXIS2_MALLOC(env->allocator,
-         sizeof(axis2_phase_resolver_impl_t));
-    
-    if(NULL == resolver_impl)
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    resolver_impl = (axis2_phase_resolver_impl_t *) AXIS2_MALLOC(env->allocator,
+            sizeof(axis2_phase_resolver_impl_t));
+
+    if (NULL == resolver_impl)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
@@ -187,43 +142,43 @@
     resolver_impl->axis2_config = NULL;
     resolver_impl->svc = NULL;
     resolver_impl->phase_holder = NULL;
-    
-   
-    
-    resolver_impl->phase_resolver.ops = 
-        AXIS2_MALLOC (env->allocator, sizeof(axis2_phase_resolver_ops_t));
-    if(NULL == resolver_impl->phase_resolver.ops)
+
+
+
+    resolver_impl->phase_resolver.ops =
+        AXIS2_MALLOC(env->allocator, sizeof(axis2_phase_resolver_ops_t));
+    if (NULL == resolver_impl->phase_resolver.ops)
     {
         axis2_phase_resolver_free(&(resolver_impl->phase_resolver), env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
-    
+
     resolver_impl->phase_resolver.ops->free =  axis2_phase_resolver_free;
-   
-    resolver_impl->phase_resolver.ops->build_chains = 
+
+    resolver_impl->phase_resolver.ops->build_chains =
         axis2_phase_resolver_build_chains;
-    
-    resolver_impl->phase_resolver.ops->build_module_op = 
+
+    resolver_impl->phase_resolver.ops->build_module_op =
         axis2_phase_resolver_build_module_op;
-    
-    resolver_impl->phase_resolver.ops->build_transport_chains =     
+
+    resolver_impl->phase_resolver.ops->build_transport_chains =
         axis2_phase_resolver_build_transport_chains;
-    
-    resolver_impl->phase_resolver.ops->engage_module_globally = 
+
+    resolver_impl->phase_resolver.ops->engage_module_globally =
         axis2_phase_resolver_engage_module_globally;
-        
-    resolver_impl->phase_resolver.ops->engage_module_to_svc_from_global = 
+
+    resolver_impl->phase_resolver.ops->engage_module_to_svc_from_global =
         axis2_phase_resolver_engage_module_to_svc_from_global;
-        
-    resolver_impl->phase_resolver.ops->engage_module_to_svc = 
+
+    resolver_impl->phase_resolver.ops->engage_module_to_svc =
         axis2_phase_resolver_engage_module_to_svc;
-        
-    resolver_impl->phase_resolver.ops->engage_module_to_op = 
+
+    resolver_impl->phase_resolver.ops->engage_module_to_op =
         axis2_phase_resolver_engage_module_to_op;
-    
-  
-   return &(resolver_impl->phase_resolver);
+
+
+    return &(resolver_impl->phase_resolver);
 }
 
 AXIS2_EXTERN axis2_phase_resolver_t *AXIS2_CALL
@@ -258,21 +213,19 @@
     resolver_impl = (axis2_phase_resolver_impl_t *)
             axis2_phase_resolver_create(env);
 
-    if(!resolver_impl)
+    if (!resolver_impl)
     {
         return NULL;
     }
     resolver_impl->axis2_config = axis2_config;
 
     resolver_impl->svc = svc;
-    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "svc name is:%s", 
-        AXIS2_SVC_GET_NAME(resolver_impl->svc, env));
+    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "svc name is:%s",
+            AXIS2_SVC_GET_NAME(resolver_impl->svc, env));
 
     return &(resolver_impl->phase_resolver);
 }
 
-/***************************Function implementation****************************/
-
 axis2_status_t AXIS2_CALL
 axis2_phase_resolver_free(
     axis2_phase_resolver_t *phase_resolver,
@@ -288,19 +241,19 @@
 
     resolver_impl->svc = NULL;
 
-    if(resolver_impl->phase_holder)
+    if (resolver_impl->phase_holder)
     {
         AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
         resolver_impl->phase_holder = NULL;
     }
 
-    if(phase_resolver->ops)
+    if (phase_resolver->ops)
     {
         AXIS2_FREE(env->allocator, phase_resolver->ops);
         phase_resolver->ops = NULL;
     }
 
-    if(resolver_impl)
+    if (resolver_impl)
     {
         AXIS2_FREE(env->allocator, resolver_impl);
         resolver_impl = NULL;
@@ -327,17 +280,17 @@
 
     ops = AXIS2_SVC_GET_ALL_OPS(resolver_impl->svc, env);
 
-    for (index_i = axis2_hash_first (ops, env); index_i; index_i =
-                axis2_hash_next (env, index_i))
+    for (index_i = axis2_hash_first(ops, env); index_i; index_i =
+                axis2_hash_next(env, index_i))
     {
         void *v = NULL;
         int j = 0;
-        axis2_hash_this (index_i, NULL, NULL, &v);
+        axis2_hash_this(index_i, NULL, NULL, &v);
         op = (axis2_op_t *)v;
-        for(j = 1; j < 5; j++)
+        for (j = 1; j < 5; j++)
         {
             status = axis2_phase_resolver_build_execution_chains(phase_resolver,
-                    env, j, op );
+                    env, j, op);
         }
     }
 
@@ -353,18 +306,18 @@
     axis2_phase_resolver_impl_t *resolver_impl = NULL;
     int i = 0;
     axis2_status_t status = AXIS2_FAILURE;
-    
+
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, op, AXIS2_FAILURE);
     resolver_impl = AXIS2_INTF_TO_IMPL(phase_resolver);
-    
-   
-    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "op name is:%s", 
-        AXIS2_QNAME_GET_LOCALPART(AXIS2_OP_GET_QNAME(op, env), 
-            env));
-    for (i = 1; i < 5; i++) 
+
+
+    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "op name is:%s",
+            AXIS2_QNAME_GET_LOCALPART(AXIS2_OP_GET_QNAME(op, env),
+                    env));
+    for (i = 1; i < 5; i++)
     {
-        status = axis2_phase_resolver_build_execution_chains(phase_resolver, 
+        status = axis2_phase_resolver_build_execution_chains(phase_resolver,
                 env, i, op);
     }
     return status;
@@ -388,16 +341,14 @@
 
     resolver_impl = AXIS2_INTF_TO_IMPL(phase_resolver);
 
-    /**************************************************************************/
-    /********************* Handlers from   axis2.xml from modules *************/
-    /**************************************************************************/
+    /* engage handlers from axis2.xml from modules */
 
     moduleqnames = AXIS2_CONF_GET_ALL_ENGAGED_MODULES(
                 resolver_impl->axis2_config, env);
 
     size = AXIS2_ARRAY_LIST_SIZE(moduleqnames, env);
     status = AXIS2_ERROR_GET_STATUS_CODE(env->error);
-    if(AXIS2_SUCCESS != status)
+    if (AXIS2_SUCCESS != status)
     {
         return status;
     }
@@ -406,46 +357,46 @@
     {
         axis2_qname_t *modulename = NULL;
         axis2_module_desc_t *module_desc = NULL;
-            
-        modulename = (axis2_qname_t *) AXIS2_ARRAY_LIST_GET(moduleqnames, env, 
-            i);
-        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "module name is:%s", 
+
+        modulename = (axis2_qname_t *) AXIS2_ARRAY_LIST_GET(moduleqnames, env,
+                i);
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "module name is:%s",
                 AXIS2_QNAME_GET_LOCALPART(modulename, env));
-        module_desc = AXIS2_CONF_GET_MODULE(resolver_impl->axis2_config, env, 
-            modulename);
-        if (NULL != module_desc) 
+        module_desc = AXIS2_CONF_GET_MODULE(resolver_impl->axis2_config, env,
+                modulename);
+        if (NULL != module_desc)
         {
             switch (type)
             {
-            case AXIS2_IN_FLOW:
-            {
-                flow = AXIS2_MODULE_DESC_GET_IN_FLOW(module_desc, env);
-                break;
-            }
-            case AXIS2_OUT_FLOW:
-            {
-                flow = AXIS2_MODULE_DESC_GET_OUT_FLOW(module_desc, env);
-                break;
-            }
-            case AXIS2_FAULT_IN_FLOW:
-            {
-                flow = AXIS2_MODULE_DESC_GET_FAULT_IN_FLOW(module_desc, env);
-                break;
-            }
-            case AXIS2_FAULT_OUT_FLOW:
-            {
-                flow = AXIS2_MODULE_DESC_GET_FAULT_OUT_FLOW(module_desc, env);
-                break;
-            }
+                case AXIS2_IN_FLOW:
+                {
+                    flow = AXIS2_MODULE_DESC_GET_IN_FLOW(module_desc, env);
+                    break;
+                }
+                case AXIS2_OUT_FLOW:
+                {
+                    flow = AXIS2_MODULE_DESC_GET_OUT_FLOW(module_desc, env);
+                    break;
+                }
+                case AXIS2_FAULT_IN_FLOW:
+                {
+                    flow = AXIS2_MODULE_DESC_GET_FAULT_IN_FLOW(module_desc, env);
+                    break;
+                }
+                case AXIS2_FAULT_OUT_FLOW:
+                {
+                    flow = AXIS2_MODULE_DESC_GET_FAULT_OUT_FLOW(module_desc, env);
+                    break;
+                }
             }
             status = AXIS2_SVC_ADD_TO_ENGAGED_MODULE_LIST(resolver_impl->svc,
                     env, module_desc);
-            if(AXIS2_SUCCESS != status)
+            if (AXIS2_SUCCESS != status)
             {
                 return status;
             }
             status = AXIS2_OP_ADD_TO_ENGAGED_MODULE_LIST(op, env, module_desc);
-            if(AXIS2_SUCCESS != status)
+            if (AXIS2_SUCCESS != status)
             {
                 return status;
             }
@@ -464,17 +415,12 @@
             int j = 0;
             int count = 0;
             count = AXIS2_FLOW_GET_HANDLER_COUNT(flow, env);
-            if(AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE(env->error))
+            if (AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE(env->error))
             {
                 return AXIS2_ERROR_GET_STATUS_CODE(env->error);
             }
 
 
-            /*if(!all_handlers)
-            {
-                return AXIS2_FAILURE;
-            }*/
-
             for (j = 0; j < count; j++)
             {
                 axis2_handler_desc_t *metadata = NULL;
@@ -484,7 +430,7 @@
                 metadata = AXIS2_FLOW_GET_HANDLER(flow, env, j);
                 phase_rule = AXIS2_HANDLER_DESC_GET_RULES(metadata, env);
                 phase_name = AXIS2_PHASE_RULE_GET_NAME(phase_rule, env);
-                if(NULL == phase_name)
+                if (NULL == phase_name)
                 {
                     return AXIS2_FAILURE;
                 }
@@ -493,16 +439,16 @@
                         (0 != AXIS2_STRCMP(AXIS2_PHASE_POST_DISPATCH, phase_name)) &&
                         (0 != AXIS2_STRCMP(AXIS2_PHASE_PRE_DISPATCH, phase_name)))
                 {
-                    if(!all_handlers)
+                    if (!all_handlers)
                     {
                         all_handlers = axis2_array_list_create(env, 0);
-                        if(!all_handlers)
+                        if (!all_handlers)
                             return AXIS2_FAILURE;
                     }
                     status = AXIS2_ARRAY_LIST_ADD(all_handlers, env, metadata);
-                    if(AXIS2_SUCCESS != status)
+                    if (AXIS2_SUCCESS != status)
                     {
-                        if(all_handlers)
+                        if (all_handlers)
                         {
                             AXIS2_ARRAY_LIST_FREE(all_handlers, env);
                             all_handlers = NULL;
@@ -523,50 +469,48 @@
     }
 
 
-    /**************************************************************************/
-    /************************** SERVICE HANDLERS ******************************/
-    /**************************************************************************/
+    /* process handlers form service.xml */
     flow = NULL;
     switch (type)
     {
 
-    case AXIS2_IN_FLOW:
-    {
+        case AXIS2_IN_FLOW:
+        {
 
-        property = (axis2_property_t *)
-                AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(resolver_impl->
-                        svc->wsdl_svc->wsdl_component, env, AXIS2_IN_FLOW_KEY);
-        if(property)
-            flow = (axis2_flow_t *) AXIS2_PROPERTY_GET_VALUE(property, env);
-        break;
-    }
-    case AXIS2_OUT_FLOW:
-    {
-        property = (axis2_property_t *)
-                AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(resolver_impl->
-                        svc->wsdl_svc->wsdl_component, env, AXIS2_OUT_FLOW_KEY);
-        if(property)
-            flow = (axis2_flow_t *) AXIS2_PROPERTY_GET_VALUE(property, env);
-        break;
-    }
-    case AXIS2_FAULT_IN_FLOW:
-    {
-        property = (axis2_property_t *)
-                AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(resolver_impl->
-                        svc->wsdl_svc->wsdl_component, env, AXIS2_IN_FAULTFLOW_KEY);
-        if(property)
-            flow = (axis2_flow_t *) AXIS2_PROPERTY_GET_VALUE(property, env);
-        break;
-    }
-    case AXIS2_FAULT_OUT_FLOW:
-    {
-        property = (axis2_property_t *)
-                AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(resolver_impl->
-                        svc->wsdl_svc->wsdl_component, env, AXIS2_OUT_FAULTFLOW_KEY);
-        if(property)
-            flow = (axis2_flow_t *) AXIS2_PROPERTY_GET_VALUE(property, env);
-        break;
-    }
+            property = (axis2_property_t *)
+                    AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(resolver_impl->
+                            svc->wsdl_svc->wsdl_component, env, AXIS2_IN_FLOW_KEY);
+            if (property)
+                flow = (axis2_flow_t *) AXIS2_PROPERTY_GET_VALUE(property, env);
+            break;
+        }
+        case AXIS2_OUT_FLOW:
+        {
+            property = (axis2_property_t *)
+                    AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(resolver_impl->
+                            svc->wsdl_svc->wsdl_component, env, AXIS2_OUT_FLOW_KEY);
+            if (property)
+                flow = (axis2_flow_t *) AXIS2_PROPERTY_GET_VALUE(property, env);
+            break;
+        }
+        case AXIS2_FAULT_IN_FLOW:
+        {
+            property = (axis2_property_t *)
+                    AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(resolver_impl->
+                            svc->wsdl_svc->wsdl_component, env, AXIS2_IN_FAULTFLOW_KEY);
+            if (property)
+                flow = (axis2_flow_t *) AXIS2_PROPERTY_GET_VALUE(property, env);
+            break;
+        }
+        case AXIS2_FAULT_OUT_FLOW:
+        {
+            property = (axis2_property_t *)
+                    AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(resolver_impl->
+                            svc->wsdl_svc->wsdl_component, env, AXIS2_OUT_FAULTFLOW_KEY);
+            if (property)
+                flow = (axis2_flow_t *) AXIS2_PROPERTY_GET_VALUE(property, env);
+            break;
+        }
     }
 
     if (NULL != flow)
@@ -575,9 +519,9 @@
         int count = 0;
         count = AXIS2_FLOW_GET_HANDLER_COUNT(flow, env);
 
-        if(AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE(env->error))
+        if (AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE(env->error))
         {
-            if(all_handlers)
+            if (all_handlers)
             {
                 AXIS2_ARRAY_LIST_FREE(all_handlers, env);
                 all_handlers = NULL;
@@ -592,13 +536,13 @@
 
             metadata = AXIS2_FLOW_GET_HANDLER(flow, env, j);
             phase_rule = AXIS2_HANDLER_DESC_GET_RULES(metadata, env);
-            if(phase_rule)
+            if (phase_rule)
             {
                 phase_name = AXIS2_PHASE_RULE_GET_NAME(phase_rule, env);
             }
 
-            /* TODO change this in properway */
-            if(!phase_name || (0 == AXIS2_STRCMP(phase_name, "")))
+            /* TODO change this in proper way */
+            if (!phase_name || (0 == AXIS2_STRCMP(phase_name, "")))
             {
                 AXIS2_ERROR_SET(env->error, AXIS2_ERROR_PHASE_IS_NOT_SPECIFED,
                         AXIS2_FAILURE);
@@ -610,7 +554,7 @@
                     (0 == AXIS2_STRCMP(AXIS2_PHASE_POST_DISPATCH, phase_name)) ||
                     (0 == AXIS2_STRCMP(AXIS2_PHASE_PRE_DISPATCH, phase_name)))
             {
-                if(all_handlers)
+                if (all_handlers)
                 {
                     AXIS2_ARRAY_LIST_FREE(all_handlers, env);
                     all_handlers = NULL;
@@ -622,23 +566,23 @@
             }
             else
             {
-                if(!all_handlers)
+                if (!all_handlers)
                 {
                     all_handlers = axis2_array_list_create(env, 0);
-                    if(!all_handlers)
+                    if (!all_handlers)
                         return AXIS2_FAILURE;
                 }
 
                 status = AXIS2_ARRAY_LIST_ADD(all_handlers, env, metadata);
 
-                if(AXIS2_SUCCESS != status)
+                if (AXIS2_SUCCESS != status)
                 {
-                    if(all_handlers)
+                    if (all_handlers)
                     {
                         int size = 0;
                         int i = 0;
                         size = AXIS2_ARRAY_LIST_SIZE(all_handlers, env);
-                        for(i = 0; i < size; i++)
+                        for (i = 0; i < size; i++)
                         {
                             axis2_handler_desc_t *handler_desc = NULL;
 
@@ -661,60 +605,53 @@
         return AXIS2_SUCCESS;
     }
 
-    if(resolver_impl->phase_holder)
+    if (resolver_impl->phase_holder)
     {
         AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
     }
 
     switch (type)
     {
-    case AXIS2_IN_FLOW:
-    {
-        axis2_array_list_t *phase_list = NULL;
+        case AXIS2_IN_FLOW:
+        {
+            axis2_array_list_t *phase_list = NULL;
 
-        phase_list = AXIS2_OP_GET_IN_FLOW(op, env);
-        resolver_impl->phase_holder =
-            axis2_phase_holder_create_with_phases(env, phase_list);
-        break;
-    }
-    case AXIS2_OUT_FLOW:
-    {
-        axis2_array_list_t *phase_list = NULL;
+            phase_list = AXIS2_OP_GET_IN_FLOW(op, env);
+            resolver_impl->phase_holder =
+                axis2_phase_holder_create_with_phases(env, phase_list);
+            break;
+        }
+        case AXIS2_OUT_FLOW:
+        {
+            axis2_array_list_t *phase_list = NULL;
 
-        phase_list = AXIS2_OP_GET_OUT_FLOW(op, env);
-        resolver_impl->phase_holder =
-            axis2_phase_holder_create_with_phases(env, phase_list);
-        break;
-    }
-    case AXIS2_FAULT_IN_FLOW:
-    {
-        axis2_array_list_t *phase_list = NULL;
+            phase_list = AXIS2_OP_GET_OUT_FLOW(op, env);
+            resolver_impl->phase_holder =
+                axis2_phase_holder_create_with_phases(env, phase_list);
+            break;
+        }
+        case AXIS2_FAULT_IN_FLOW:
+        {
+            axis2_array_list_t *phase_list = NULL;
 
-        phase_list = AXIS2_OP_GET_FAULT_IN_FLOW(op, env);
-        resolver_impl->phase_holder =
-            axis2_phase_holder_create_with_phases(env, phase_list);
-        break;
-    }
-    case AXIS2_FAULT_OUT_FLOW:
-    {
-        axis2_array_list_t *phase_list = NULL;
+            phase_list = AXIS2_OP_GET_FAULT_IN_FLOW(op, env);
+            resolver_impl->phase_holder =
+                axis2_phase_holder_create_with_phases(env, phase_list);
+            break;
+        }
+        case AXIS2_FAULT_OUT_FLOW:
+        {
+            axis2_array_list_t *phase_list = NULL;
 
-        phase_list = AXIS2_OP_GET_FAULT_OUT_FLOW(op, env);
-        resolver_impl->phase_holder =
-            axis2_phase_holder_create_with_phases(env, phase_list);
-        break;
-    }
-    }
-    /* TODO There is no point of having this code. If no flows, it should
-     * not come here. It should have returned when flows are null
-    if(!all_handlers)
-    {
-        return AXIS2_SUCCESS;
+            phase_list = AXIS2_OP_GET_FAULT_OUT_FLOW(op, env);
+            resolver_impl->phase_holder =
+                axis2_phase_holder_create_with_phases(env, phase_list);
+            break;
+        }
     }
-    */
 
     size = AXIS2_ARRAY_LIST_SIZE(all_handlers, env);
-    if(AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE(env->error))
+    if (AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE(env->error))
     {
         return AXIS2_ERROR_GET_STATUS_CODE(env->error);
     }
@@ -733,7 +670,7 @@
     }
 
     /* Free the locally created all_handlers list */
-    if(all_handlers)
+    if (all_handlers)
         AXIS2_ARRAY_LIST_FREE(all_handlers, env);
 
     return status;
@@ -758,7 +695,7 @@
 
     transports_in = AXIS2_CONF_GET_ALL_IN_TRANSPORTS(resolver_impl->axis2_config,
             env);
-    if(!transports_in)
+    if (!transports_in)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_TRANSPORT_IN_CONFIGURED,
                 AXIS2_FAILURE);
@@ -767,36 +704,36 @@
 
     transports_out = AXIS2_CONF_GET_ALL_OUT_TRANSPORTS(resolver_impl->axis2_config,
             env);
-    if(!transports_out)
+    if (!transports_out)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_TRANSPORT_OUT_CONFIGURED,
                 AXIS2_FAILURE);
         return AXIS2_SUCCESS;
     }
 
-    for (index_i = axis2_hash_first (transports_in, env); index_i; index_i =
-                axis2_hash_next (env, index_i))
+    for (index_i = axis2_hash_first(transports_in, env); index_i; index_i =
+                axis2_hash_next(env, index_i))
     {
 
-        axis2_hash_this (index_i, NULL, NULL, &v);
+        axis2_hash_this(index_i, NULL, NULL, &v);
         transport_in = (axis2_transport_in_desc_t *) v;
         status = axis2_phase_resolver_build_in_transport_chains(phase_resolver,
                 env, transport_in);
-        if(AXIS2_SUCCESS != status)
+        if (AXIS2_SUCCESS != status)
         {
             return status;
         }
     }
 
-    for (index_i = axis2_hash_first (transports_out, env); index_i; index_i =
-                axis2_hash_next (env, index_i))
+    for (index_i = axis2_hash_first(transports_out, env); index_i; index_i =
+                axis2_hash_next(env, index_i))
     {
 
-        axis2_hash_this (index_i, NULL, NULL, &v);
+        axis2_hash_this(index_i, NULL, NULL, &v);
         transport_out = (axis2_transport_out_desc_t *) v;
         status = axis2_phase_resolver_build_out_transport_chains(phase_resolver,
                 env, transport_out);
-        if(AXIS2_SUCCESS != status)
+        if (AXIS2_SUCCESS != status)
         {
             return status;
         }
@@ -831,18 +768,18 @@
 
         switch (type)
         {
-        case AXIS2_IN_FLOW:
-        {
-            flow = AXIS2_TRANSPORT_IN_DESC_GET_IN_FLOW(transport, env);
-            phase = AXIS2_TRANSPORT_IN_DESC_GET_IN_PHASE(transport, env);
-            break;
-        }
-        case AXIS2_FAULT_IN_FLOW:
-        {
-            flow = AXIS2_TRANSPORT_IN_DESC_GET_FAULT_IN_FLOW(transport, env);
-            phase = AXIS2_TRANSPORT_IN_DESC_GET_FAULT_PHASE(transport, env);
-            break;
-        }
+            case AXIS2_IN_FLOW:
+            {
+                flow = AXIS2_TRANSPORT_IN_DESC_GET_IN_FLOW(transport, env);
+                phase = AXIS2_TRANSPORT_IN_DESC_GET_IN_PHASE(transport, env);
+                break;
+            }
+            case AXIS2_FAULT_IN_FLOW:
+            {
+                flow = AXIS2_TRANSPORT_IN_DESC_GET_FAULT_IN_FLOW(transport, env);
+                phase = AXIS2_TRANSPORT_IN_DESC_GET_FAULT_PHASE(transport, env);
+                break;
+            }
         }
         if (NULL != flow)
         {
@@ -858,21 +795,21 @@
 
                 metadata = AXIS2_FLOW_GET_HANDLER(flow, env, j);
                 rule = AXIS2_HANDLER_DESC_GET_RULES(metadata, env);
-                if(rule)
+                if (rule)
                 {
                     status = AXIS2_PHASE_RULE_SET_NAME(rule, env,
                             AXIS2_TRANSPORT_PHASE);
                 }
-                if(AXIS2_SUCCESS != status)
+                if (AXIS2_SUCCESS != status)
                 {
-                    if(handlers)
+                    if (handlers)
                     {
                         axis2_handler_desc_t *handler_d = NULL;
                         int i = 0;
                         int size = 0;
 
                         size = AXIS2_ARRAY_LIST_SIZE(handlers, env);
-                        for(i = 0; i < size; i++)
+                        for (i = 0; i < size; i++)
                         {
                             handler_d = AXIS2_ARRAY_LIST_GET(handlers, env, i);
                             AXIS2_HANDLER_DESC_FREE(handler_d, env);
@@ -882,16 +819,16 @@
                     return status;
                 }
                 status = AXIS2_ARRAY_LIST_ADD(handlers, env, metadata);
-                if(AXIS2_SUCCESS != status)
+                if (AXIS2_SUCCESS != status)
                 {
-                    if(handlers)
+                    if (handlers)
                     {
                         axis2_handler_desc_t *handler_d = NULL;
                         int i = 0;
                         int size = 0;
 
                         size = AXIS2_ARRAY_LIST_SIZE(handlers, env);
-                        for(i = 0; i < size; i++)
+                        for (i = 0; i < size; i++)
                         {
                             handler_d = AXIS2_ARRAY_LIST_GET(handlers, env, i);
                             AXIS2_HANDLER_DESC_FREE(handler_d, env);
@@ -902,16 +839,16 @@
                 }
             }
             phase_holder = axis2_phase_holder_create(env);
-            if(NULL == phase_holder)
+            if (NULL == phase_holder)
             {
-                if(handlers)
+                if (handlers)
                 {
                     axis2_handler_desc_t *handler_d = NULL;
                     int i = 0;
                     int size = 0;
 
                     size = AXIS2_ARRAY_LIST_SIZE(handlers, env);
-                    for(i = 0; i < size; i++)
+                    for (i = 0; i < size; i++)
                     {
                         handler_d = AXIS2_ARRAY_LIST_GET(handlers, env, i);
                         AXIS2_HANDLER_DESC_FREE(handler_d, env);
@@ -925,7 +862,7 @@
 
             status = AXIS2_PHASE_HOLDER_BUILD_TRANSPORT_HANDLER_CHAIN(
                         phase_holder, env, phase, handlers);
-            if(phase_holder)
+            if (phase_holder)
             {
                 AXIS2_PHASE_HOLDER_FREE(phase_holder, env);
             }
@@ -935,7 +872,7 @@
             /* Do nothing */
         }
     }
-    if(handlers)
+    if (handlers)
     {
         AXIS2_ARRAY_LIST_FREE(handlers, env);
     }
@@ -961,18 +898,18 @@
 
         switch (type)
         {
-        case AXIS2_OUT_FLOW:
-        {
-            flow = AXIS2_TRANSPORT_OUT_DESC_GET_OUT_FLOW(transport, env);
-            phase = AXIS2_TRANSPORT_OUT_DESC_GET_OUT_PHASE(transport, env);
-            break;
-        }
-        case AXIS2_FAULT_OUT_FLOW:
-        {
-            flow = AXIS2_TRANSPORT_OUT_DESC_GET_FAULT_OUT_FLOW(transport, env);
-            phase = AXIS2_TRANSPORT_OUT_DESC_GET_FAULT_PHASE(transport, env);
-            break;
-        }
+            case AXIS2_OUT_FLOW:
+            {
+                flow = AXIS2_TRANSPORT_OUT_DESC_GET_OUT_FLOW(transport, env);
+                phase = AXIS2_TRANSPORT_OUT_DESC_GET_OUT_PHASE(transport, env);
+                break;
+            }
+            case AXIS2_FAULT_OUT_FLOW:
+            {
+                flow = AXIS2_TRANSPORT_OUT_DESC_GET_FAULT_OUT_FLOW(transport, env);
+                phase = AXIS2_TRANSPORT_OUT_DESC_GET_FAULT_PHASE(transport, env);
+                break;
+            }
         }
 
         if (NULL != flow)
@@ -981,7 +918,7 @@
             int hndlr_count = 0;
             int j = 0;
             hndlr_count = AXIS2_FLOW_GET_HANDLER_COUNT(flow, env);
-            if(AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE(env->error))
+            if (AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE(env->error))
             {
                 return AXIS2_ERROR_GET_STATUS_CODE(env->error);
             }
@@ -996,21 +933,21 @@
 
 
                 rule = AXIS2_HANDLER_DESC_GET_RULES(metadata, env);
-                if(rule)
+                if (rule)
                 {
                     status = AXIS2_PHASE_RULE_SET_NAME(rule, env,
                             AXIS2_TRANSPORT_PHASE);
                 }
-                if(AXIS2_SUCCESS != status)
+                if (AXIS2_SUCCESS != status)
                 {
-                    if(handlers)
+                    if (handlers)
                     {
                         axis2_handler_desc_t *handler_d = NULL;
                         int i = 0;
                         int size = 0;
 
                         size = AXIS2_ARRAY_LIST_SIZE(handlers, env);
-                        for(i = 0; i < size; i++)
+                        for (i = 0; i < size; i++)
                         {
                             handler_d = AXIS2_ARRAY_LIST_GET(handlers, env, i);
                             AXIS2_HANDLER_DESC_FREE(handler_d, env);
@@ -1021,16 +958,16 @@
                 }
 
                 status = AXIS2_ARRAY_LIST_ADD(handlers, env, metadata);
-                if(AXIS2_FAILURE == status)
+                if (AXIS2_FAILURE == status)
                 {
-                    if(handlers)
+                    if (handlers)
                     {
                         axis2_handler_desc_t *handler_d = NULL;
                         int i = 0;
                         int size = 0;
 
                         size = AXIS2_ARRAY_LIST_SIZE(handlers, env);
-                        for(i = 0; i < size; i++)
+                        for (i = 0; i < size; i++)
                         {
                             handler_d = AXIS2_ARRAY_LIST_GET(handlers, env, i);
                             AXIS2_HANDLER_DESC_FREE(handler_d, env);
@@ -1041,16 +978,16 @@
                 }
             }
             phase_holder = axis2_phase_holder_create(env);
-            if(NULL == phase_holder)
+            if (NULL == phase_holder)
             {
-                if(handlers)
+                if (handlers)
                 {
                     axis2_handler_desc_t *handler_d = NULL;
                     int i = 0;
                     int size = 0;
 
                     size = AXIS2_ARRAY_LIST_SIZE(handlers, env);
-                    for(i = 0; i < size; i++)
+                    for (i = 0; i < size; i++)
                     {
                         handler_d = AXIS2_ARRAY_LIST_GET(handlers, env, i);
                         AXIS2_HANDLER_DESC_FREE(handler_d, env);
@@ -1063,7 +1000,7 @@
 
             status = AXIS2_PHASE_HOLDER_BUILD_TRANSPORT_HANDLER_CHAIN(
                         phase_holder, env, phase, handlers);
-            if(phase_holder)
+            if (phase_holder)
                 AXIS2_PHASE_HOLDER_FREE(phase_holder, env);
         }
         else
@@ -1071,7 +1008,7 @@
             /* Do nothing */
         }
     }
-    if(handlers)
+    if (handlers)
         AXIS2_ARRAY_LIST_FREE(handlers, env);
     return status;
 }
@@ -1093,17 +1030,17 @@
 
     status = axis2_phase_resolver_engage_to_global_chain(phase_resolver, env,
             module_desc);
-    if(AXIS2_SUCCESS != status)
+    if (AXIS2_SUCCESS != status)
     {
         return status;
     }
     svc_grps = AXIS2_CONF_GET_ALL_SVC_GRPS(resolver_impl->axis2_config, env);
-    if(!svc_grps)
+    if (!svc_grps)
     {
         return AXIS2_FAILURE;
     }
-    for(index_i = axis2_hash_first (svc_grps, env); index_i; index_i =
-                axis2_hash_next (env, index_i))
+    for (index_i = axis2_hash_first(svc_grps, env); index_i; index_i =
+                axis2_hash_next(env, index_i))
     {
         axis2_hash_t *svcs = NULL;
         axis2_svc_grp_t *svc_grp = NULL;
@@ -1111,37 +1048,37 @@
         axis2_hash_index_t *index_j = NULL;
         const axis2_qname_t *mod_name = NULL;
 
-        axis2_hash_this (index_i, NULL, NULL, &v);
+        axis2_hash_this(index_i, NULL, NULL, &v);
         svc_grp = (axis2_svc_grp_t *) v;
         svcs = AXIS2_SVC_GRP_GET_ALL_SVCS(svc_grp, env);
 
-        for(index_j = axis2_hash_first (svcs, env); index_j; index_j =
-                    axis2_hash_next (env, index_j))
+        for (index_j = axis2_hash_first(svcs, env); index_j; index_j =
+                    axis2_hash_next(env, index_j))
         {
             axis2_svc_t *svc = NULL;
             void *w = NULL;
 
-            axis2_hash_this (index_j, NULL, NULL, &w);
+            axis2_hash_this(index_j, NULL, NULL, &w);
             svc = (axis2_svc_t *) w;
-            AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "svc name is:%s", 
-                AXIS2_SVC_GET_NAME(svc, env));
-                
-            status = AXIS2_SVC_ADD_MODULE_OPS(svc, env, module_desc, 
-                resolver_impl->axis2_config);
-            if(AXIS2_SUCCESS != status)
+            AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "svc name is:%s",
+                    AXIS2_SVC_GET_NAME(svc, env));
+
+            status = AXIS2_SVC_ADD_MODULE_OPS(svc, env, module_desc,
+                    resolver_impl->axis2_config);
+            if (AXIS2_SUCCESS != status)
             {
                 return status;
             }
             status = axis2_phase_resolver_engage_module_to_svc_from_global(
                         phase_resolver, env, svc, module_desc);
 
-            if(AXIS2_SUCCESS != status)
+            if (AXIS2_SUCCESS != status)
             {
                 return status;
             }
 
             status = AXIS2_SVC_ADD_TO_ENGAGED_MODULE_LIST(svc, env, module_desc);
-            if(AXIS2_SUCCESS != status)
+            if (AXIS2_SUCCESS != status)
             {
                 return status;
             }
@@ -1150,7 +1087,7 @@
         status = AXIS2_SVC_GRP_ADD_MODULE_QNAME(svc_grp, env,
                 mod_name);
 
-        if(AXIS2_SUCCESS != status)
+        if (AXIS2_SUCCESS != status)
         {
             return status;
         }
@@ -1183,8 +1120,8 @@
         return AXIS2_FAILURE;
     }
 
-    for (index_i = axis2_hash_first (ops, env); index_i;
-            index_i = axis2_hash_next (env, index_i))
+    for (index_i = axis2_hash_first(ops, env); index_i;
+            index_i = axis2_hash_next(env, index_i))
     {
         void *v = NULL;
         axis2_op_t *op_desc = NULL;
@@ -1194,15 +1131,15 @@
         const axis2_qname_t *module_desc_qname = NULL;
         int size = 0;
 
-        axis2_hash_this (index_i, NULL, NULL, &v);
+        axis2_hash_this(index_i, NULL, NULL, &v);
         op_desc = (axis2_op_t *) v;
-        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "op name is:%s", 
-            AXIS2_QNAME_GET_LOCALPART(AXIS2_OP_GET_QNAME(op_desc, env), env));
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "op name is:%s",
+                AXIS2_QNAME_GET_LOCALPART(AXIS2_OP_GET_QNAME(op_desc, env), env));
         modules = AXIS2_OP_GET_ALL_MODULES(op_desc, env);
         module_desc_qname = AXIS2_MODULE_DESC_GET_QNAME(module_desc, env);
-        if(modules)
+        if (modules)
             size = AXIS2_ARRAY_LIST_SIZE(modules, env);
-        for(j = 0; j < size; j++)
+        for (j = 0; j < size; j++)
         {
             axis2_module_desc_t *module_desc_l = NULL;
             const axis2_qname_t *module_desc_qname_l = NULL;
@@ -1212,102 +1149,102 @@
 
             module_desc_qname_l = AXIS2_MODULE_DESC_GET_QNAME(module_desc_l ,
                     env);
-            if(AXIS2_QNAME_EQUALS(module_desc_qname_l, env, module_desc_qname))
+            if (AXIS2_QNAME_EQUALS(module_desc_qname_l, env, module_desc_qname))
             {
                 engaged = AXIS2_TRUE;
                 break;
             }
         }
-        if(AXIS2_TRUE == engaged)
+        if (AXIS2_TRUE == engaged)
         {
             continue;
         }
-        for(type = 1; type < 5; type++)
+        for (type = 1; type < 5; type++)
         {
             switch (type)
             {
-            case AXIS2_IN_FLOW:
-            {
-                axis2_array_list_t *phase_list = NULL;
+                case AXIS2_IN_FLOW:
+                {
+                    axis2_array_list_t *phase_list = NULL;
 
-                phase_list = AXIS2_OP_GET_IN_FLOW(op_desc, env);
-                if(resolver_impl->phase_holder)
+                    phase_list = AXIS2_OP_GET_IN_FLOW(op_desc, env);
+                    if (resolver_impl->phase_holder)
+                    {
+                        AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
+                        resolver_impl->phase_holder = NULL;
+                    }
+                    resolver_impl->phase_holder =
+                        axis2_phase_holder_create_with_phases(env, phase_list);
+                    break;
+                }
+                case AXIS2_OUT_FLOW:
                 {
-                    AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
-                    resolver_impl->phase_holder = NULL;
+                    axis2_array_list_t *phase_list = NULL;
+
+                    phase_list = AXIS2_OP_GET_OUT_FLOW(op_desc, env);
+                    if (resolver_impl->phase_holder)
+                    {
+                        AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
+                        resolver_impl->phase_holder = NULL;
+                    }
+                    resolver_impl->phase_holder =
+                        axis2_phase_holder_create_with_phases(env, phase_list);
+                    break;
                 }
-                resolver_impl->phase_holder =
-                    axis2_phase_holder_create_with_phases(env, phase_list);
-                break;
-            }
-            case AXIS2_OUT_FLOW:
-            {
-                axis2_array_list_t *phase_list = NULL;
+                case AXIS2_FAULT_IN_FLOW:
+                {
+                    axis2_array_list_t *phase_list = NULL;
 
-                phase_list = AXIS2_OP_GET_OUT_FLOW(op_desc, env);
-                if(resolver_impl->phase_holder)
+                    phase_list = AXIS2_OP_GET_FAULT_IN_FLOW(op_desc, env);
+                    if (resolver_impl->phase_holder)
+                    {
+                        AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
+                        resolver_impl->phase_holder = NULL;
+                    }
+                    resolver_impl->phase_holder =
+                        axis2_phase_holder_create_with_phases(env, phase_list);
+                    break;
+                }
+                case AXIS2_FAULT_OUT_FLOW:
                 {
-                    AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
-                    resolver_impl->phase_holder = NULL;
+                    axis2_array_list_t *phase_list = NULL;
+
+                    phase_list = AXIS2_OP_GET_FAULT_OUT_FLOW(op_desc, env);
+                    if (resolver_impl->phase_holder)
+                    {
+                        AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
+                        resolver_impl->phase_holder = NULL;
+                    }
+                    resolver_impl->phase_holder =
+                        axis2_phase_holder_create_with_phases(env, phase_list);
+                    break;
                 }
-                resolver_impl->phase_holder =
-                    axis2_phase_holder_create_with_phases(env, phase_list);
-                break;
             }
-            case AXIS2_FAULT_IN_FLOW:
-            {
-                axis2_array_list_t *phase_list = NULL;
 
-                phase_list = AXIS2_OP_GET_FAULT_IN_FLOW(op_desc, env);
-                if(resolver_impl->phase_holder)
+            /* process modules referred by axis2.xml */
+
+            switch (type)
+            {
+                case AXIS2_IN_FLOW:
                 {
-                    AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
-                    resolver_impl->phase_holder = NULL;
+                    flow = AXIS2_MODULE_DESC_GET_IN_FLOW(module_desc, env);
+                    break;
                 }
-                resolver_impl->phase_holder =
-                    axis2_phase_holder_create_with_phases(env, phase_list);
-                break;
-            }
-            case AXIS2_FAULT_OUT_FLOW:
-            {
-                axis2_array_list_t *phase_list = NULL;
-
-                phase_list = AXIS2_OP_GET_FAULT_OUT_FLOW(op_desc, env);
-                if(resolver_impl->phase_holder)
+                case AXIS2_OUT_FLOW:
                 {
-                    AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
-                    resolver_impl->phase_holder = NULL;
+                    flow = AXIS2_MODULE_DESC_GET_OUT_FLOW(module_desc, env);
+                    break;
+                }
+                case AXIS2_FAULT_IN_FLOW:
+                {
+                    flow = AXIS2_MODULE_DESC_GET_FAULT_IN_FLOW(module_desc, env);
+                    break;
+                }
+                case AXIS2_FAULT_OUT_FLOW:
+                {
+                    flow = AXIS2_MODULE_DESC_GET_FAULT_OUT_FLOW(module_desc, env);
+                    break;
                 }
-                resolver_impl->phase_holder =
-                    axis2_phase_holder_create_with_phases(env, phase_list);
-                break;
-            }
-            }
-            /******************************************************************/
-            /******************* Modules refered by axis2.xml *****************/
-            /******************************************************************/
-            switch (type)
-            {
-            case AXIS2_IN_FLOW:
-            {
-                flow = AXIS2_MODULE_DESC_GET_IN_FLOW(module_desc, env);
-                break;
-            }
-            case AXIS2_OUT_FLOW:
-            {
-                flow = AXIS2_MODULE_DESC_GET_OUT_FLOW(module_desc, env);
-                break;
-            }
-            case AXIS2_FAULT_IN_FLOW:
-            {
-                flow = AXIS2_MODULE_DESC_GET_FAULT_IN_FLOW(module_desc, env);
-                break;
-            }
-            case AXIS2_FAULT_OUT_FLOW:
-            {
-                flow = AXIS2_MODULE_DESC_GET_FAULT_OUT_FLOW(module_desc, env);
-                break;
-            }
             }
             if (NULL != flow)
             {
@@ -1322,11 +1259,11 @@
 
                     metadata = AXIS2_FLOW_GET_HANDLER(flow, env, j);
                     phase_rule = AXIS2_HANDLER_DESC_GET_RULES(metadata, env);
-                    if(phase_rule)
+                    if (phase_rule)
                     {
                         phase_name = AXIS2_PHASE_RULE_GET_NAME(phase_rule, env);
                     }
-                    if(!phase_name)
+                    if (!phase_name)
                     {
                         return AXIS2_FAILURE;
                     }
@@ -1345,7 +1282,7 @@
             }
         }
         status = AXIS2_OP_ADD_TO_ENGAGED_MODULE_LIST(op_desc, env, module_desc);
-        if(AXIS2_SUCCESS != status)
+        if (AXIS2_SUCCESS != status)
         {
             return status;
         }
@@ -1374,97 +1311,97 @@
 
         switch (type)
         {
-        case AXIS2_IN_FLOW:
-        {
-            axis2_array_list_t *phase_list = NULL;
+            case AXIS2_IN_FLOW:
+            {
+                axis2_array_list_t *phase_list = NULL;
 
-            phase_list =
-                AXIS2_CONF_GET_IN_PHASES_UPTO_AND_INCLUDING_POST_DISPATCH(
-                    resolver_impl->axis2_config, env);
-            if(resolver_impl->phase_holder)
+                phase_list =
+                    AXIS2_CONF_GET_IN_PHASES_UPTO_AND_INCLUDING_POST_DISPATCH(
+                        resolver_impl->axis2_config, env);
+                if (resolver_impl->phase_holder)
+                {
+                    AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
+                    resolver_impl->phase_holder = NULL;
+                }
+                resolver_impl->phase_holder =
+                    axis2_phase_holder_create_with_phases(env, phase_list);
+                if (!resolver_impl->phase_holder) continue;
+                break;
+            }
+            case AXIS2_OUT_FLOW:
             {
-                AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
-                resolver_impl->phase_holder = NULL;
+                axis2_array_list_t *phase_list = NULL;
+
+                phase_list = AXIS2_CONF_GET_OUT_FLOW(resolver_impl->axis2_config,
+                        env);
+                if (resolver_impl->phase_holder)
+                {
+                    AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
+                    resolver_impl->phase_holder = NULL;
+                }
+                resolver_impl->phase_holder =
+                    axis2_phase_holder_create_with_phases(env, phase_list);
+                if (!resolver_impl->phase_holder) continue;
+                break;
             }
-            resolver_impl->phase_holder =
-                axis2_phase_holder_create_with_phases(env, phase_list);
-            if(!resolver_impl->phase_holder) continue;
-            break;
-        }
-        case AXIS2_OUT_FLOW:
-        {
-            axis2_array_list_t *phase_list = NULL;
+            case AXIS2_FAULT_IN_FLOW:
+            {
+                axis2_array_list_t *phase_list = NULL;
 
-            phase_list = AXIS2_CONF_GET_OUT_FLOW(resolver_impl->axis2_config,
-                    env);
-            if(resolver_impl->phase_holder)
+                phase_list = AXIS2_CONF_GET_IN_FAULT_FLOW(resolver_impl->
+                        axis2_config, env);
+                if (resolver_impl->phase_holder)
+                {
+                    AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
+                    resolver_impl->phase_holder = NULL;
+                }
+                resolver_impl->phase_holder =
+                    axis2_phase_holder_create_with_phases(env, phase_list);
+                if (!resolver_impl->phase_holder) continue;
+                break;
+            }
+            case AXIS2_FAULT_OUT_FLOW:
             {
-                AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
-                resolver_impl->phase_holder = NULL;
+                axis2_array_list_t *phase_list = NULL;
+
+                phase_list = AXIS2_CONF_GET_OUT_FAULT_FLOW(resolver_impl->
+                        axis2_config, env);
+                if (resolver_impl->phase_holder)
+                {
+                    AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
+                    resolver_impl->phase_holder = NULL;
+                }
+                resolver_impl->phase_holder =
+                    axis2_phase_holder_create_with_phases(env, phase_list);
+                if (!resolver_impl->phase_holder) continue;
+                break;
             }
-            resolver_impl->phase_holder =
-                axis2_phase_holder_create_with_phases(env, phase_list);
-            if(!resolver_impl->phase_holder) continue;
-            break;
         }
-        case AXIS2_FAULT_IN_FLOW:
-        {
-            axis2_array_list_t *phase_list = NULL;
 
-            phase_list = AXIS2_CONF_GET_IN_FAULT_FLOW(resolver_impl->
-                    axis2_config, env);
-            if(resolver_impl->phase_holder)
+        /* modules referred by axis2.xml */
+
+        switch (type)
+        {
+            case AXIS2_IN_FLOW:
             {
-                AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
-                resolver_impl->phase_holder = NULL;
+                flow = AXIS2_MODULE_DESC_GET_IN_FLOW(module_desc, env);
+                break;
             }
-            resolver_impl->phase_holder =
-                axis2_phase_holder_create_with_phases(env, phase_list);
-            if(!resolver_impl->phase_holder) continue;
-            break;
-        }
-        case AXIS2_FAULT_OUT_FLOW:
-        {
-            axis2_array_list_t *phase_list = NULL;
-
-            phase_list = AXIS2_CONF_GET_OUT_FAULT_FLOW(resolver_impl->
-                    axis2_config, env);
-            if(resolver_impl->phase_holder)
+            case AXIS2_OUT_FLOW:
             {
-                AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
-                resolver_impl->phase_holder = NULL;
+                flow = AXIS2_MODULE_DESC_GET_OUT_FLOW(module_desc, env);
+                break;
+            }
+            case AXIS2_FAULT_IN_FLOW:
+            {
+                flow = AXIS2_MODULE_DESC_GET_FAULT_IN_FLOW(module_desc, env);
+                break;
+            }
+            case AXIS2_FAULT_OUT_FLOW:
+            {
+                flow = AXIS2_MODULE_DESC_GET_FAULT_OUT_FLOW(module_desc, env);
+                break;
             }
-            resolver_impl->phase_holder =
-                axis2_phase_holder_create_with_phases(env, phase_list);
-            if(!resolver_impl->phase_holder) continue;
-            break;
-        }
-        }
-        /**********************************************************************/
-        /****************** Modules refered by axis2.xml **********************/
-        /**********************************************************************/
-        switch (type)
-        {
-        case AXIS2_IN_FLOW:
-        {
-            flow = AXIS2_MODULE_DESC_GET_IN_FLOW(module_desc, env);
-            break;
-        }
-        case AXIS2_OUT_FLOW:
-        {
-            flow = AXIS2_MODULE_DESC_GET_OUT_FLOW(module_desc, env);
-            break;
-        }
-        case AXIS2_FAULT_IN_FLOW:
-        {
-            flow = AXIS2_MODULE_DESC_GET_FAULT_IN_FLOW(module_desc, env);
-            break;
-        }
-        case AXIS2_FAULT_OUT_FLOW:
-        {
-            flow = AXIS2_MODULE_DESC_GET_FAULT_OUT_FLOW(module_desc, env);
-            break;
-        }
         }
         if (NULL != flow)
         {
@@ -1477,11 +1414,11 @@
 
                 metadata = AXIS2_FLOW_GET_HANDLER(flow, env, j);
                 phase_rule = AXIS2_HANDLER_DESC_GET_RULES(metadata, env);
-                if(phase_rule)
+                if (phase_rule)
                 {
                     phase_name = AXIS2_PHASE_RULE_GET_NAME(phase_rule, env);
                 }
-                if(!phase_name)
+                if (!phase_name)
                 {
                     return AXIS2_FAILURE;
                 }
@@ -1492,7 +1429,7 @@
                 {
                     status = AXIS2_PHASE_HOLDER_ADD_HANDLER(resolver_impl->
                             phase_holder, env, metadata);
-                    if(AXIS2_SUCCESS != status)
+                    if (AXIS2_SUCCESS != status)
                     {
                         return status;
                     }
@@ -1501,10 +1438,10 @@
                 /*else
                 {
                      * These handlers will go to op's handler chains , since 
-                     * the module try to add handlres to both sytem predefined
+                     * the module try to add handlers to both system predefined
                      * phases and user defined phase so global module can do 
                      * that. here the global module are the module which are
-                     * reffred by axis2.xml
+                     * referred by axis2.xml
                 }*/
             }
         }
@@ -1531,20 +1468,20 @@
     resolver_impl = AXIS2_INTF_TO_IMPL(phase_resolver);
 
     ops = AXIS2_SVC_GET_ALL_OPS(svc, env);
-    if(!ops)
+    if (!ops)
     {
         return AXIS2_FAILURE;
     }
     status = AXIS2_SVC_ADD_MODULE_OPS(svc, env, module_desc,
             resolver_impl->axis2_config);
 
-    if(AXIS2_SUCCESS != status)
+    if (AXIS2_SUCCESS != status)
     {
         return status;
     }
     module_d_qname = AXIS2_MODULE_DESC_GET_QNAME(module_desc, env);
-    for (index_i = axis2_hash_first (ops, env); index_i; index_i =
-                axis2_hash_next (env, index_i))
+    for (index_i = axis2_hash_first(ops, env); index_i; index_i =
+                axis2_hash_next(env, index_i))
     {
         axis2_array_list_t *modules = NULL;
         axis2_op_t *op_desc = NULL;
@@ -1553,43 +1490,31 @@
         void *v = NULL;
         axis2_bool_t engaged = AXIS2_FALSE;
 
-        axis2_hash_this (index_i, NULL, NULL, &v);
+        axis2_hash_this(index_i, NULL, NULL, &v);
         op_desc = (axis2_op_t *) v;
         modules = AXIS2_OP_GET_ALL_MODULES(op_desc, env);
-        if(modules)
+        if (modules)
             size = AXIS2_ARRAY_LIST_SIZE(modules, env);
-        for(j = 0; j < size; j++)
+        for (j = 0; j < size; j++)
         {
             axis2_module_desc_t *module_desc_l = NULL;
             const axis2_qname_t *module_d_qname_l = NULL;
 
             module_desc_l = AXIS2_ARRAY_LIST_GET(modules, env, j);
             module_d_qname_l = AXIS2_MODULE_DESC_GET_QNAME(module_desc_l, env);
-            if(AXIS2_TRUE == AXIS2_QNAME_EQUALS(module_d_qname, env, 
-                        module_d_qname_l))
+            if (AXIS2_TRUE == AXIS2_QNAME_EQUALS(module_d_qname, env,
+                    module_d_qname_l))
             {
                 engaged = AXIS2_TRUE;
                 break;
             }
-            /*if(AXIS2_FALSE == engaged)
-            {
-                status = axis2_phase_resolver_engage_module_to_op(
-                    phase_resolver, env, op_desc, module_desc);
-                if(AXIS2_SUCCESS != status)
-                {
-                    return status;
-                }
-                
-                status = AXIS2_OP_ADD_TO_ENGAGED_MODULE_LIST(op_desc, env, 
-                    module_desc);
-            }*/
         }
 
-        if(AXIS2_FALSE == engaged)
+        if (AXIS2_FALSE == engaged)
         {
             status = axis2_phase_resolver_engage_module_to_op(
                         phase_resolver, env, op_desc, module_desc);
-            if(AXIS2_SUCCESS != status)
+            if (AXIS2_SUCCESS != status)
             {
                 return status;
             }
@@ -1623,7 +1548,7 @@
         axis2_flow_t *flow = NULL;
         axis2_array_list_t *phases = NULL;
 
-        if(resolver_impl->phase_holder)
+        if (resolver_impl->phase_holder)
         {
             AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
             resolver_impl->phase_holder = NULL;
@@ -1631,29 +1556,29 @@
 
         switch (type)
         {
-        case AXIS2_IN_FLOW:
-        {
-            phases = AXIS2_OP_GET_IN_FLOW(axis_op, env);
-            break;
-        }
-        case AXIS2_OUT_FLOW:
-        {
-            phases = AXIS2_OP_GET_OUT_FLOW(axis_op, env);
-            break;
-        }
-        case AXIS2_FAULT_IN_FLOW:
-        {
-            phases = AXIS2_OP_GET_FAULT_IN_FLOW(axis_op, env);
-            break;
-        }
-        case AXIS2_FAULT_OUT_FLOW:
-        {
-            phases = AXIS2_OP_GET_FAULT_OUT_FLOW(axis_op, env);
-            break;
-        }
+            case AXIS2_IN_FLOW:
+            {
+                phases = AXIS2_OP_GET_IN_FLOW(axis_op, env);
+                break;
+            }
+            case AXIS2_OUT_FLOW:
+            {
+                phases = AXIS2_OP_GET_OUT_FLOW(axis_op, env);
+                break;
+            }
+            case AXIS2_FAULT_IN_FLOW:
+            {
+                phases = AXIS2_OP_GET_FAULT_IN_FLOW(axis_op, env);
+                break;
+            }
+            case AXIS2_FAULT_OUT_FLOW:
+            {
+                phases = AXIS2_OP_GET_FAULT_OUT_FLOW(axis_op, env);
+                break;
+            }
         }
 
-        if(phases)
+        if (phases)
         {
             resolver_impl->phase_holder =
                 axis2_phase_holder_create_with_phases(env, phases);
@@ -1662,26 +1587,26 @@
 
         switch (type)
         {
-        case AXIS2_IN_FLOW:
-        {
-            flow = AXIS2_MODULE_DESC_GET_IN_FLOW(module_desc, env);
-            break;
-        }
-        case AXIS2_OUT_FLOW:
-        {
-            flow = AXIS2_MODULE_DESC_GET_OUT_FLOW(module_desc, env);
-            break;
-        }
-        case AXIS2_FAULT_IN_FLOW:
-        {
-            flow = AXIS2_MODULE_DESC_GET_FAULT_IN_FLOW(module_desc, env);
-            break;
-        }
-        case AXIS2_FAULT_OUT_FLOW:
-        {
-            flow = AXIS2_MODULE_DESC_GET_FAULT_OUT_FLOW(module_desc, env);
-            break;
-        }
+            case AXIS2_IN_FLOW:
+            {
+                flow = AXIS2_MODULE_DESC_GET_IN_FLOW(module_desc, env);
+                break;
+            }
+            case AXIS2_OUT_FLOW:
+            {
+                flow = AXIS2_MODULE_DESC_GET_OUT_FLOW(module_desc, env);
+                break;
+            }
+            case AXIS2_FAULT_IN_FLOW:
+            {
+                flow = AXIS2_MODULE_DESC_GET_FAULT_IN_FLOW(module_desc, env);
+                break;
+            }
+            case AXIS2_FAULT_OUT_FLOW:
+            {
+                flow = AXIS2_MODULE_DESC_GET_FAULT_OUT_FLOW(module_desc, env);
+                break;
+            }
         }
 
         if (NULL != flow && NULL != resolver_impl->phase_holder)
@@ -1707,11 +1632,10 @@
                 {
                     status = AXIS2_PHASE_HOLDER_ADD_HANDLER(resolver_impl->phase_holder,
                             env, metadata);
-                    if(AXIS2_SUCCESS != status)
+                    if (AXIS2_SUCCESS != status)
                     {
                         AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
                                 "Handler inclusion failed for %s phase", phase_name);
-                        /*return status;*/
                     }
 
                 }
@@ -1723,27 +1647,21 @@
                     axis2_array_list_t *phase_list = NULL;
                     axis2_phase_holder_t *phase_holder = NULL;
 
-                    /*AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "This handler is\
-                            trying to added to system pre defined phases , but those\
-                            handlers are already added to global chain which run\
-                            irrespective of the service");*/
-                    /* return AXIS2_FAILURE;*/
-
                     phase_list =
                         AXIS2_CONF_GET_IN_PHASES_UPTO_AND_INCLUDING_POST_DISPATCH(
                             resolver_impl->axis2_config, env);
-                    if(phase_holder)
+                    if (phase_holder)
                     {
                         AXIS2_PHASE_HOLDER_FREE(phase_holder, env);
                         phase_holder = NULL;
                     }
                     phase_holder =
                         axis2_phase_holder_create_with_phases(env, phase_list);
-                        
+
                     status = AXIS2_PHASE_HOLDER_ADD_HANDLER(phase_holder, env, metadata);
                     AXIS2_PHASE_HOLDER_FREE(phase_holder, env);
                     phase_holder = NULL;
-                    if(AXIS2_SUCCESS != status)
+                    if (AXIS2_SUCCESS != status)
                     {
                         return status;
                     }
@@ -1753,4 +1671,3 @@
     }
     return AXIS2_SUCCESS;
 }
-



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


Mime
View raw message