You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by da...@apache.org on 2005/12/02 06:14:51 UTC

svn commit: r351594 [5/5] - in /webservices/axis2/trunk/c: ./ ides/anjuta/ include/ modules/core/context/src/ modules/core/description/src/ modules/core/engine/src/ modules/core/phaseresolver/src/ modules/core/phaseresolver/src/.deps/ modules/core/tran...

Modified: webservices/axis2/trunk/c/modules/core/phaseresolver/src/phase_resolver.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/phaseresolver/src/phase_resolver.c?rev=351594&r1=351593&r2=351594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/phaseresolver/src/phase_resolver.c (original)
+++ webservices/axis2/trunk/c/modules/core/phaseresolver/src/phase_resolver.c Thu Dec  1 21:13:39 2005
@@ -27,18 +27,17 @@
     /**
      * Field axisConfig
      */
-    private AxisConfiguration axisConfig;
+    struct axis2_engine_config *axis2_config;
 
     /**
      * Field axisService
      */
-    private AxisService axisService;
-
+    struct axis2_svc *svc;
 
     /**
      * Field phaseHolder
      */
-    private PhaseHolder phaseHolder;
+    struct axis2_phase_holder *phase_holder;
     
 } axis2_phase_resolver_impl_t;
 
@@ -51,29 +50,100 @@
                 axis2_phase_resolver_t *phase_resolver,
 				axis2_env_t **env);
 
+axis2_status_t AXIS2_CALL
+axis2_phase_resolver_build_chains(axis2_phase_resolver_t *phase_resolver,
+                                    axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_phase_resolver_build_module_operation(axis2_phase_resolver_t *phase_resolver,
+                                    axis2_env_t **env,
+                                    struct axis2_operation *operation);
+
+/**
+ * this opeartion is used to build all the three cahins ,
+ * so type varible is used to difrenciate them
+ * type = 1 inflow
+ * type = 2 out flow
+ * type = 3 fault flow
+ *
+ * @param type
+ */                                    
+static axis2_status_t AXIS2_CALL
+axis2_phase_resolver_build_execution_chains(axis2_phase_resolver_t *phase_resolver,
+                                    axis2_env_t **env,
+                                    int type,
+                                    struct axis2_operation *operation);
+
+axis2_status_t AXIS2_CALL
+axis2_phase_resolver_build_transport_chains(axis2_phase_resolver_t *phase_resolver,
+                                                axis2_env_t **env);
+
+
+static axis2_status_t AXIS2_CALL
+axis2_phase_resolver_build_in_transport_chains(axis2_phase_resolver_t *phase_resolver,
+                                                axis2_env_t **env,
+                                                struct axis2_transport_in_desc *transport);
+
+/**
+ * Method buildTransportChains
+ *
+ * @param transport
+ * @throws PhaseException
+ */
+static axis2_status_t AXIS2_CALL
+axis2_phase_resolver_build_out_transport_chains(axis2_phase_resolver_t *phase_resolver,
+                                                axis2_env_t **env,
+                                                struct axis2_transport_out_desc *transport);
+
+
+axis2_status_t AXIS2_CALL
+axis2_phase_resolver_engage_module_globally(axis2_phase_resolver_t *phase_resolver,
+                                                axis2_env_t **env,
+                                                struct axis2_module_desc *module);
+
+axis2_status_t AXIS2_CALL
+axis2_phase_resolver_engage_module_to_svc_from_global(axis2_phase_resolver_t *phase_resolver,
+                                                axis2_env_t **env,
+                                                struct axis2_svc *svc,
+                                                struct axis2_module_desc *module_desc);
+
+
+static axis2_status_t AXIS2_CALL
+axis2_phase_resolver_engage_to_global_chain(axis2_phase_resolver_t *phase_resolver,
+                                                axis2_env_t **env,
+                                                struct axis2_module_desc *module_desc);
+
+
+axis2_status_t AXIS2_CALL
+axis2_phase_resolver_engage_module_to_svc(axis2_phase_resolver_t *phase_resolver,
+                                                axis2_env_t **env,
+                                                struct axis2_svc *svc,
+                                                struct axis2_module_desc *module_desc);
+                                                    
+axis2_status_t AXIS2_CALL
+axis2_phase_resolver_engage_module_to_operation(axis2_phase_resolver_t *phase_resolver,
+                                                axis2_env_t **env,
+                                                struct axis2_operation *axis_operation,
+                                                struct axis2_module_desc *module_desc);
 
 /************************** End of function prototypes ************************/
 
 axis2_phase_resolver_t * AXIS2_CALL 
 axis2_phase_resolver_create (axis2_env_t **env)
 {
+    axis2_phase_resolver_impl_t *phase_resolver_impl = NULL;
+    phase_resolver_impl->phase_resolver.ops = NULL;
+    phase_resolver_impl->axis2_config = NULL;
+    phase_resolver_impl->svc = NULL;
+    phase_resolver_impl->phase_holder = NULL;
 	AXIS2_ENV_CHECK(env, NULL);
 	
-	axis2_phase_resolver_impl_t *phase_resolver_impl = 
-		(axis2_phase_resolver_impl_t *) AXIS2_MALLOC((*env)->allocator,
+	phase_resolver_impl = (axis2_phase_resolver_impl_t *) AXIS2_MALLOC((*env)->allocator,
 			sizeof(axis2_phase_resolver_impl_t));
 	
-	
 	if(NULL == phase_resolver_impl)
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL); 
     
-    phase_resolver_impl->phase_list = axis2_array_list_create(env, 0);
-    if(NULL == phase_resolver_impl->phase_list)
-    {
-        axis2_phase_resolver_free(&(phase_resolver_impl->phase_resolver), env);
-        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
-    }
-    
 	phase_resolver_impl->phase_resolver.ops = 
 		AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_phase_resolver_ops_t));
 	if(NULL == phase_resolver_impl->phase_resolver.ops)
@@ -85,29 +155,73 @@
     
     phase_resolver_impl->phase_resolver.ops->free =  
         axis2_phase_resolver_free;
-    
-	phase_resolver_impl->phase_resolver.ops->is_phase_exist =  
-        axis2_phase_resolver_is_phase_exist;
-	phase_resolver_impl->phase_resolver.ops->add_handler =  
-        axis2_phase_resolver_add_handler;
-	phase_resolver_impl->phase_resolver.ops->get_phase =  
-        axis2_phase_resolver_get_phase;
-	phase_resolver_impl->phase_resolver.ops->build_transport_handler_chain = 
-        axis2_phase_resolver_build_transport_handler_chain;
 	
+    phase_resolver_impl->phase_resolver.ops->build_chains = 
+        axis2_phase_resolver_build_chains;
+    
+    phase_resolver_impl->phase_resolver.ops->build_module_operation = 
+        axis2_phase_resolver_build_module_operation;
+    
+    phase_resolver_impl->phase_resolver.ops->build_transport_chains =     
+        axis2_phase_resolver_build_transport_chains;
+    
+    phase_resolver_impl->phase_resolver.ops->engage_module_globally = 
+        axis2_phase_resolver_engage_module_globally;
+        
+    phase_resolver_impl->phase_resolver.ops->engage_module_to_svc_from_global = 
+        axis2_phase_resolver_engage_module_to_svc_from_global;
+        
+    phase_resolver_impl->phase_resolver.ops->engage_module_to_svc = 
+        axis2_phase_resolver_engage_module_to_svc;
+        
+    phase_resolver_impl->phase_resolver.ops->engage_module_to_operation = 
+        axis2_phase_resolver_engage_module_to_operation;
+    
+  
 	return &(phase_resolver_impl->phase_resolver);
 }
 
 axis2_phase_resolver_t * AXIS2_CALL 
-axis2_phase_resolver_create_with_phases (axis2_env_t **env, axis2_array_list_t *phases)
+axis2_phase_resolver_create_with_config (axis2_env_t **env, 
+                                         struct axis2_engine_config *axis2_config)
 {
+    axis2_phase_resolver_impl_t *phase_resolver_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    AXIS2_PARAM_CHECK((*env)->error, phases, NULL);
+    AXIS2_PARAM_CHECK((*env)->error, axis2_config, NULL);
     
-    axis2_phase_resolver_impl_t *phase_resolver_impl = (axis2_phase_resolver_impl_t *)
+    phase_resolver_impl = (axis2_phase_resolver_impl_t *)
         axis2_phase_resolver_create(env);
-    AXIS2_ARRAY_LIST_FREE(phase_resolver_impl->phase_list, env);
-    phase_resolver_impl->phase_list = phases;
+    AXIS2_ENGINE_CONFIG_FREE(phase_resolver_impl->axis2_config, env);
+    phase_resolver_impl->axis2_config = axis2_config;
+    return &(phase_resolver_impl->phase_resolver);
+}
+
+axis2_phase_resolver_t * AXIS2_CALL 
+axis2_phase_resolver_create_with_config_and_svc (axis2_env_t **env, 
+                                                struct axis2_engine_config *axis2_config,
+                                                struct axis2_svc *svc)
+{
+    axis2_phase_resolver_impl_t *phase_resolver_impl = NULL;
+    AXIS2_ENV_CHECK(env, NULL);
+    AXIS2_PARAM_CHECK((*env)->error, axis2_config, NULL);
+    
+    phase_resolver_impl = (axis2_phase_resolver_impl_t *)
+        axis2_phase_resolver_create(env);
+    
+    if(phase_resolver_impl->axis2_config)
+    {
+        AXIS2_ENGINE_CONFIG_FREE(phase_resolver_impl->axis2_config, env);
+        phase_resolver_impl->axis2_config = NULL;
+    }    
+    phase_resolver_impl->axis2_config = axis2_config;
+    
+    if(phase_resolver_impl->svc)
+    {
+        AXIS2_SVC_FREE(phase_resolver_impl->svc, env);
+        phase_resolver_impl->svc = NULL;
+    }
+    phase_resolver_impl->svc = svc;
+    
     return &(phase_resolver_impl->phase_resolver);
 }
 
@@ -125,9 +239,22 @@
 	if(NULL != phase_resolver->ops)
         AXIS2_FREE((*env)->allocator, phase_resolver->ops);
     
-    if(NULL != phase_resolver_impl->phase_list)
+    if(NULL != phase_resolver_impl->axis2_config)
+    {
+        AXIS2_ENGINE_CONFIG_FREE(phase_resolver_impl->axis2_config, env);
+        phase_resolver_impl->axis2_config = NULL;
+    }
+    
+    if(NULL != phase_resolver_impl->svc)
     {
-        AXIS2_ARRAY_LIST_FREE(phase_resolver_impl->phase_list, env);
+        AXIS2_SVC_FREE(phase_resolver_impl->svc, env);
+        phase_resolver_impl->svc = NULL;
+    }
+    
+    if(NULL != phase_resolver_impl->phase_holder)
+    {
+        AXIS2_PHASE_HOLDER_FREE(phase_resolver_impl->phase_holder, env);
+        phase_resolver_impl->phase_holder = NULL;
     }
     
     AXIS2_FREE((*env)->allocator, phase_resolver_impl);
