AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_svc_disengage_module( axis2_svc_t * svc, const axutil_env_t * env, axis2_module_desc_t * module_desc, axis2_conf_t * conf) { axis2_phase_resolver_t *phase_resolver = NULL; axis2_status_t status = AXIS2_FAILURE; const axis2_char_t *svcname = NULL; AXIS2_PARAM_CHECK(env->error, module_desc, AXIS2_FAILURE); AXIS2_PARAM_CHECK(env->error, conf, AXIS2_FAILURE); svcname = axis2_svc_get_name(svc, env); phase_resolver = axis2_phase_resolver_create_with_config(env, conf); if (!phase_resolver) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating phase resolver failed for service %s", svcname); return AXIS2_FAILURE; } status = axis2_phase_resolver_disengage_module_from_svc(phase_resolver, env, svc, module_desc); axis2_phase_resolver_free(phase_resolver, env); return status; }
AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_svc_disengage_module( axis2_svc_t * svc, const axutil_env_t * env, axis2_module_desc_t * module_desc, axis2_conf_t * conf) { axis2_phase_resolver_t *phase_resolver = NULL; axis2_status_t status = AXIS2_FAILURE; const axis2_char_t *svcname = NULL; AXIS2_PARAM_CHECK(env->error, module_desc, AXIS2_FAILURE); AXIS2_PARAM_CHECK(env->error, conf, AXIS2_FAILURE); svcname = axis2_svc_get_name(svc, env); phase_resolver = axis2_phase_resolver_create_with_config(env, conf); if(!phase_resolver) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating phase resolver failed for service %s", svcname); return AXIS2_FAILURE; } status = axis2_phase_resolver_disengage_module_from_svc(phase_resolver, env, svc, module_desc); if(status == AXIS2_SUCCESS) { /** Remove this module from the engaged modules list */ const axutil_qname_t *mod_qname = NULL; int i = 0, size = 0; mod_qname = axis2_module_desc_get_qname(module_desc, env); size = axutil_array_list_size(svc->engaged_module_list, env); for(i = 0; i < size; i++) { const axutil_qname_t *module_qname_l = NULL; axis2_module_desc_t *module_desc_l = NULL; module_desc_l = (axis2_module_desc_t *)axutil_array_list_get(svc->engaged_module_list, env, i); module_qname_l = axis2_module_desc_get_qname(module_desc_l, env); if(axutil_qname_equals(mod_qname, env, module_qname_l)) { axutil_array_list_remove(svc->engaged_module_list, env, i); break; } } } axis2_phase_resolver_free(phase_resolver, env); return status; }
AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_svc_engage_module( axis2_svc_t * svc, const axutil_env_t * env, axis2_module_desc_t * module_desc, axis2_conf_t * conf) { axis2_phase_resolver_t *phase_resolver = NULL; axis2_status_t status = AXIS2_FAILURE; const axis2_char_t *svcname = NULL; AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Entry:axis2_svc_engage_module"); AXIS2_PARAM_CHECK(env->error, module_desc, AXIS2_FAILURE); AXIS2_PARAM_CHECK(env->error, conf, AXIS2_FAILURE); svcname = axis2_svc_get_name(svc, env); phase_resolver = axis2_phase_resolver_create_with_config(env, conf); if (!phase_resolver) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating phase resolver failed for service %s", svcname); return AXIS2_FAILURE; } status = axis2_phase_resolver_engage_module_to_svc(phase_resolver, env, svc, module_desc); if (status) { const axutil_qname_t *qname = NULL; status = axutil_array_list_add(svc->engaged_module_list, env, module_desc); qname = axis2_module_desc_get_qname(module_desc, env); axis2_svc_add_module_qname(svc, env, qname); } if (phase_resolver) { axis2_phase_resolver_free(phase_resolver, env); } AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Exit:axis2_svc_engage_module"); return status; }
/** * Here we extract all operations defined in module.xml and built execution * chains for them by calling axis2_phase_resolver_build_execution_chains_for_module_op() * function. Within that function handlers of the modules defined for that * operation are added to module operation chains appropriately. */ AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_svc_add_module_ops( axis2_svc_t * svc, const axutil_env_t * env, axis2_module_desc_t * module_desc, axis2_conf_t * conf) { axutil_hash_t *map = NULL; axutil_hash_index_t *hash_idx = NULL; axis2_phase_resolver_t *phase_resolver = NULL; axis2_op_t *op_desc = NULL; axis2_status_t status = AXIS2_FAILURE; const axis2_char_t *svcname = NULL; axis2_char_t *modname = NULL; axis2_char_t *opname = NULL; AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Entry:axis2_svc_add_module_ops"); AXIS2_PARAM_CHECK(env->error, module_desc, AXIS2_FAILURE); AXIS2_PARAM_CHECK(env->error, conf, AXIS2_FAILURE); svcname = axis2_svc_get_name(svc, env); modname = axutil_qname_get_localpart(axis2_module_desc_get_qname(module_desc, env), env); map = axis2_module_desc_get_all_ops(module_desc, env); phase_resolver = axis2_phase_resolver_create_with_config_and_svc(env, conf, svc); if(!phase_resolver) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating phase resolver failed for service %s", svcname); return AXIS2_FAILURE; } for(hash_idx = axutil_hash_first(map, env); hash_idx; hash_idx = axutil_hash_next(env, hash_idx)) { void *v = NULL; axutil_hash_this(hash_idx, NULL, NULL, &v); op_desc = (axis2_op_t *)v; opname = axutil_qname_get_localpart(axis2_op_get_qname(op_desc, env), env); status = axis2_phase_resolver_build_execution_chains_for_module_op(phase_resolver, env, op_desc); if(AXIS2_SUCCESS != status) { axis2_phase_resolver_free(phase_resolver, env); AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Builidng module operation %s failed for module %s", opname, modname); return status; } status = axis2_svc_add_op(svc, env, op_desc); if(AXIS2_SUCCESS != status) { axis2_phase_resolver_free(phase_resolver, env); AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Adding operation %s to service %s failed", opname, svcname); return status; } } axis2_phase_resolver_free(phase_resolver, env); AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Exit:axis2_svc_add_module_ops"); return AXIS2_SUCCESS; }