From 06181e31ebd4a907964ede21dd59ea81c832be08 Mon Sep 17 00:00:00 2001 From: nandika Date: Sun, 21 Feb 2010 16:22:00 +0000 Subject: axis2_conf_disengage_module function added git-svn-id: http://svn.apache.org/repos/asf/axis/axis2/c/core/trunk@912367 13f79535-47bb-0310-9956-ffa450edef68 --- build/win32/configure.in | 4 ++-- include/axis2_conf.h | 12 ++++++++++ src/core/engine/conf.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 2 deletions(-) diff --git a/build/win32/configure.in b/build/win32/configure.in index 3eae3f9..0d29f4f 100644 --- a/build/win32/configure.in +++ b/build/win32/configure.in @@ -39,7 +39,7 @@ ZLIB_BIN_DIR= E:\zlib-1.2.3.win32 # # openssl binary location # required if ENABLE_SSL = 1 -OPENSSL_BIN_DIR = E:\OpenSSL +OPENSSL_BIN_DIR = F:\OpenSSL # # libcurl binary location, only required if libcurl transport is enabled LIBCURL_BIN_DIR = E:\libcurl-7.15.1-msvc-win32-ssl-0.9.8a-zlib-1.2.3 @@ -50,7 +50,7 @@ LIBCURL_BIN_DIR = E:\libcurl-7.15.1-msvc-win32-ssl-0.9.8a-zlib-1.2.3 ############################################################################# # # apache binary location -APACHE_BIN_DIR = "E:\Apache22" +APACHE_BIN_DIR = "F:\Apache2.2" # # apache 2 server family # To use apache 2.2 family, use APACHE_VERSION_IS_2_0_X = 0 diff --git a/include/axis2_conf.h b/include/axis2_conf.h index f525603..03c915f 100644 --- a/include/axis2_conf.h +++ b/include/axis2_conf.h @@ -816,6 +816,18 @@ extern "C" AXIS2_EXTERN axutil_array_list_t * AXIS2_CALL axis2_conf_get_handlers(const axis2_conf_t * conf, const axutil_env_t * env); + + /** + * Disengage a module + * @param + * + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axis2_conf_disengage_module( + const axis2_conf_t *conf, + const axutil_env_t *env, + const axutil_qname_t *module_ref + ); #ifdef __cplusplus } #endif diff --git a/src/core/engine/conf.c b/src/core/engine/conf.c index 6e81392..9efb102 100644 --- a/src/core/engine/conf.c +++ b/src/core/engine/conf.c @@ -1833,3 +1833,63 @@ axis2_conf_get_handlers( return conf->handlers; } +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axis2_conf_disengage_module( + const axis2_conf_t *conf, + const axutil_env_t *env, + const axutil_qname_t *module_ref) +{ + axis2_module_desc_t *module_desc = NULL; + axutil_hash_index_t *index = NULL; + axis2_char_t *mod_name = NULL; + int size = 0, i = 0; + if(!module_ref) + return AXIS2_FAILURE; + + mod_name = axutil_qname_get_localpart(module_ref, env); + module_desc = axis2_conf_get_module(conf, env, module_ref); + if(!module_desc) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "The requested module %s does not exist", + mod_name); + return AXIS2_FAILURE; + } + if(!axis2_conf_is_engaged((axis2_conf_t*)conf, env, module_ref)) + { + AXIS2_LOG_INFO(env->log, AXIS2_LOG_SI, "%s Module is not engaged globally", mod_name); + return AXIS2_FAILURE; + } + if(!conf->all_svcs) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "configuration does not have any services"); + return AXIS2_FAILURE; + + } + for(index = axutil_hash_first(conf->all_svcs, env); index; index = axutil_hash_next(env, index)) + { + axis2_svc_t *svc = NULL; + void *v = NULL; + const axis2_char_t *svc_name = NULL; + axutil_hash_this(index, NULL, NULL, &v); + svc = (axis2_svc_t *)v; + if(svc) + { + svc_name = axis2_svc_get_name(svc, env); + axis2_svc_disengage_module(svc, env, module_desc,(axis2_conf_t*) conf); + } + } + + size = axutil_array_list_size(conf->engaged_module_list, env); + for(i = 0; i < size; i++) + { + axutil_qname_t *qname = NULL; + qname = (axutil_qname_t *)axutil_array_list_get(conf->engaged_module_list, env, i); + if(axutil_qname_equals(module_ref, env, qname)) + { + axutil_array_list_remove(conf->engaged_module_list, env, i); + return AXIS2_SUCCESS; + } + } + + return AXIS2_FAILURE; +} \ No newline at end of file -- cgit v1.1-32-gdbae