@@ -135,593 +262,923 @@
 	return AXIS2_SUCCESS;
 }
 
-/**
- * Class PhaseResolver
- */
-public class PhaseResolver {
-    /**
-     * Field axisConfig
-     */
-    private AxisConfiguration axisConfig;
-
-    /**
-     * Field axisService
-     */
-    private AxisService axisService;
-
-
-    /**
-     * Field phaseHolder
-     */
-    private PhaseHolder phaseHolder;
-
-    public PhaseResolver() {
-    }
-
-    /**
-     * default constructor , to obuild chains for GlobalDescription
-     *
-     * @param engineConfig
-     */
-    public PhaseResolver(AxisConfiguration engineConfig) {
-        this.axisConfig = engineConfig;
-    }
-
-    /**
-     * Constructor PhaseResolver
-     *
-     * @param axisConfig
-     * @param serviceContext
-     */
-    public PhaseResolver(AxisConfiguration axisConfig,
-                         AxisService serviceContext) {
-        this.axisConfig = axisConfig;
-        this.axisService = serviceContext;
-    }
-
-    /**
-     * Method buildchains
-     *
-     * @throws PhaseException
-     * @throws AxisFault
-     */
-    public void buildchains() throws PhaseException, AxisFault {
-        HashMap operations = axisService.getOperations();
-        Collection col = operations.values();
-        for (Iterator iterator = col.iterator(); iterator.hasNext();) {
-            AxisOperation axisOperation = (AxisOperation) iterator.next();
-            for (int i = 1; i < 5; i++) {
-                buildExcutionChains(i, axisOperation);
-            }
+axis2_status_t AXIS2_CALL
+axis2_phase_resolver_build_chains(axis2_phase_resolver_t *phase_resolver,
+                                    axis2_env_t **env) 
+{
+    axis2_phase_resolver_impl_t *resolver_impl = NULL;
+    axis2_hash_index_t *index_i = 0;
+    int j = 0;
+    axis2_status_t status = AXIS2_FAILURE;
+    void * v = NULL;
+    struct axis2_operation *operation = NULL;
+    axis2_hash_t *operations = NULL;
+    
+    resolver_impl = AXIS2_INTF_TO_IMPL(phase_resolver);
+    operations = AXIS2_SVC_GET_OPERATIONS(resolver_impl->svc, env);
+    
+    for (index_i = axis2_hash_first (operations, env); index_i; index_i = axis2_hash_next (env, index_i))
+    {
+        axis2_hash_this (index_i, NULL, NULL, &v);
+        operation = (struct axis2_operation *)v;
+        for(j = 1; j < 5; j++)
+        {
+            status = axis2_phase_resolver_build_execution_chains(phase_resolver,
+                env, j, operation );
+            
         }
     }
 
-    /**
-     * To build the opration for the opeartion which the module going to be added
-     *
-     * @param opartion <code>AxisOperation</code>
-     * @throws AxisFault
-     */
-    public void buildModuleOperation(AxisOperation opartion) throws AxisFault {
-        for (int i = 1; i < 5; i++) {
-            buildExcutionChains(i, opartion);
-        }
+    return status;    
+}
+
+axis2_status_t AXIS2_CALL
+axis2_phase_resolver_build_module_operation(axis2_phase_resolver_t *phase_resolver,
+                                    axis2_env_t **env,
+                                    struct axis2_operation *operation)
+{
+    AXIS2_FUNC_PARAM_CHECK(phase_resolver, env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, operation, AXIS2_FAILURE);
+    int i = 0;
+    axis2_status_t status = AXIS2_FAILURE;
+    for (i = 1; i < 5; i++) 
+    {
+        status = axis2_phase_resolver_build_execution_chains(phase_resolver, env, 
+                    i, operation);
     }
+    return status;
+}
 
-    /**
-     * this opeartion is used to build all the three cahins ,
-     * so type varible is used to difrenciate them
-     * type = 1 inflow
-     * type = 2 out flow
-     * type = 3 fault flow
-     *
-     * @param type
-     * @throws AxisFault
-     * @throws PhaseException
-     */
-    private void buildExcutionChains(int type, AxisOperation axisOperation)
-            throws AxisFault, PhaseException {
-        ArrayList allHandlers = new ArrayList();
-        ModuleDescription module;
-        Flow flow = null;
-        ///////////////////////////////////////////////////////////////////////////////////////////
-        ////////////////////////// Handlers from   axis2.xml from modules/////////////////////////
-        ArrayList modulqnames = (ArrayList) ((AxisConfigurationImpl) axisConfig).getEngadgedModules();
-        for (int i = 0; i < modulqnames.size(); i++) {
-            QName modulename = (QName) modulqnames.get(i);
-            module = axisConfig.getModule(modulename);
-            if (module != null) {
-                switch (type) {
-                    case PhaseMetadata.IN_FLOW:
-                    {
-                        flow = module.getInFlow();
-                        break;
-                    }
-                    case PhaseMetadata.OUT_FLOW:
-                    {
-                        flow = module.getOutFlow();
-                        break;
-                    }
-                    case PhaseMetadata.FAULT_IN_FLOW:
-                    {
-                        flow = module.getFaultInFlow();
-                        break;
-                    }
-                    case PhaseMetadata.FAULT_OUT_FLOW:
-                    {
-                        flow = module.getFaultOutFlow();
-                        break;
-                    }
+static axis2_status_t AXIS2_CALL
+axis2_phase_resolver_build_execution_chains(axis2_phase_resolver_t *phase_resolver,
+                                    axis2_env_t **env,
+                                    int type,
+                                    struct axis2_operation *operation)
+{
+    axis2_phase_resolver_impl_t *resolver_impl = NULL;
+    axis2_array_list_t *all_handlers = NULL;
+    struct axis2_module_desc *module_desc = NULL;
+    struct axis2_flow *flow = NULL;
+    axis2_array_list_t *moduleqnames = NULL;
+    int i = 0;
+    int j = 0;
+    int status = AXIS2_FAILURE;
+    axis2_qname_t *modulename = NULL;
+    struct axis2_handler_desc *metadata = NULL;
+    axis2_char_t *phase_name = NULL;
+    struct axis2_phase_rule *phase_rule = NULL;
+        
+    all_handlers = axis2_array_list_create(env, 0);
+    
+    /**************************************************************************/
+    /********************* Handlers from   axis2.xml from modules *************/
+    /**************************************************************************/
+    
+    moduleqnames = (axis2_array_list_t *) AXIS2_ENGINE_CONFIG_GET_ENGAGED_MODULES(
+        resolver_impl->axis2_config, env);
+    for (i = 0; i < AXIS2_ARRAY_LIST_SIZE(moduleqnames, env); i++) 
+    {
+        modulename = (axis2_qname_t *) AXIS2_ARRAY_LIST_GET(moduleqnames, env, i);
+        module_desc = AXIS2_ENGINE_CONFIG_GET_MODULE(resolver_impl->axis2_config, env, 
+            modulename);
+        if (NULL != module_desc) 
+        {
+            switch (type) 
+            {
+                case AXIS2_INFLOW:
+                {
+                    flow = AXIS2_MODULE_DESC_GET_INFLOW(module_desc, env);
+                    break;
                 }
-                axisService.addToEngagModuleList(module);
-                axisOperation.addToEngageModuleList(module);
-            } else {
-                throw new PhaseException(Messages.getMessage(
-                        DeploymentErrorMsgs.INVALID_MODULE_REF, modulename.getLocalPart()));
-            }
-
-            if (flow != null) {
-                for (int j = 0; j < flow.getHandlerCount(); j++) {
-                    HandlerDescription metadata = flow.getHandler(j);
-
-                    if (!PhaseValidator.isSystemPhases(metadata.getRules().getPhaseName())) {
-                        allHandlers.add(metadata);
-                    } else {
-                        /**
-                         *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
-                         *
-                         */
-                    }
+                case AXIS2_OUTFLOW:
+                {
+                    flow = AXIS2_MODULE_DESC_GET_OUTFLOW(module_desc, env);
+                    break;
+                }
+                case AXIS2_FAULT_INFLOW:
+                {
+                    flow = AXIS2_MODULE_DESC_GET_FAULT_INFLOW(module_desc, env);
+                    break;
+                }
+                case AXIS2_FAULT_OUTFLOW:
+                {
+                    flow = AXIS2_MODULE_DESC_GET_FAULT_OUTFLOW(module_desc, env);
+                    break;
                 }
             }
-
-        }
-
-        ///////////////////////////////////////////////////////////////////////////////////////////
-        ////////////////////////// SERVICE HANDLERS ///////////////////////////////////////////////
-        switch (type) {
-            case PhaseMetadata.IN_FLOW:
-            {
-                flow = axisService.getInFlow();
-                break;
-            }
-            case PhaseMetadata.OUT_FLOW:
-            {
-                flow = axisService.getOutFlow();
-                break;
-            }
-            case PhaseMetadata.FAULT_IN_FLOW:
+            status = AXIS2_SVC_ADD_TO_ENGAGED_MODULE_LIST(resolver_impl->svc, env, module_desc);
+            if(AXIS2_FAILURE == status) 
             {
-                flow = axisService.getFaultInFlow();
-                break;
+                if(all_handlers)            
+                    AXIS2_ARRAY_LIST_FREE(all_handlers, env); 
+                return status;
             }
-            case PhaseMetadata.FAULT_OUT_FLOW:
+            status = AXIS2_OPERATION_ADD_TO_ENGAGE_MODULE_LIST(operation, env, module_desc);
+            if(AXIS2_FAILURE == status) 
             {
-                flow = axisService.getFaultOutFlow();
-                break;
-            }
+                if(all_handlers)            
+                    AXIS2_ARRAY_LIST_FREE(all_handlers, env); 
+                return status;
+            }
+            
+        } else 
+        {
+            if(all_handlers)            
+                    AXIS2_ARRAY_LIST_FREE(all_handlers, env);
+                
+            AXIS2_ERROR_SET((*env)->error, INVALID_MODULE_REF, AXIS2_FAILURE);
+            return AXIS2_FAILURE;
         }
-        if (flow != null) {
-            for (int j = 0; j < flow.getHandlerCount(); j++) {
-                HandlerDescription metadata = flow.getHandler(j);
 
-                // todo change this in properway
-                if (metadata.getRules().getPhaseName().equals("")) {
-                    throw new PhaseException(
-                            Messages.getMessage(DeploymentErrorMsgs.PHASE_DOES_NOT_SPECIFED,
-                                    metadata.getName().getLocalPart()));
-                } else if(PhaseValidator.isSystemPhases(metadata.getRules().getPhaseName())){
-                    throw new PhaseException(Messages.getMessage(
-                            DeploymentErrorMsgs.SERVICE_MODULE_CAN_NOT_REFER_GLOBAL_PHASE,
-                            metadata.getRules().getPhaseName()));
-                } else {
-                    allHandlers.add(metadata);
+        if (NULL != flow) 
+        {
+            for (j = 0; j < AXIS2_FLOW_GET_HANDLER_COUNT(flow, env); j++) 
+            {
+                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 ((0 != AXIS2_STRCMP(AXIS2_PHASE_TRANSPORTIN, phase_name)) &&
+                    (0 != AXIS2_STRCMP(AXIS2_PHASE_DISPATCH, phase_name)) &&
+                    (0 != AXIS2_STRCMP(AXIS2_PHASE_POST_DISPATCH, phase_name)) &&
+                    (0 != AXIS2_STRCMP(AXIS2_PHASE_PRE_DISPATCH, phase_name)))
+                {
+                    status = AXIS2_ARRAY_LIST_ADD(all_handlers, env, metadata);
+                    if(AXIS2_FAILURE == status)
+                    {   
+                        if(all_handlers)            
+                            AXIS2_ARRAY_LIST_FREE(all_handlers, env);                         
+                        return status;
+                    }
+                } else 
+                {
+                    /**
+                     *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
+                     *
+                     */
                 }
             }
         }
-        switch (type) {
-            case PhaseMetadata.IN_FLOW:
-            {
-                phaseHolder =
-                        new PhaseHolder(axisOperation.getRemainingPhasesInFlow());
-                break;
-            }
-            case PhaseMetadata.OUT_FLOW:
+
+    }
+    /**************************************************************************/
+    /************************** SERVICE HANDLERS ******************************/
+    /**************************************************************************/
+    
+    switch (type) 
+    {
+        case AXIS2_INFLOW:
+        {
+            flow = AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(resolver_impl->
+                svc->wsdl_svc->wsdl_component, env, INFLOW_KEY);
+            break;
+        }
+        case AXIS2_OUTFLOW:
+        {
+            flow = AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(resolver_impl->
+                svc->wsdl_svc->wsdl_component, env, OUTFLOW_KEY);
+            break;
+        }
+        case AXIS2_FAULT_INFLOW:
+        {
+            flow = AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(resolver_impl->
+                svc->wsdl_svc->wsdl_component, env, IN_FAULTFLOW_KEY);
+            break;
+        }
+        case AXIS2_FAULT_OUTFLOW:
+        {
+            flow = AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(resolver_impl->
+                svc->wsdl_svc->wsdl_component, env, OUT_FAULTFLOW_KEY);
+            break;
+        }
+    }
+    if (NULL != flow) 
+    {
+        for (j = 0; j < AXIS2_FLOW_GET_HANDLER_COUNT(flow, env); j++) 
+        {
+            if(metadata)
+                AXIS2_HANDLER_DESC_FREE(metadata, env);
+            metadata = AXIS2_FLOW_GET_HANDLER(flow, env, j);
+            phase_name = AXIS2_PHASE_RULE_GET_NAME(AXIS2_HANDLER_DESC_GET_RULES(metadata, 
+                env), env);
+            /* TODO change this in properway */
+            if(0 == AXIS2_STRCMP(phase_name, ""))
             {
-                phaseHolder =
-                        new PhaseHolder(axisOperation.getPhasesOutFlow());
-                break;
-            }
-            case PhaseMetadata.FAULT_IN_FLOW:
+                AXIS2_ERROR_SET((*env)->error, PHASE_IS_NOT_SPECIFED, AXIS2_FAILURE);
+                
+            } else if ((0 != AXIS2_STRCMP(AXIS2_PHASE_TRANSPORTIN, phase_name)) &&
+                    (0 != AXIS2_STRCMP(AXIS2_PHASE_DISPATCH, phase_name)) &&
+                    (0 != AXIS2_STRCMP(AXIS2_PHASE_POST_DISPATCH, phase_name)) &&
+                    (0 != AXIS2_STRCMP(AXIS2_PHASE_PRE_DISPATCH, phase_name)))
             {
-                phaseHolder =
-                        new PhaseHolder(axisOperation.getPhasesInFaultFlow());
-                break;
-            }
-            case PhaseMetadata.FAULT_OUT_FLOW:
+                if(all_handlers)            
+                        AXIS2_ARRAY_LIST_FREE(all_handlers, env);
+                AXIS2_ERROR_SET((*env)->error, 
+                    SERVICE_MODULE_CAN_NOT_REFER_GLOBAL_PHASE, AXIS2_FAILURE);
+                return AXIS2_FAILURE;
+                
+            } else 
             {
-                phaseHolder =
-                        new PhaseHolder(axisOperation.getPhasesOutFaultFlow());
-                break;
+                status = AXIS2_ARRAY_LIST_ADD(all_handlers, env, metadata);
+                if(AXIS2_FAILURE == status) 
+                {
+                    if(all_handlers)            
+                        AXIS2_ARRAY_LIST_FREE(all_handlers, env); 
+                    return status;
+                }
             }
         }
-        for (int i = 0; i < allHandlers.size(); i++) {
-            HandlerDescription handlerMetaData =
-                    (HandlerDescription) allHandlers.get(i);
-            phaseHolder.addHandler(handlerMetaData);
+    }
+    if(resolver_impl->phase_holder)
+    {
+        AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
+    }
+    switch (type) {
+        case AXIS2_INFLOW:
+        {
+            resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env, 
+                AXIS2_OPERATION_GET_REMAINING_PHASES_INFLOW(operation, env));
+            break;
+        }
+        case AXIS2_OUTFLOW:
+        {
+            resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env, 
+                AXIS2_OPERATION_GET_PHASES_OUTFLOW(operation, env));
+            break;
+        }
+        case AXIS2_FAULT_INFLOW:
+        {
+            resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env,
+                AXIS2_OPERATION_GET_PHASES_IN_FAULT_FLOW(operation, env));
+            break;
         }
+        case AXIS2_FAULT_OUTFLOW:
+        {
+            resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env,
+                AXIS2_OPERATION_GET_PHASES_OUT_FAULT_FLOW(operation, env));
+            break;
+        }
+    }
+    for (i = 0; i < AXIS2_ARRAY_LIST_SIZE(all_handlers, env); i++) 
+    {
+        metadata = (struct axis2_handler_desc *)
+            AXIS2_ARRAY_LIST_GET(all_handlers, env, i);
+        status = AXIS2_PHASE_HOLDER_ADD_HANDLER(resolver_impl->phase_holder, env, metadata);
+        
     }
 
-    /**
-     * Method buildTranspotsChains
-     *
-     * @throws PhaseException
-     */
-    public void buildTranspotsChains() throws PhaseException {
-        HashMap axisTransportIn = axisConfig.getTransportsIn();
-        HashMap axisTransportOut = axisConfig.getTransportsOut();
+    /* Free the locally created all_handlers list */
+    if(all_handlers)
+        AXIS2_ARRAY_LIST_FREE(all_handlers, env);
+    
+    return status;
+}
 
-        Collection colintrnsport = axisTransportIn.values();
-        for (Iterator iterator = colintrnsport.iterator();
-             iterator.hasNext();) {
-            TransportInDescription transport = (TransportInDescription) iterator.next();
-            buildINTransportChains(transport);
-        }
+axis2_status_t AXIS2_CALL
+axis2_phase_resolver_build_transport_chains(axis2_phase_resolver_t *phase_resolver,
+                                                axis2_env_t **env)
+{
+    axis2_phase_resolver_impl_t *resolver_impl = NULL;
+    axis2_hash_t *transports_in = NULL;
+    axis2_hash_t *transports_out = NULL;
+    axis2_hash_index_t *index_i = 0;
+    struct axis2_transport_in_desc *transport_in = NULL;
+    struct axis2_transport_out_desc *transport_out = NULL;
+    void *v = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+    
+    resolver_impl = AXIS2_INTF_TO_IMPL(phase_resolver);
+    
+    transports_in = AXIS2_ENGINE_CONFIG_GET_TRANSPORTS_IN(
+        resolver_impl->axis2_config, env);
+    
+    transports_out = AXIS2_ENGINE_CONFIG_GET_TRANSPORTS_OUT(
+        resolver_impl->axis2_config, env);
 
-        Collection colouttrnsport = axisTransportOut.values();
-        for (Iterator iterator = colouttrnsport.iterator();
-             iterator.hasNext();) {
-            TransportOutDescription transport = (TransportOutDescription) iterator.next();
-            buildOutTransportChains(transport);
-        }
+    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);
+        transport_in = (struct axis2_transport_in_desc *) v;
+        status = axis2_phase_resolver_build_in_transport_chains(phase_resolver, env, transport_in);
+        if(AXIS2_FAILURE == status)
+            return status;
     }
+    
+    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);
+        transport_out = (struct axis2_transport_out_desc *) v;
+        status = axis2_phase_resolver_build_out_transport_chains(phase_resolver, env, transport_out);
 
-    private void buildINTransportChains(TransportInDescription transport)
-            throws PhaseException {
-        Flow flow = null;
-        Phase phase = null;
-        for (int type = 1; type < 4; type++) {
-            switch (type) {
-                case PhaseMetadata.IN_FLOW:
+    }
+    
+    return status;
+}
+
+
+static axis2_status_t AXIS2_CALL
+axis2_phase_resolver_build_in_transport_chains(axis2_phase_resolver_t *phase_resolver,
+                                                axis2_env_t **env,
+                                                struct axis2_transport_in_desc *transport)
+{
+    struct axis2_flow *flow = NULL;
+    struct axis2_phase *phase = NULL;
+    int type = 0;
+    int j = 0;
+    axis2_status_t status = AXIS2_FAILURE;
+    axis2_array_list_t *handlers = NULL;
+    struct axis2_handler_desc *metadata = NULL;
+    struct axis2_phase_holder *phase_holder = NULL;
+    
+    for (type = 1; type < 4; type++) {
+        switch (type) {
+            case AXIS2_INFLOW:
+            {
+                flow = AXIS2_TRANSPORT_IN_DESC_GET_INFLOW(transport, env);
+                phase = AXIS2_TRANSPORT_IN_DESC_GET_INPHASE(transport, env);
+                break;
+            }
+            case AXIS2_FAULT_INFLOW:
+            {
+                flow = AXIS2_TRANSPORT_IN_DESC_GET_FAULTFLOW(transport, env);
+                phase = AXIS2_TRANSPORT_IN_DESC_GET_FAULTPHASE(transport, env);
+                break;
+            }
+        }
+        if (NULL != flow) 
+        {
+            handlers = axis2_array_list_create(env, 0);
+            for (j = 0; j < AXIS2_FLOW_GET_HANDLER_COUNT(flow, env); j++) 
+            {
+                metadata = AXIS2_FLOW_GET_HANDLER(flow, env, j);
+                status = AXIS2_PHASE_RULE_SET_NAME(AXIS2_HANDLER_DESC_GET_RULES(metadata,
+                    env), env, AXIS2_TRANSPORT_PHASE);
+                
+                if(AXIS2_FAILURE == status)
                 {
-                    flow = transport.getInFlow();
-                    phase = transport.getInPhase();
-                    break;
+                    if(handlers)
+                        AXIS2_ARRAY_LIST_FREE(handlers, env);
+                    return status;
                 }
-                case PhaseMetadata.FAULT_IN_FLOW:
+                status = AXIS2_ARRAY_LIST_ADD(handlers, env, metadata);
+                if(AXIS2_FAILURE == status)
                 {
-                    flow = transport.getFaultFlow();
-                    phase = transport.getFaultPhase();
-                    break;
+                    if(handlers)
+                        AXIS2_ARRAY_LIST_FREE(handlers, env);
+                    return status;
                 }
             }
-            if (flow != null) {
-                ArrayList handlers = new ArrayList();
-                for (int j = 0; j < flow.getHandlerCount(); j++) {
-                    HandlerDescription metadata = flow.getHandler(j);
-                    metadata.getRules().setPhaseName(PhaseMetadata.TRANSPORT_PHASE);
-                    handlers.add(metadata);
-                }
-                new PhaseHolder().buildTransportHandlerChain(phase, handlers);
-            } else {
-            }
+            phase_holder = axis2_phase_holder_create(env);
+            if(NULL == phase_holder)
+            {
+                if(handlers)
+                    AXIS2_ARRAY_LIST_FREE(handlers, env);
+                AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+                return AXIS2_FAILURE;
+            }
+            
+            status = AXIS2_PHASE_HOLDER_BUILD_TRANSPORT_HANDLER_CHAIN(phase_holder, env, 
+                phase, handlers);
+            if(phase_holder)
+                AXIS2_PHASE_HOLDER_FREE(phase_holder, env);
+        } else 
+        {
         }
     }
+    if(handlers)
+        AXIS2_ARRAY_LIST_FREE(handlers, env);
+    return status;
+}
 
-
-    /**
-     * Method buildTransportChains
-     *
-     * @param transport
-     * @throws PhaseException
-     */
-    private void buildOutTransportChains(TransportOutDescription transport)
-            throws PhaseException {
-        Flow flow = null;
-        Phase phase = null;
-        for (int type = 1; type < 5; type++) {
-            switch (type) {
-                case PhaseMetadata.OUT_FLOW:
+static axis2_status_t AXIS2_CALL
+axis2_phase_resolver_build_out_transport_chains(axis2_phase_resolver_t *phase_resolver,
+                                                axis2_env_t **env,
+                                                struct axis2_transport_out_desc *transport)
+{
+    struct axis2_flow *flow = NULL;
+    struct axis2_phase *phase = NULL;
+    int type = 0;
+    int j = 0;
+    axis2_status_t status = AXIS2_FAILURE;
+    axis2_array_list_t *handlers = NULL;
+    struct axis2_handler_desc *metadata = NULL;
+    struct axis2_phase_holder *phase_holder = NULL;
+        
+    for (type = 1; type < 5; type++) 
+    {
+        switch (type) {
+            case AXIS2_OUTFLOW:
+            {
+                flow = AXIS2_TRANSPORT_OUT_DESC_GET_OUTFLOW(transport, env);
+                phase = AXIS2_TRANSPORT_OUT_DESC_GET_OUTPHASE(transport, env);
+                break;
+            }
+            case AXIS2_FAULT_OUTFLOW:
+            {
+                flow = AXIS2_TRANSPORT_OUT_DESC_GET_FAULTFLOW(transport, env);
+                phase = AXIS2_TRANSPORT_OUT_DESC_GET_FAULTPHASE(transport, env);
+                break;
+            }
+        }
+        
+        if (NULL != flow) 
+        {
+            handlers = axis2_array_list_create(env, 0);
+            for (j = 0; j < AXIS2_FLOW_GET_HANDLER_COUNT(flow, env); j++) 
+            {
+                metadata = AXIS2_FLOW_GET_HANDLER(flow, env, j);
+                status = AXIS2_PHASE_RULE_SET_NAME(AXIS2_HANDLER_DESC_GET_RULES(metadata,
+                    env), env, AXIS2_TRANSPORT_PHASE);
+                
+                if(AXIS2_FAILURE == status)
                 {
-                    flow = transport.getOutFlow();
-                    phase = transport.getOutPhase();
-                    break;
-                }
-                case PhaseMetadata.FAULT_OUT_FLOW:
+                    if(handlers)
+                        AXIS2_ARRAY_LIST_FREE(handlers, env);
+                    return status;
+                }
+                
+                status = AXIS2_ARRAY_LIST_ADD(handlers, env, metadata);
+                if(AXIS2_FAILURE == status)
                 {
-                    flow = transport.getFaultFlow();
-                    phase = transport.getFaultPhase();
-                    break;
-                }
-            }
-            if (flow != null) {
-                ArrayList handlers = new ArrayList();
-                for (int j = 0; j < flow.getHandlerCount(); j++) {
-                    HandlerDescription metadata = flow.getHandler(j);
-                    metadata.getRules().setPhaseName(PhaseMetadata.TRANSPORT_PHASE);
-                    handlers.add(metadata);
+                    if(handlers)
+                        AXIS2_ARRAY_LIST_FREE(handlers, env);
+                    return status;
                 }
-                new PhaseHolder().buildTransportHandlerChain(phase, handlers);
-            } else {
             }
+            phase_holder = axis2_phase_holder_create(env);
+            if(NULL == phase_holder)
+            {
+                if(handlers)
+                    AXIS2_ARRAY_LIST_FREE(handlers, env);
+                AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+                return AXIS2_FAILURE;
+            }
+            
+            status = AXIS2_PHASE_HOLDER_BUILD_TRANSPORT_HANDLER_CHAIN(phase_holder, env, 
+                phase, handlers);
+            if(phase_holder)
+                AXIS2_PHASE_HOLDER_FREE(phase_holder, env);
+        } else 
+        {
         }
     }
+    if(handlers)
+        AXIS2_ARRAY_LIST_FREE(handlers, env);
+    return status;
+}
 
 
-    public void engageModuleGlobally(ModuleDescription module) throws AxisFault {
-        enageToGlobalChain(module);
-        Iterator servicegroups = axisConfig.getServiceGroups();
-        while (servicegroups.hasNext()) {
-            AxisServiceGroup sericeGroup = (AxisServiceGroup) servicegroups.next();
-            Iterator services = sericeGroup.getServices();
-            while (services.hasNext()) {
-                AxisService axisService = (AxisService) services.next();
-                axisService.addModuleOperations(module, axisConfig);
-                engageModuleToServiceFromGlobal(axisService, module);
-                axisService.addToEngagModuleList(module);
+axis2_status_t AXIS2_CALL
+axis2_phase_resolver_engage_module_globally(axis2_phase_resolver_t *phase_resolver,
+                                                axis2_env_t **env,
+                                                struct axis2_module_desc *module)
+{
+    axis2_phase_resolver_impl_t *resolver_impl = NULL;
+    axis2_hash_t *svc_grps = NULL;
+    axis2_hash_index_t *index_i = NULL;
+    axis2_hash_index_t *index_j = NULL;
+    void *v = NULL;
+    void *w = NULL;
+    struct axis2_svc_grp *svc_grp = NULL;
+    axis2_hash_t *svcs = NULL;
+    struct axis2_svc *svc = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+        
+    resolver_impl = AXIS2_INTF_TO_IMPL(phase_resolver);
+    
+    status = axis2_phase_resolver_engage_to_global_chain(phase_resolver, env, module);
+    if(AXIS2_FAILURE == status)
+        return status;
+    svc_grps = AXIS2_ENGINE_CONFIG_GET_SVC_GRPS(resolver_impl->axis2_config, env);
+    index_i = axis2_hash_first (svc_grps, env);
+    do 
+    {
+        axis2_hash_this (index_i, NULL, NULL, &v);
+        svc_grp = (struct axis2_svc_grp *) v;
+        svcs = AXIS2_SVC_GRP_GET_SVCS(svc_grp, env);    
+        
+        index_j = axis2_hash_first (svcs, env);
+        do
+        {
+            axis2_hash_this (index_i, NULL, NULL, &w);
+            svc = (struct axis2_svc *) w;
+                
+            status = AXIS2_SVC_ADD_MODULE_OPERATIONS(svc, env, module, 
+                resolver_impl->axis2_config);
+            if(AXIS2_FAILURE == status)
+            {
+                return status;
             }
-            sericeGroup.addModule(module.getName());
-        }
-    }
-
-    /**
-     * To engage modules come form global
-     *
-     * @param service
-     * @param module
-     * @throws PhaseException
-     */
-    public void engageModuleToServiceFromGlobal(AxisService service,
-                                                ModuleDescription module) throws PhaseException {
-        HashMap opeartions = service.getOperations();
-        Collection opCol = opeartions.values();
-        boolean engaged = false;
-        for (Iterator iterator = opCol.iterator(); iterator.hasNext();) {
-            AxisOperation opDesc = (AxisOperation) iterator.next();
-            Collection modules = opDesc.getModules();
-            for (Iterator iterator1 = modules.iterator();
-                 iterator1.hasNext();) {
-                ModuleDescription description = (ModuleDescription) iterator1.next();
-                if (description.getName().equals(module.getName())) {
-                    engaged = true;
-                    break;
-                }
+            status = axis2_phase_resolver_engage_module_to_svc_from_global(
+                phase_resolver, env, svc, module);
+            
+            if(AXIS2_FAILURE == status)
+            {
+                return status;
             }
-            if (engaged) {
-                continue;
-            }
-            Flow flow = null;
-            for (int type = 1; type < 5; type++) {
-                switch (type) {
-                    case PhaseMetadata.IN_FLOW:
-                    {
-                        phaseHolder =
-                                new PhaseHolder(opDesc.getRemainingPhasesInFlow());
-                        break;
-                    }
-                    case PhaseMetadata.OUT_FLOW:
-                    {
-                        phaseHolder =
-                                new PhaseHolder(opDesc.getPhasesOutFlow());
-                        break;
-                    }
-                    case PhaseMetadata.FAULT_IN_FLOW:
-                    {
-                        phaseHolder =
-                                new PhaseHolder(opDesc.getPhasesInFaultFlow());
-                        break;
-                    }
-                    case PhaseMetadata.FAULT_OUT_FLOW:
-                    {
-                        phaseHolder =
-                                new PhaseHolder(opDesc.getPhasesOutFaultFlow());
-                        break;
-                    }
-                }
-                ////////////////////////////////////////////////////////////////////////////////////
-                /////////////////// Modules refered by axis2.xml //////////////////////////////////
-                ////////////////////////////////////////////////////////////////////////////////////
-                switch (type) {
-                    case PhaseMetadata.IN_FLOW:
-                    {
-                        flow = module.getInFlow();
-                        break;
-                    }
-                    case PhaseMetadata.OUT_FLOW:
-                    {
-                        flow = module.getOutFlow();
-                        break;
-                    }
-                    case PhaseMetadata.FAULT_IN_FLOW:
-                    {
-                        flow = module.getFaultInFlow();
-                        break;
-                    }
-                    case PhaseMetadata.FAULT_OUT_FLOW:
-                    {
-                        flow = module.getFaultOutFlow();
-                        break;
-                    }
-                }
-                if (flow != null) {
-                    for (int j = 0; j < flow.getHandlerCount(); j++) {
-                        HandlerDescription metadata = flow.getHandler(j);
-                        if (!PhaseValidator.isSystemPhases(metadata.getRules().getPhaseName())) {
-                            phaseHolder.addHandler(metadata);
-                        }
-                    }
-                }
+            
+            status = AXIS2_SVC_ADD_TO_ENGAGED_MODULE_LIST(svc, env, module);
+            if(AXIS2_FAILURE == status)
+            {
+                return status;
             }
-            opDesc.addToEngageModuleList(module);
+            index_j = axis2_hash_next (env, index_j);
+            
+        } while(NULL != index_j);
+        
+        axis2_qname_t *mod_name = AXIS2_MODULE_DESC_GET_NAME(module, env);
+        status = AXIS2_SVC_GRP_ADD_MODULE(svc_grp, env, 
+            mod_name);
+        
+        if(AXIS2_FAILURE == status)
+        {
+            return status;
         }
-    }
+        index_i = axis2_hash_next (env, index_i);
+           
+    } while(NULL != index_i);
+    
+    return status;
+}
 
+axis2_status_t AXIS2_CALL
+axis2_phase_resolver_engage_module_to_svc_from_global(axis2_phase_resolver_t *phase_resolver,
+                                                axis2_env_t **env,
+                                                struct axis2_svc *svc,
+                                                struct axis2_module_desc *module_desc)
+{
+    axis2_phase_resolver_impl_t *resolver_impl = NULL;
+    axis2_hash_t *operations = NULL;
+    axis2_bool_t engaged = AXIS2_FALSE;
+    struct axis2_operation *op_desc = NULL;
+    struct axis2_module_desc *module_desc_l = NULL;
+    struct axis2_handler_desc *metadata = NULL;    
+    axis2_hash_index_t *index_i = NULL;
+    void *v = NULL;
+    axis2_array_list_t *modules = NULL;
+    int j = 0;
+    int type = 0;
+    struct axis2_flow *flow = NULL;
+    axis2_char_t *phase_name = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+    
+    resolver_impl = AXIS2_INTF_TO_IMPL(phase_resolver);
+    
+    operations = AXIS2_SVC_GET_OPERATIONS(svc, env);
+    for (index_i = axis2_hash_first (operations, env); index_i; index_i = axis2_hash_next (env, index_i))
+    {
 
-    private void enageToGlobalChain(ModuleDescription module) throws PhaseException {
-        Flow flow = null;
-        for (int type = 1; type < 5; type++) {
+        axis2_hash_this (index_i, NULL, NULL, &v);
+        op_desc = (struct axis2_operation *) v;
+        modules = AXIS2_OPERATION_GET_MODULES(op_desc, env);
+        for(j = 0; j < AXIS2_ARRAY_LIST_SIZE(modules, env); j++)
+        {
+            module_desc_l = (struct axis2_module_desc *) 
+                AXIS2_ARRAY_LIST_GET(modules, env, j);
+            if(AXIS2_QNAME_EQUALS(AXIS2_MODULE_DESC_GET_NAME(module_desc_l, env),
+                env, AXIS2_MODULE_DESC_GET_NAME(module_desc, env)))
+            {
+                engaged = AXIS2_TRUE;
+                break;
+            }
+        }
+        if(AXIS2_TRUE == engaged)
+        {
+            continue;
+        }
+        for(type = 1; type < 5; type++)
+        {
             switch (type) {
-                case PhaseMetadata.IN_FLOW:
+                case AXIS2_INFLOW:
                 {
-                    phaseHolder =
-                            new PhaseHolder(axisConfig.
-                                    getInPhasesUptoAndIncludingPostDispatch());
+                    resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env,
+                        AXIS2_OPERATION_GET_REMAINING_PHASES_INFLOW(op_desc, env));
                     break;
                 }
-                case PhaseMetadata.OUT_FLOW:
+                case AXIS2_OUTFLOW:
                 {
-                    phaseHolder =
-                            new PhaseHolder(((AxisConfigurationImpl) axisConfig).getOutFlow());
+                    resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env,
+                        AXIS2_OPERATION_GET_PHASES_OUTFLOW(op_desc, env));
                     break;
                 }
-                case PhaseMetadata.FAULT_IN_FLOW:
+                case AXIS2_FAULT_INFLOW:
                 {
-                    phaseHolder =
-                            new PhaseHolder(axisConfig.getInFaultFlow());
+                    resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env,
+                        AXIS2_OPERATION_GET_PHASES_IN_FAULT_FLOW(op_desc, env));
                     break;
                 }
-                case PhaseMetadata.FAULT_OUT_FLOW:
+                case AXIS2_FAULT_OUTFLOW:
                 {
-                    phaseHolder =
-                            new PhaseHolder(((AxisConfigurationImpl) axisConfig).getOutFaultFlow());
+                    resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env,
+                        AXIS2_OPERATION_GET_PHASES_OUT_FAULT_FLOW(op_desc, env));
                     break;
                 }
             }
-            ////////////////////////////////////////////////////////////////////////////////////
-            /////////////////// Modules refered by axis2.xml //////////////////////////////////
-            ////////////////////////////////////////////////////////////////////////////////////
-            switch (type) {
-                case PhaseMetadata.IN_FLOW:
+            /******************************************************************/
+            /******************* Modules refered by axis2.xml *****************/
+            /******************************************************************/
+            switch (type) 
+            {
+                case AXIS2_INFLOW:
                 {
-                    flow = module.getInFlow();
+                    flow = AXIS2_MODULE_DESC_GET_INFLOW(module_desc, env);
                     break;
                 }
-                case PhaseMetadata.OUT_FLOW:
+                case AXIS2_OUTFLOW:
                 {
-                    flow = module.getOutFlow();
+                    flow = AXIS2_MODULE_DESC_GET_OUTFLOW(module_desc, env);
                     break;
                 }
-                case PhaseMetadata.FAULT_IN_FLOW:
+                case AXIS2_FAULT_INFLOW:
                 {
-                    flow = module.getFaultInFlow();
+                    flow = AXIS2_MODULE_DESC_GET_FAULT_INFLOW(module_desc, env);
                     break;
                 }
-                case PhaseMetadata.FAULT_OUT_FLOW:
+                case AXIS2_FAULT_OUTFLOW:
                 {
-                    flow = module.getFaultOutFlow();
+                    flow = AXIS2_MODULE_DESC_GET_FAULT_OUTFLOW(module_desc, env);
                     break;
                 }
             }
-            if (flow != null) {
-                for (int j = 0; j < flow.getHandlerCount(); j++) {
-                    HandlerDescription metadata = flow.getHandler(j);
-                    if (PhaseValidator.isSystemPhases(metadata.getRules().getPhaseName())) {
-                        phaseHolder.addHandler(metadata);
-                    } else {
-                        /**
-                         * These handlers will go to operation's handler chains , since the module
-                         * try to add handlres to both sytem 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
-                         */
+            if (NULL != flow) 
+            {
+                for (j = 0; j < AXIS2_FLOW_GET_HANDLER_COUNT(flow, env); j++) 
+                {
+                    metadata = AXIS2_FLOW_GET_HANDLER(flow, env, j);
+                    phase_name = AXIS2_PHASE_RULE_GET_NAME(
+                        AXIS2_HANDLER_DESC_GET_RULES(metadata, env), env);
+                    if ((0 != AXIS2_STRCMP(AXIS2_PHASE_TRANSPORTIN, phase_name)) &&
+                        (0 != AXIS2_STRCMP(AXIS2_PHASE_DISPATCH, phase_name)) &&
+                        (0 != AXIS2_STRCMP(AXIS2_PHASE_POST_DISPATCH, phase_name)) &&
+                        (0 != AXIS2_STRCMP(AXIS2_PHASE_PRE_DISPATCH, phase_name)))
+                    {
+                        status = AXIS2_PHASE_HOLDER_ADD_HANDLER(resolver_impl->phase_holder,
+                            env, metadata);
+                        if(AXIS2_FAILURE == status)
+                        {
+                            return status;
+                        }
                     }
                 }
             }
         }
+        status = AXIS2_OPERATION_ADD_TO_ENGAGE_MODULE_LIST(op_desc, env, module_desc);
     }
+    
+    return status;
+}
 
 
-    public void engageModuleToService(AxisService service,
-                                      ModuleDescription module) throws AxisFault {
-        HashMap opeartions = service.getOperations();
-        Collection opCol = opeartions.values();
-        boolean engaged = false;
-        service.addModuleOperations(module, axisConfig);
-        for (Iterator iterator = opCol.iterator(); iterator.hasNext();) {
-            AxisOperation opDesc = (AxisOperation) iterator.next();
-            Collection modules = opDesc.getModules();
-            for (Iterator iterator1 = modules.iterator();
-                 iterator1.hasNext();) {
-                ModuleDescription description = (ModuleDescription) iterator1.next();
-                if (description.getName().equals(module.getName())) {
-                    engaged = true;
-                    break;
+static axis2_status_t AXIS2_CALL
+axis2_phase_resolver_engage_to_global_chain(axis2_phase_resolver_t *phase_resolver,
+                                                axis2_env_t **env,
+                                                struct axis2_module_desc *module_desc)
+{
+    axis2_phase_resolver_impl_t *resolver_impl = NULL;
+    struct axis2_flow *flow = NULL;
+    int type = 0;
+    int j = 0;
+    struct axis2_handler_desc *metadata = NULL;
+    axis2_char_t *phase_name = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+    
+    resolver_impl = AXIS2_INTF_TO_IMPL(phase_resolver);
+    
+    for (type = 1; type < 5; type++) 
+    {
+        switch (type) 
+        {
+            case AXIS2_INFLOW:
+            {
+                resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env,
+                    AXIS2_ENGINE_CONFIG_GET_IN_PHASES_UPTO_AND_INCLUDING_POST_DISPATCH(
+                        resolver_impl->axis2_config, env));
+                break;
+            }
+            case AXIS2_OUTFLOW:
+            {
+                resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env,
+                    AXIS2_ENGINE_CONFIG_GET_OUTFLOW(resolver_impl->axis2_config,
+                        env));
+                break;
+            }
+            case AXIS2_FAULT_INFLOW:
+            {
+                resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env,
+                    AXIS2_ENGINE_CONFIG_GET_IN_FAULT_FLOW(resolver_impl->axis2_config,
+                        env));
+                break;
+            }
+            case AXIS2_FAULT_OUTFLOW:
+            {
+                resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env,
+                    AXIS2_ENGINE_CONFIG_GET_OUT_FAULT_FLOW(resolver_impl->axis2_config,
+                        env));
+                break;
+            }
+        }
+        /**********************************************************************/
+        /****************** Modules refered by axis2.xml **********************/
+        /**********************************************************************/
+        switch (type) 
+        {
+            case AXIS2_INFLOW:
+            {
+                flow = AXIS2_MODULE_DESC_GET_INFLOW(module_desc, env);
+                break;
+            }
+            case AXIS2_OUTFLOW:
+            {
+                flow = AXIS2_MODULE_DESC_GET_OUTFLOW(module_desc, env);
+                break;
+            }
+            case AXIS2_FAULT_INFLOW:
+            {
+                flow = AXIS2_MODULE_DESC_GET_FAULT_INFLOW(module_desc, env);
+                break;
+            }
+            case AXIS2_FAULT_OUTFLOW:
+            {
+                flow = AXIS2_MODULE_DESC_GET_FAULT_OUTFLOW(module_desc, env);
+                break;
+            }
+        }
+        if (NULL != flow) 
+        {
+            for (j = 0; j < AXIS2_FLOW_GET_HANDLER_COUNT(flow, env); j++) 
+            {
+                metadata = AXIS2_FLOW_GET_HANDLER(flow, env, j);
+                phase_name = AXIS2_PHASE_RULE_GET_NAME(
+                        AXIS2_HANDLER_DESC_GET_RULES(metadata, env), env);
+                if ((0 != AXIS2_STRCMP(AXIS2_PHASE_TRANSPORTIN, phase_name)) &&
+                    (0 != AXIS2_STRCMP(AXIS2_PHASE_DISPATCH, phase_name)) &&
+                    (0 != AXIS2_STRCMP(AXIS2_PHASE_POST_DISPATCH, phase_name)) &&
+                    (0 != AXIS2_STRCMP(AXIS2_PHASE_PRE_DISPATCH, phase_name)))
+                {
+                    status = AXIS2_PHASE_HOLDER_ADD_HANDLER(resolver_impl->phase_holder,
+                        env, metadata);
+          
+                } else 
+                {
+                    /**
+                     * These handlers will go to operation's handler chains , since the module
+                     * try to add handlres to both sytem 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
+                     */
                 }
             }
-            if (!engaged) {
-                engageModuleToOperation(opDesc, module);
-                opDesc.addToEngageModuleList(module);
+        }
+    }
+    
+    return status;
+}
+
+
+axis2_status_t AXIS2_CALL
+axis2_phase_resolver_engage_module_to_svc(axis2_phase_resolver_t *phase_resolver,
+                                                axis2_env_t **env,
+                                                struct axis2_svc *svc,
+                                                struct axis2_module_desc *module_desc)
+{
+    axis2_phase_resolver_impl_t *resolver_impl = NULL;
+    axis2_hash_t *operations = NULL;
+    axis2_bool_t engaged = AXIS2_FALSE;
+    struct axis2_operation *op_desc = NULL;
+    axis2_array_list_t *modules = NULL;
+    struct axis2_module_desc *module_desc_l = NULL;
+    axis2_hash_index_t *index_i = NULL;
+    void *v = NULL;
+    int j = 0;
+    axis2_status_t status = AXIS2_FAILURE;
+        
+    resolver_impl = AXIS2_INTF_TO_IMPL(phase_resolver);
+    
+    operations = AXIS2_SVC_GET_OPERATIONS(resolver_impl->svc, env);
+    AXIS2_SVC_ADD_MODULE_OPERATIONS(resolver_impl->svc, env, module_desc, 
+        resolver_impl->axis2_config);
+    for (index_i = axis2_hash_first (operations, env); index_i; index_i = axis2_hash_next (env, index_i))
+    {
+
+        axis2_hash_this (index_i, NULL, NULL, &v);
+        op_desc = (struct axis2_operation *) v;
+        modules = AXIS2_OPERATION_GET_MODULES(op_desc, env);
+        for(j = 0; j < AXIS2_ARRAY_LIST_SIZE(modules, env); j++)
+        {
+            module_desc_l = AXIS2_ARRAY_LIST_GET(modules, env, j);
+            if(0 == AXIS2_QNAME_EQUALS(AXIS2_MODULE_DESC_GET_NAME(module_desc, env),
+                    env, AXIS2_MODULE_DESC_GET_NAME(module_desc_l, env)))
+            {
+                engaged = AXIS2_TRUE;
+                break;
+            }
+            if(AXIS2_FALSE == engaged)
+            {
+                status = axis2_phase_resolver_engage_module_to_operation(phase_resolver, 
+                    env, op_desc, module_desc);
+                if(AXIS2_FAILURE == status)
+                    return status;
+                
+                status = AXIS2_OPERATION_ADD_TO_ENGAGE_MODULE_LIST(op_desc, env, module_desc);
             }
         }
+
     }
+    return status;
+}
 
 
-    public void engageModuleToOperation(AxisOperation axisOperation,
-                                        ModuleDescription module) throws PhaseException {
-        Flow flow = null;
-        for (int type = 1; type < 5; type++) {
-            switch (type) {
-                case PhaseMetadata.IN_FLOW:
-                {
-                    phaseHolder =
-                            new PhaseHolder(axisOperation.getRemainingPhasesInFlow());
-                    break;
-                }
-                case PhaseMetadata.OUT_FLOW:
-                {
-                    phaseHolder =
-                            new PhaseHolder(axisOperation.getPhasesOutFlow());
-                    break;
-                }
-                case PhaseMetadata.FAULT_IN_FLOW:
-                {
-                    phaseHolder =
-                            new PhaseHolder(axisOperation.getPhasesInFaultFlow());
-                    break;
-                }
-                case PhaseMetadata.FAULT_OUT_FLOW:
-                {
-                    phaseHolder =
-                            new PhaseHolder(axisOperation.getPhasesOutFaultFlow());
-                    break;
-                }
+axis2_status_t AXIS2_CALL
+axis2_phase_resolver_engage_module_to_operation(axis2_phase_resolver_t *phase_resolver,
+                                                axis2_env_t **env,
+                                                struct axis2_operation *axis_operation,
+                                                struct axis2_module_desc *module_desc)
+{
+    axis2_phase_resolver_impl_t *resolver_impl = NULL;
+    struct axis2_flow *flow = NULL;
+    int type = 0;
+    int j = 0;
+    struct axis2_handler_desc *metadata = NULL;
+    axis2_status_t status = AXIS2_FALSE;
+    axis2_char_t *phase_name = NULL;
+    
+    resolver_impl = AXIS2_INTF_TO_IMPL(phase_resolver);
+    
+    for (type = 1; type < 5; type++) 
+    {
+        switch (type) {
+            case AXIS2_INFLOW:
+            {
+                resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env, 
+                    AXIS2_OPERATION_GET_REMAINING_PHASES_INFLOW(axis_operation, env));
+                break;
             }
+            case AXIS2_OUTFLOW:
+            {
+                resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env,
+                    AXIS2_OPERATION_GET_PHASES_OUTFLOW(axis_operation, env));
+                break;
+            }
+            case AXIS2_FAULT_INFLOW:
+            {
+                resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env,
+                    AXIS2_OPERATION_GET_PHASES_IN_FAULT_FLOW(axis_operation, env));
+                break;
+            }
+            case AXIS2_FAULT_OUTFLOW:
+            {
+                resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env,
+                    AXIS2_OPERATION_GET_PHASES_OUT_FAULT_FLOW(axis_operation, env));
+                break;
+            }
+        }
 
-            switch (type) {
-                case PhaseMetadata.IN_FLOW:
-                {
-                    flow = module.getInFlow();
-                    break;
-                }
-                case PhaseMetadata.OUT_FLOW:
-                {
-                    flow = module.getOutFlow();
-                    break;
-                }
-                case PhaseMetadata.FAULT_IN_FLOW:
+        switch (type) {
+            case AXIS2_INFLOW:
+            {
+                flow = AXIS2_MODULE_DESC_GET_INFLOW(module_desc, env);
+                break;
+            }
+            case AXIS2_OUTFLOW:
+            {
+                flow = AXIS2_MODULE_DESC_GET_OUTFLOW(module_desc, env);
+                break;
+            }
+            case AXIS2_FAULT_INFLOW:
+            {
+                flow = AXIS2_MODULE_DESC_GET_FAULT_INFLOW(module_desc, env);
+                break;
+            }
+            case AXIS2_FAULT_OUTFLOW:
+            {
+                flow = AXIS2_MODULE_DESC_GET_FAULT_OUTFLOW(module_desc, env);
+                break;
+            }
+        }
+        if (NULL != flow) {
+            for (j = 0; j < AXIS2_FLOW_GET_HANDLER_COUNT(flow, env); j++) 
+            {
+                metadata = AXIS2_FLOW_GET_HANDLER(flow, env, j);
+                phase_name = AXIS2_PHASE_RULE_GET_NAME(
+                        AXIS2_HANDLER_DESC_GET_RULES(metadata, env), env);
+                if ((0 != AXIS2_STRCMP(AXIS2_PHASE_TRANSPORTIN, phase_name)) &&
+                    (0 != AXIS2_STRCMP(AXIS2_PHASE_DISPATCH, phase_name)) &&
+                    (0 != AXIS2_STRCMP(AXIS2_PHASE_POST_DISPATCH, phase_name)) &&
+                    (0 != AXIS2_STRCMP(AXIS2_PHASE_PRE_DISPATCH, phase_name)))
                 {
-                    flow = module.getFaultInFlow();
-                    break;
-                }
-                case PhaseMetadata.FAULT_OUT_FLOW:
+                    status = AXIS2_PHASE_HOLDER_ADD_HANDLER(resolver_impl->phase_holder,
+                        env, metadata);
+           
+                } else 
                 {
-                    flow = module.getFaultOutFlow();
-                    break;
-                }
-            }
-            if (flow != null) {
-                for (int j = 0; j < flow.getHandlerCount(); j++) {
-                    HandlerDescription metadata = flow.getHandler(j);
-                    if (!PhaseValidator.isSystemPhases(metadata.getRules().getPhaseName())) {
-                        phaseHolder.addHandler(metadata);
-                    } else {
-                        throw new PhaseException(Messages.getMessage(DeploymentErrorMsgs.SERVICE_MODULE_CAN_NOT_REFER_GLOBAL_PHASE,
-                                metadata.getRules().getPhaseName()));
-                    }
+                    AXIS2_ERROR_SET((*env)->error, 
+                        SERVICE_MODULE_CAN_NOT_REFER_GLOBAL_PHASE, AXIS2_FAILURE);
+                    
                 }
             }
         }
     }
+    return status;
 }

Modified: webservices/axis2/trunk/c/modules/core/transport/axis2_transport_listener.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/axis2_transport_listener.h?rev=351594&r1=351593&r2=351594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/axis2_transport_listener.h (original)
+++ webservices/axis2/trunk/c/modules/core/transport/axis2_transport_listener.h Thu Dec  1 21:13:39 2005
@@ -28,9 +28,9 @@
 #include <axis2_env.h>
 #include <axis2_allocator.h>
 /*#include <axis2_endpoint_ref.h>*/
-#include <axis2_engine_config.h>
+#include <axis2_ctx.h>
 
-#include <wsdl.h>
+#include <axis2_wsdl.h>
 
 #ifdef __cplusplus
 extern "C"
@@ -38,6 +38,7 @@
 #endif
 
 struct axis2_transport_listener;
+struct axis2_ctx;    
 typedef struct axis2_transport_listener axis2_transport_listener_t;
 typedef struct axis2_transport_listener_ops axis2_transport_listener_ops_t;
 

Modified: webservices/axis2/trunk/c/modules/test/om/src/test_om.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/test/om/src/test_om.c?rev=351594&r1=351593&r2=351594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/test/om/src/test_om.c (original)
+++ webservices/axis2/trunk/c/modules/test/om/src/test_om.c Thu Dec  1 21:13:39 2005
@@ -272,3 +272,4 @@
     
     return 0;
  }
+

Modified: webservices/axis2/trunk/c/modules/wsdl/src/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/Makefile.am?rev=351594&r1=351593&r2=351594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/Makefile.am Thu Dec  1 21:13:39 2005
@@ -21,4 +21,5 @@
 INCLUDES = -I$(top_builddir)/include \
             -I${CUTEST_HOME}/include \
             -I$(top_builddir)/modules/util/src \
-            -I$(top_builddir)/modules/core/description/src
+            -I$(top_builddir)/modules/core/description/src \
+            -I$(top_builddir)/modules/core/transport

Modified: webservices/axis2/trunk/c/modules/wsdl/src/Makefile.in
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/Makefile.in?rev=351594&r1=351593&r2=351594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/Makefile.in (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/Makefile.in Thu Dec  1 21:13:39 2005
@@ -216,7 +216,8 @@
 INCLUDES = -I$(top_builddir)/include \
             -I${CUTEST_HOME}/include \
             -I$(top_builddir)/modules/util/src \
-            -I$(top_builddir)/modules/core/description/src
+            -I$(top_builddir)/modules/core/description/src \
+            -I$(top_builddir)/modules/core/transport
 
 all: all-am
 

Modified: webservices/axis2/trunk/c/modules/wsdl/src/wsdl.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl.h?rev=351594&r1=351593&r2=351594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl.h (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl.h Thu Dec  1 21:13:39 2005
@@ -18,7 +18,7 @@
 #define AXIS2_WSDL_H
 
 /**
- * @file axis2_description.h
+ * @file axis2_axis2_description.h
  * @brief axis2 DESCRIPTION
  */
  

Modified: webservices/axis2/trunk/c/modules/wsdl/src/wsdl_binding_operation.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl_binding_operation.c?rev=351594&r1=351593&r2=351594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_binding_operation.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_binding_operation.c Thu Dec  1 21:13:39 2005
@@ -27,7 +27,7 @@
     /**
      * Field operation
      */
-    axis2_wsdl_operation_t *operation;
+    void *operation;
 
     /**
      * Field input
@@ -59,14 +59,14 @@
                                         axis2_env_t **env,
                                         struct axis2_wsdl_binding_msg_ref *input);
 
-axis2_wsdl_operation_t *AXIS2_CALL
+void *AXIS2_CALL
 axis2_wsdl_binding_operation_get_operation(axis2_wsdl_binding_operation_t *binding_operation,
                                     axis2_env_t **env);
 
 axis2_status_t AXIS2_CALL
 axis2_wsdl_binding_operation_set_operation(axis2_wsdl_binding_operation_t *binding_operation,
                                             axis2_env_t **env,
-                                            axis2_wsdl_operation_t *operation);
+                                            void *operation);
 
 struct axis2_wsdl_binding_msg_ref * AXIS2_CALL
 axis2_wsdl_binding_operation_get_output(axis2_wsdl_binding_operation_t *binding_operation,
@@ -130,6 +130,11 @@
 	{
 		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
 	}
+    
+    binding_operation_impl->qname = NULL;
+    binding_operation_impl->operation = NULL;
+    binding_operation_impl->input = NULL;
+    binding_operation_impl->output = NULL;
 	
     binding_operation_impl->infaults = axis2_linked_list_create (env);
     
@@ -216,12 +221,6 @@
     binding_operation_impl->binding_operation.ops->set_outfaults =
         axis2_wsdl_binding_operation_set_outfaults; 
     
-    
-	binding_operation_impl->qname = NULL;
-    binding_operation_impl->operation = NULL;
-    binding_operation_impl->input = NULL;
-    binding_operation_impl->output = NULL;
-	
 	return &(binding_operation_impl->binding_operation);
 }
 
@@ -231,33 +230,25 @@
 axis2_wsdl_binding_operation_free (axis2_wsdl_binding_operation_t *binding_operation, 
                             axis2_env_t **env)
 {
+    axis2_wsdl_binding_operation_impl_t *binding_operation_impl = NULL;
     AXIS2_FUNC_PARAM_CHECK(binding_operation, env, AXIS2_FAILURE);
-	if(NULL != binding_operation->ops)
-        AXIS2_FREE((*env)->allocator, binding_operation->ops);
     
-    if(NULL != AXIS2_INTF_TO_IMPL(binding_operation)->qname)
-       AXIS2_QNAME_FREE(AXIS2_INTF_TO_IMPL(binding_operation)->qname, env);
+    binding_operation_impl = AXIS2_INTF_TO_IMPL(binding_operation);
     
-    if(NULL != AXIS2_INTF_TO_IMPL(binding_operation)->infaults)
-       AXIS2_LINKED_LIST_FREE(AXIS2_INTF_TO_IMPL(binding_operation)->infaults, env);
-    
-    if(NULL != AXIS2_INTF_TO_IMPL(binding_operation)->outfaults)
-       AXIS2_LINKED_LIST_FREE(AXIS2_INTF_TO_IMPL(binding_operation)->outfaults, env);
+	if(NULL != binding_operation->ops)
+        AXIS2_FREE((*env)->allocator, binding_operation->ops);
     
-    if(NULL != AXIS2_INTF_TO_IMPL(binding_operation)->operation)
-       AXIS2_WSDL_OPERATION_FREE(AXIS2_INTF_TO_IMPL(binding_operation)->operation, env);
+    if(NULL != binding_operation_impl->infaults)
+       AXIS2_LINKED_LIST_FREE(binding_operation_impl->infaults, env);
     
-    if(NULL != AXIS2_INTF_TO_IMPL(binding_operation)->input)
-       AXIS2_WSDL_BINDING_MSG_REF_FREE(AXIS2_INTF_TO_IMPL(binding_operation)->input, env);
+    if(NULL != binding_operation_impl->outfaults)
+       AXIS2_LINKED_LIST_FREE(binding_operation_impl->outfaults, env);
     
     if(NULL != binding_operation->extensible_component)
         AXIS2_WSDL_EXTENSIBLE_COMPONENT_FREE(binding_operation->
             extensible_component, env);
     
-    if(NULL != AXIS2_INTF_TO_IMPL(binding_operation)->output)
-       AXIS2_WSDL_BINDING_MSG_REF_FREE(AXIS2_INTF_TO_IMPL(binding_operation)->output, env);
-    
-    AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(binding_operation));
+    AXIS2_FREE((*env)->allocator, binding_operation_impl);
     
 	return AXIS2_SUCCESS;
 }
@@ -281,7 +272,7 @@
     return AXIS2_SUCCESS;
 }
 
-axis2_wsdl_operation_t *AXIS2_CALL
+void *AXIS2_CALL
 axis2_wsdl_binding_operation_get_operation(axis2_wsdl_binding_operation_t *binding_operation,
                                     axis2_env_t **env) 
 {
@@ -292,11 +283,22 @@
 axis2_status_t AXIS2_CALL
 axis2_wsdl_binding_operation_set_operation(axis2_wsdl_binding_operation_t *binding_operation,
                                             axis2_env_t **env,
-                                            axis2_wsdl_operation_t *operation) 
+                                            void *operation) 
 {
+    struct axis2_operation *ops = NULL;
+    axis2_wsdl_binding_operation_impl_t *binding_operation_impl = NULL;
     AXIS2_FUNC_PARAM_CHECK(binding_operation, env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, operation, AXIS2_FAILURE);
-    AXIS2_INTF_TO_IMPL(binding_operation)->operation = operation;
+    
+    binding_operation_impl = AXIS2_INTF_TO_IMPL(binding_operation);
+    
+    if(NULL != binding_operation_impl->operation)
+    {
+        ops = (struct axis2_operation *) (binding_operation_impl->operation);
+        AXIS2_OPERATION_FREE(ops, env);
+        binding_operation_impl->operation = NULL;
+    }
+    binding_operation_impl->operation = operation;
     return AXIS2_SUCCESS;
 }
 

Modified: webservices/axis2/trunk/c/modules/wsdl/src/wsdl_component.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl_component.c?rev=351594&r1=351593&r2=351594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_component.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_component.c Thu Dec  1 21:13:39 2005
@@ -9,6 +9,17 @@
 {
 	axis2_wsdl_component_t wsdl_component;
 	axis2_hash_t *component_properties;
+    /**
+     * Field Namespace Qualified elements that can be sticked in the component.
+     */
+    axis2_linked_list_t *elements;
+    
+    /**
+     * Field Namespace Qualified attrebutes that can be sticked int eh
+     * component.
+     */
+    axis2_linked_list_t *attributes;
+    
 } axis2_wsdl_component_impl_t;
 
 #define AXIS2_INTF_TO_IMPL(wsdl_component) \
@@ -43,7 +54,18 @@
 		                                axis2_wsdl_component_t *wsdl_component,
                                         axis2_env_t **env,
                                         const void *key);
-		
+
+
+                                        
+axis2_status_t AXIS2_CALL
+axis2_wsdl_component_add_extensibility_element(axis2_wsdl_component_t *wsdl_component,
+                                                axis2_env_t **env,
+                                                void *element);
+
+axis2_linked_list_t *AXIS2_CALL
+axis2_wsdl_component_get_extensibility_elements(axis2_wsdl_component_t *wsdl_component,
+                                                axis2_env_t **env);
+                                                
 /***************************** End of function headers ************************/
 
 axis2_wsdl_component_t * AXIS2_CALL 
@@ -51,41 +73,56 @@
 {
     AXIS2_ENV_CHECK(env, NULL);
     
-	axis2_wsdl_component_impl_t *wsdl_impl_component = 
+	axis2_wsdl_component_impl_t *wsdl_component_impl = 
         (axis2_wsdl_component_impl_t *) AXIS2_MALLOC ((*env)->allocator, 
         sizeof(axis2_wsdl_component_impl_t));
     
-	if(NULL == wsdl_impl_component)
+	if(NULL == wsdl_component_impl)
 	{
 		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
 	}
+    
+    wsdl_component_impl->component_properties = NULL;
+    wsdl_component_impl->elements = NULL;
+    wsdl_component_impl->attributes = NULL;
 	
-	wsdl_impl_component->wsdl_component.ops = (axis2_wsdl_component_ops_t *)
+    wsdl_component_impl->component_properties = axis2_hash_make (env);
+    if(NULL == wsdl_component_impl->component_properties)
+    {
+        AXIS2_FREE ((*env)->allocator, wsdl_component_impl);
+		AXIS2_ERROR_SET ((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);   
+    }
+    
+	wsdl_component_impl->wsdl_component.ops = (axis2_wsdl_component_ops_t *)
 		AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_wsdl_component_ops_t));
     
-	if(NULL == wsdl_impl_component->wsdl_component.ops)
+	if(NULL == wsdl_component_impl->wsdl_component.ops)
 	{
-		AXIS2_FREE ((*env)->allocator, wsdl_impl_component);
+		AXIS2_FREE ((*env)->allocator, wsdl_component_impl);
 		AXIS2_ERROR_SET ((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);	
 	}
     
-	wsdl_impl_component->wsdl_component.ops->free = axis2_wsdl_component_free;
+	wsdl_component_impl->wsdl_component.ops->free = axis2_wsdl_component_free;
     
-	wsdl_impl_component->wsdl_component.ops->set_component_properties =
+	wsdl_component_impl->wsdl_component.ops->set_component_properties =
         axis2_wsdl_component_set_component_properties;
     
-    wsdl_impl_component->wsdl_component.ops->get_component_properties =
+    wsdl_component_impl->wsdl_component.ops->get_component_properties =
         axis2_wsdl_component_get_component_properties;
     
-    wsdl_impl_component->wsdl_component.ops->set_component_property =
+    wsdl_component_impl->wsdl_component.ops->set_component_property =
         axis2_wsdl_component_set_component_property;
     
-    wsdl_impl_component->wsdl_component.ops->get_component_property =
+    wsdl_component_impl->wsdl_component.ops->get_component_property =
         axis2_wsdl_component_get_component_property;
     
-	wsdl_impl_component->component_properties = axis2_hash_make (env);
+    wsdl_component_impl->wsdl_component.ops->add_extensibility_element = 
+            axis2_wsdl_component_add_extensibility_element;
+    
+    wsdl_component_impl->wsdl_component.ops->get_extensibility_elements = 
+            axis2_wsdl_component_get_extensibility_elements;
 	
-	return &(wsdl_impl_component->wsdl_component);
+	return &(wsdl_component_impl->wsdl_component);
 }
 
 /******************************************************************************/
@@ -94,15 +131,23 @@
 axis2_wsdl_component_free (axis2_wsdl_component_t *wsdl_component, 
                             axis2_env_t **env)
 {
+    axis2_wsdl_component_impl_t *component_impl = NULL;
     AXIS2_FUNC_PARAM_CHECK(wsdl_component, env, AXIS2_FAILURE);
+    component_impl = AXIS2_INTF_TO_IMPL(wsdl_component);
+    
 	if(NULL != wsdl_component->ops)
         AXIS2_FREE((*env)->allocator, wsdl_component->ops);
     
-    if(NULL != AXIS2_INTF_TO_IMPL(wsdl_component)->component_properties)
-        axis2_hash_free(AXIS2_INTF_TO_IMPL(wsdl_component)->
-            component_properties, env);
+    if(NULL != component_impl->component_properties)
+        axis2_hash_free(component_impl->component_properties, env);
     
-    AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_component));
+    if(NULL != component_impl->attributes)
+        AXIS2_LINKED_LIST_FREE(component_impl->attributes, env);
+    
+    if(NULL != component_impl->elements)
+        AXIS2_LINKED_LIST_FREE(component_impl->elements, env);
+    
+    AXIS2_FREE((*env)->allocator, component_impl);
     
 	return AXIS2_SUCCESS;
 }
@@ -158,3 +203,77 @@
 	return (void *)(axis2_hash_get (AXIS2_INTF_TO_IMPL(wsdl_component)->
         component_properties, key, sizeof(key)));
 }
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_component_add_extensibility_element(axis2_wsdl_component_t *wsdl_component,
+                                                axis2_env_t **env,
+                                                void *element) 
+{
+    axis2_wsdl_component_impl_t *component_impl = NULL;
+    
+    AXIS2_FUNC_PARAM_CHECK(wsdl_component, env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, element, AXIS2_FAILURE);
+    component_impl = AXIS2_INTF_TO_IMPL(wsdl_component);
+    
+    if (NULL == component_impl->elements) 
+    {
+        component_impl->elements = axis2_linked_list_create(env);
+    }
+    
+    return AXIS2_LINKED_LIST_ADD(component_impl->elements, env, element);
+}
+
+axis2_linked_list_t *AXIS2_CALL
+axis2_wsdl_component_get_extensibility_elements(axis2_wsdl_component_t *wsdl_component,
+                                                axis2_env_t **env) 
+{
+    axis2_wsdl_component_impl_t *component_impl = NULL;
+    
+    AXIS2_FUNC_PARAM_CHECK(wsdl_component, env, NULL);
+    component_impl = AXIS2_INTF_TO_IMPL(wsdl_component);
+    
+    if (NULL == component_impl->elements) 
+    {
+        component_impl->elements = axis2_linked_list_create(env);
+    }
+    return component_impl->elements;
+}
+
+/**
+ * Adds the <code>ExtensibilityAttribute</code> as a attrebute of this
+ * Component.
+ *
+ * @param attribute <code>ExtensibilityAttribute</code>
+ */
+/*axis2_status_t AXIS2_CALL
+axis2_wsdl_component_add_extensible_attributes(WSDLExtensibilityAttribute attribute) {
+    if (NULL == this.attributes) {
+        this.attributes = new LinkedList();
+    }
+    if (null == attribute)
+        return;
+    this.attributes.add(attribute);
+}
+*/
+
+/**
+ * Returns a <code>List</code> of ExtensibleAttributes of this component.
+ *
+ * @return <code>List</code>
+ */
+/*axis2_array_list_t *AXIS2_CALL
+axis2_wsdl_component_get_extensibility_attributes(axis2_wsdl_component_t *wsdl_component,
+                                                    axis2_env_t **env) 
+{
+    axis2_wsdl_component_impl_t *component_impl = NULL;
+    
+    AXIS2_FUNC_PARAM_CHECK(wsdl_component, env, NULL);
+    component_impl = AXIS2_INTF_TO_IMPL(wsdl_component);
+    
+    if (NULL == component_impl->attributes) 
+    {
+        component_impl->attributes = axis2_linked_list_create(env);
+    }
+    return component_impl->attributes;
+}
+*/

Modified: webservices/axis2/trunk/c/modules/wsdl/src/wsdl_interface.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl_interface.c?rev=351594&r1=351593&r2=351594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_interface.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_interface.c Thu Dec  1 21:13:39 2005
@@ -75,8 +75,8 @@
 axis2_wsdl_interface_get_operations(axis2_wsdl_interface_t *wsdl_interface,
                                     axis2_env_t **env);
 
-struct axis2_operation *AXIS2_CALL
-axis2_interface_get_operation(axis2_wsdl_interface_t *wsdl_interface,
+void *AXIS2_CALL
+axis2_wsdl_interface_get_operation(axis2_wsdl_interface_t *wsdl_interface,
                                 axis2_env_t **env,
                                 axis2_char_t *nc_name);
 
@@ -111,7 +111,7 @@
 axis2_status_t AXIS2_CALL
 axis2_wsdl_interface_set_operation(axis2_wsdl_interface_t *wsdl_interface,
                                     axis2_env_t **env,
-                                    struct axis2_operation *operation);
+                                    void *operation);
 
 axis2_status_t AXIS2_CALL
 axis2_wsdl_interface_set_super_interfaces(axis2_wsdl_interface_t *wsdl_interface,
@@ -208,6 +208,9 @@
 	wsdl_interface_impl->wsdl_interface.ops->get_operations = 
         axis2_wsdl_interface_get_operations;
     
+    wsdl_interface_impl->wsdl_interface.ops->get_operation =
+        axis2_wsdl_interface_get_operation;
+    
 	wsdl_interface_impl->wsdl_interface.ops->get_super_interfaces = 
         axis2_wsdl_interface_get_super_interfaces;
   
@@ -325,8 +328,8 @@
     return AXIS2_INTF_TO_IMPL(wsdl_interface)->operations;
 }
 
-struct axis2_operation *AXIS2_CALL
-axis2_interface_get_operation(axis2_wsdl_interface_t *wsdl_interface,
+void *AXIS2_CALL
+axis2_wsdl_interface_get_operation(axis2_wsdl_interface_t *wsdl_interface,
                                 axis2_env_t **env,
                                 axis2_char_t *nc_name) 
 {
@@ -387,17 +390,19 @@
 axis2_status_t AXIS2_CALL
 axis2_wsdl_interface_set_operation(axis2_wsdl_interface_t *wsdl_interface,
                                     axis2_env_t **env,
-                                    struct axis2_operation *operation) 
+                                    void *operation) 
 {
-    
-    if (NULL == AXIS2_WSDL_OPERATION_GET_NAME(operation->wsdl_operation, env)) 
+    struct axis2_operation *operation_l = NULL;
+    operation_l = (struct axis2_operation *) operation;
+    if (NULL == AXIS2_WSDL_OPERATION_GET_NAME(operation_l->wsdl_operation, env)) 
     {
         /* The Operation name cannot be null (required) */
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_INVALID_STATE_WSDL_OPERATION, 
             AXIS2_FAILURE);
+        return AXIS2_FAILURE;
     }
     axis2_char_t *op_name = AXIS2_QNAME_GET_LOCALPART(AXIS2_WSDL_OPERATION_GET_NAME(
-        operation->wsdl_operation, env), env);
+        operation_l->wsdl_operation, env), env);
     axis2_hash_set(AXIS2_INTF_TO_IMPL(wsdl_interface)->operations, op_name,  
         AXIS2_HASH_KEY_STRING, operation);