axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r494687 [3/4] - in /webservices/axis2/trunk/c: include/ modules/core/context/ modules/core/engine/
Date Wed, 10 Jan 2007 02:11:16 GMT
Modified: webservices/axis2/trunk/c/modules/core/context/conf_ctx.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/context/conf_ctx.c?view=diff&rev=494687&r1=494686&r2=494687
==============================================================================
--- webservices/axis2/trunk/c/modules/core/context/conf_ctx.c (original)
+++ webservices/axis2/trunk/c/modules/core/context/conf_ctx.c Tue Jan  9 18:11:15 2007
@@ -20,10 +20,8 @@
 #include <axis2_const.h>
 #include <axis2_uuid_gen.h>
 
-typedef struct axis2_conf_ctx_impl
+struct axis2_conf_ctx
 {
-    /** configuration context interface struct */
-    axis2_conf_ctx_t conf_ctx;
     /** base context struct */
     axis2_ctx_t *base;
     /** engine configuration */
@@ -43,495 +41,303 @@
 
     /* Mutex to synchronize the read/write operations */
     axis2_thread_mutex_t *mutex;
-}
-axis2_conf_ctx_impl_t;
-
-/** Interface to implementation conversion macro */
-#define AXIS2_INTF_TO_IMPL(conf_ctx) ((axis2_conf_ctx_impl_t *)conf_ctx)
-
-
-axis2_status_t AXIS2_CALL
-axis2_conf_ctx_set_conf(
-    axis2_conf_ctx_t *conf_ctx,
-    const axis2_env_t *env,
-    axis2_conf_t *conf);
-
-axis2_ctx_t *AXIS2_CALL
-axis2_conf_ctx_get_base(
-    const axis2_conf_ctx_t *conf_ctx,
-    const axis2_env_t *env);
-
-axis2_conf_t *AXIS2_CALL
-axis2_conf_ctx_get_conf(
-    const axis2_conf_ctx_t *conf_ctx,
-    const axis2_env_t *env);
-
-axis2_hash_t *AXIS2_CALL
-axis2_conf_ctx_get_op_ctx_map(
-    const axis2_conf_ctx_t *conf_ctx,
-    const axis2_env_t *env);
-
-axis2_hash_t *AXIS2_CALL
-axis2_conf_ctx_get_svc_ctx_map(
-    const axis2_conf_ctx_t *conf_ctx,
-    const axis2_env_t *env);
-
-axis2_hash_t *AXIS2_CALL
-axis2_conf_ctx_get_svc_grp_ctx_map(
-    const axis2_conf_ctx_t *conf_ctx,
-    const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_conf_ctx_register_op_ctx(
-    axis2_conf_ctx_t *conf_ctx,
-    const axis2_env_t *env,
-    const axis2_char_t *message_id,
-    axis2_op_ctx_t *op_ctx);
-
-axis2_op_ctx_t *AXIS2_CALL
-axis2_conf_ctx_get_op_ctx(
-    const axis2_conf_ctx_t *conf_ctx,
-    const axis2_env_t *env,
-    const axis2_char_t *message_id);
-
-axis2_status_t AXIS2_CALL
-axis2_conf_ctx_register_svc_ctx(
-    axis2_conf_ctx_t *conf_ctx,
-    const axis2_env_t *env,
-    const axis2_char_t *svc_id,
-    axis2_svc_ctx_t *svc_ctx);
-
-axis2_svc_ctx_t *AXIS2_CALL
-axis2_conf_ctx_get_svc_ctx(
-    const axis2_conf_ctx_t *conf_ctx,
-    const axis2_env_t *env,
-    const axis2_char_t *svc_id);
-
-axis2_status_t AXIS2_CALL
-axis2_conf_ctx_register_svc_grp_ctx(
-    axis2_conf_ctx_t *conf_ctx,
-    const axis2_env_t *env,
-    const axis2_char_t *svc_grp_id,
-    axis2_svc_grp_ctx_t *svc_grp_ctx);
-
-axis2_svc_grp_ctx_t *AXIS2_CALL
-axis2_conf_ctx_get_svc_grp_ctx(
-    const axis2_conf_ctx_t *conf_ctx,
-    const axis2_env_t *env,
-    const axis2_char_t *svc_grp_id);
-
-const axis2_char_t *AXIS2_CALL
-axis2_conf_ctx_get_root_dir(
-    const axis2_conf_ctx_t *conf_ctx,
-    const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_conf_ctx_set_root_dir(
-    axis2_conf_ctx_t *conf_ctx,
-    const axis2_env_t *env,
-    const axis2_char_t *path);
-
-axis2_status_t AXIS2_CALL
-axis2_conf_ctx_init(
-    axis2_conf_ctx_t *conf_ctx,
-    const axis2_env_t *env,
-    axis2_conf_t *conf);
-
-axis2_status_t AXIS2_CALL
-axis2_conf_ctx_free(
-    axis2_conf_ctx_t *conf_ctx,
-    const axis2_env_t *env);
-
-axis2_svc_grp_ctx_t *AXIS2_CALL
-axis2_conf_ctx_fill_ctxs(
-    axis2_conf_ctx_t *conf_ctx,
-    const axis2_env_t *env,
-    axis2_msg_ctx_t *msg_ctx);
+};
 
 AXIS2_EXTERN axis2_conf_ctx_t *AXIS2_CALL
 axis2_conf_ctx_create(
     const axis2_env_t *env,
     axis2_conf_t *conf)
 {
-    axis2_conf_ctx_impl_t *conf_ctx_impl = NULL;
+    axis2_conf_ctx_t *conf_ctx = NULL;
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    conf_ctx_impl = AXIS2_MALLOC(env->allocator, sizeof(axis2_conf_ctx_impl_t));
-    if (!conf_ctx_impl)
+    conf_ctx = AXIS2_MALLOC(env->allocator, sizeof(axis2_conf_ctx_t));
+    if (!conf_ctx)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
 
-    conf_ctx_impl->conf_ctx.ops = NULL;
-    conf_ctx_impl->base = NULL;
-    conf_ctx_impl->conf = NULL;
-    conf_ctx_impl->root_dir = NULL;
-    conf_ctx_impl->op_ctx_map = NULL;
-    conf_ctx_impl->svc_ctx_map = NULL;
-    conf_ctx_impl->svc_grp_ctx_map = NULL;
-    conf_ctx_impl->mutex = axis2_thread_mutex_create(env->allocator,
+    conf_ctx->base = NULL;
+    conf_ctx->conf = NULL;
+    conf_ctx->root_dir = NULL;
+    conf_ctx->op_ctx_map = NULL;
+    conf_ctx->svc_ctx_map = NULL;
+    conf_ctx->svc_grp_ctx_map = NULL;
+    conf_ctx->mutex = axis2_thread_mutex_create(env->allocator,
             AXIS2_THREAD_MUTEX_DEFAULT);
-    if (NULL == conf_ctx_impl->mutex)
+    if (NULL == conf_ctx->mutex)
     {
-        axis2_conf_ctx_free(&(conf_ctx_impl->conf_ctx), env);
+        axis2_conf_ctx_free(conf_ctx, env);
         return NULL;
     }
 
     if (conf)
-        conf_ctx_impl->conf = conf;
+        conf_ctx->conf = conf;
 
-    conf_ctx_impl->base = axis2_ctx_create(env);
-    if (!(conf_ctx_impl->base))
+    conf_ctx->base = axis2_ctx_create(env);
+    if (!(conf_ctx->base))
     {
-        axis2_conf_ctx_free(&(conf_ctx_impl->conf_ctx), env);
+        axis2_conf_ctx_free(conf_ctx, env);
         return NULL;
     }
 
-    conf_ctx_impl->op_ctx_map = axis2_hash_make(env);
-    if (!(conf_ctx_impl->op_ctx_map))
+    conf_ctx->op_ctx_map = axis2_hash_make(env);
+    if (!(conf_ctx->op_ctx_map))
     {
-        axis2_conf_ctx_free(&(conf_ctx_impl->conf_ctx), env);
+        axis2_conf_ctx_free(conf_ctx, env);
         return NULL;
     }
 
-    conf_ctx_impl->svc_ctx_map = axis2_hash_make(env);
-    if (!(conf_ctx_impl->svc_ctx_map))
+    conf_ctx->svc_ctx_map = axis2_hash_make(env);
+    if (!(conf_ctx->svc_ctx_map))
     {
-        axis2_conf_ctx_free(&(conf_ctx_impl->conf_ctx), env);
+        axis2_conf_ctx_free(conf_ctx, env);
         return NULL;
     }
 
-    conf_ctx_impl->svc_grp_ctx_map = axis2_hash_make(env);
-    if (!(conf_ctx_impl->svc_grp_ctx_map))
+    conf_ctx->svc_grp_ctx_map = axis2_hash_make(env);
+    if (!(conf_ctx->svc_grp_ctx_map))
     {
-        axis2_conf_ctx_free(&(conf_ctx_impl->conf_ctx), env);
+        axis2_conf_ctx_free(conf_ctx, env);
         return NULL;
     }
 
-    /* initialize ops */
-    conf_ctx_impl->conf_ctx.ops  =
-        AXIS2_MALLOC(env->allocator, sizeof(axis2_conf_ctx_ops_t));
-
-    if (!conf_ctx_impl->conf_ctx.ops)
-    {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        axis2_conf_ctx_free(&(conf_ctx_impl->conf_ctx), env);
-        return NULL;
-    }
-
-    conf_ctx_impl->conf_ctx.ops->free =
-        axis2_conf_ctx_free;
-
-    conf_ctx_impl->conf_ctx.ops->set_conf =
-        axis2_conf_ctx_set_conf;
-
-    conf_ctx_impl->conf_ctx.ops->get_base =
-        axis2_conf_ctx_get_base;
-
-    conf_ctx_impl->conf_ctx.ops->get_conf =
-        axis2_conf_ctx_get_conf;
-
-    conf_ctx_impl->conf_ctx.ops->get_op_ctx_map =
-        axis2_conf_ctx_get_op_ctx_map;
-
-    conf_ctx_impl->conf_ctx.ops->get_svc_ctx_map =
-        axis2_conf_ctx_get_svc_ctx_map;
-
-    conf_ctx_impl->conf_ctx.ops->get_svc_grp_ctx_map =
-        axis2_conf_ctx_get_svc_grp_ctx_map;
-
-    conf_ctx_impl->conf_ctx.ops->register_op_ctx =
-        axis2_conf_ctx_register_op_ctx;
-
-    conf_ctx_impl->conf_ctx.ops->get_op_ctx =
-        axis2_conf_ctx_get_op_ctx;
-
-    conf_ctx_impl->conf_ctx.ops->register_svc_ctx =
-        axis2_conf_ctx_register_svc_ctx;
-
-    conf_ctx_impl->conf_ctx.ops->get_svc_ctx =
-        axis2_conf_ctx_get_svc_ctx;
-
-    conf_ctx_impl->conf_ctx.ops->register_svc_grp_ctx =
-        axis2_conf_ctx_register_svc_grp_ctx;
-
-    conf_ctx_impl->conf_ctx.ops->get_svc_grp_ctx =
-        axis2_conf_ctx_get_svc_grp_ctx;
-
-    conf_ctx_impl->conf_ctx.ops->get_root_dir =
-        axis2_conf_ctx_get_root_dir;
-
-    conf_ctx_impl->conf_ctx.ops->set_root_dir =
-        axis2_conf_ctx_set_root_dir;
-
-    conf_ctx_impl->conf_ctx.ops->init =
-        axis2_conf_ctx_init;
-
-    conf_ctx_impl->conf_ctx.ops->fill_ctxs =
-        axis2_conf_ctx_fill_ctxs;
-
-    return &(conf_ctx_impl->conf_ctx);
+    return conf_ctx;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_conf_ctx_set_conf(
     axis2_conf_ctx_t *conf_ctx,
     const axis2_env_t *env,
     axis2_conf_t *conf)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_INTF_TO_IMPL(conf_ctx)->conf = conf; /* we just maintain a shallow copy here
*/
+    conf_ctx->conf = conf; /* we just maintain a shallow copy here */
     return AXIS2_SUCCESS;
 }
 
-axis2_ctx_t *AXIS2_CALL
+AXIS2_EXTERN axis2_ctx_t *AXIS2_CALL
 axis2_conf_ctx_get_base(
     const axis2_conf_ctx_t *conf_ctx,
     const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return AXIS2_INTF_TO_IMPL(conf_ctx)->base;
+    return conf_ctx->base;
 }
 
-axis2_conf_t *AXIS2_CALL
+AXIS2_EXTERN axis2_conf_t *AXIS2_CALL
 axis2_conf_ctx_get_conf(
     const axis2_conf_ctx_t *conf_ctx,
     const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return AXIS2_INTF_TO_IMPL(conf_ctx)->conf;
+    return conf_ctx->conf;
 }
 
-axis2_hash_t *AXIS2_CALL
+AXIS2_EXTERN axis2_hash_t *AXIS2_CALL
 axis2_conf_ctx_get_op_ctx_map(
     const axis2_conf_ctx_t *conf_ctx,
     const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return AXIS2_INTF_TO_IMPL(conf_ctx)->op_ctx_map;
+    return conf_ctx->op_ctx_map;
 }
 
-axis2_hash_t *AXIS2_CALL
+AXIS2_EXTERN axis2_hash_t *AXIS2_CALL
 axis2_conf_ctx_get_svc_ctx_map(
     const axis2_conf_ctx_t *conf_ctx,
     const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return AXIS2_INTF_TO_IMPL(conf_ctx)->svc_ctx_map;
+    return conf_ctx->svc_ctx_map;
 }
 
-axis2_hash_t *AXIS2_CALL
+AXIS2_EXTERN axis2_hash_t *AXIS2_CALL
 axis2_conf_ctx_get_svc_grp_ctx_map(
     const axis2_conf_ctx_t *conf_ctx,
     const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return AXIS2_INTF_TO_IMPL(conf_ctx)->svc_grp_ctx_map;
+    return conf_ctx->svc_grp_ctx_map;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_conf_ctx_register_op_ctx(
     axis2_conf_ctx_t *conf_ctx,
     const axis2_env_t *env,
     const axis2_char_t *message_id,
     axis2_op_ctx_t *op_ctx)
 {
-    axis2_conf_ctx_impl_t *conf_ctx_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    conf_ctx_impl = AXIS2_INTF_TO_IMPL(conf_ctx);
-    axis2_thread_mutex_lock(conf_ctx_impl->mutex);
-    if (conf_ctx_impl->op_ctx_map)
+    axis2_thread_mutex_lock(conf_ctx->mutex);
+    if (conf_ctx->op_ctx_map)
     {
-        axis2_hash_set(conf_ctx_impl->op_ctx_map,
+        axis2_hash_set(conf_ctx->op_ctx_map,
                 message_id, AXIS2_HASH_KEY_STRING, op_ctx);
     }
-    axis2_thread_mutex_unlock(conf_ctx_impl->mutex);
+    axis2_thread_mutex_unlock(conf_ctx->mutex);
     return AXIS2_SUCCESS;
 }
 
-axis2_op_ctx_t *AXIS2_CALL
+AXIS2_EXTERN axis2_op_ctx_t *AXIS2_CALL
 axis2_conf_ctx_get_op_ctx(
     const axis2_conf_ctx_t *conf_ctx,
     const axis2_env_t *env,
     const axis2_char_t *message_id)
 {
-    axis2_conf_ctx_impl_t *conf_ctx_impl = NULL;
     axis2_op_ctx_t *rv = NULL;
 
     AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, message_id, NULL);
 
-    conf_ctx_impl = AXIS2_INTF_TO_IMPL(conf_ctx);
-    axis2_thread_mutex_lock(conf_ctx_impl->mutex);
-    if (conf_ctx_impl->op_ctx_map)
+    axis2_thread_mutex_lock(conf_ctx->mutex);
+    if (conf_ctx->op_ctx_map)
     {
-        rv = (axis2_op_ctx_t*)axis2_hash_get(conf_ctx_impl->op_ctx_map,
+        rv = (axis2_op_ctx_t*)axis2_hash_get(conf_ctx->op_ctx_map,
                 message_id, AXIS2_HASH_KEY_STRING);
-
-        /*axis2_thread_mutex_unlock(conf_ctx_impl->mutex);*/
     }
-    axis2_thread_mutex_unlock(conf_ctx_impl->mutex);
+    axis2_thread_mutex_unlock(conf_ctx->mutex);
     return rv;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_conf_ctx_register_svc_ctx(
     axis2_conf_ctx_t *conf_ctx,
     const axis2_env_t *env,
     const axis2_char_t *svc_id,
     axis2_svc_ctx_t *svc_ctx)
 {
-    axis2_conf_ctx_impl_t *conf_ctx_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    conf_ctx_impl = AXIS2_INTF_TO_IMPL(conf_ctx);
-    axis2_thread_mutex_lock(conf_ctx_impl->mutex);
-    if (conf_ctx_impl->svc_ctx_map)
+    axis2_thread_mutex_lock(conf_ctx->mutex);
+    if (conf_ctx->svc_ctx_map)
     {
-        axis2_hash_set(conf_ctx_impl->svc_ctx_map,
+        axis2_hash_set(conf_ctx->svc_ctx_map,
                 svc_id, AXIS2_HASH_KEY_STRING, svc_ctx);
     }
-    axis2_thread_mutex_unlock(conf_ctx_impl->mutex);
+    axis2_thread_mutex_unlock(conf_ctx->mutex);
     return AXIS2_SUCCESS;
 }
 
-axis2_svc_ctx_t *AXIS2_CALL
+AXIS2_EXTERN axis2_svc_ctx_t *AXIS2_CALL
 axis2_conf_ctx_get_svc_ctx(
     const axis2_conf_ctx_t *conf_ctx,
     const axis2_env_t *env,
     const axis2_char_t *svc_id)
 {
-    axis2_conf_ctx_impl_t *conf_ctx_impl = NULL;
     axis2_svc_ctx_t *rv = NULL;
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    conf_ctx_impl = AXIS2_INTF_TO_IMPL(conf_ctx);
-    axis2_thread_mutex_lock(conf_ctx_impl->mutex);
-    if (conf_ctx_impl->svc_ctx_map)
+    axis2_thread_mutex_lock(conf_ctx->mutex);
+    if (conf_ctx->svc_ctx_map)
     {
-        rv = (axis2_svc_ctx_t*)axis2_hash_get(conf_ctx_impl->svc_ctx_map,
+        rv = (axis2_svc_ctx_t*)axis2_hash_get(conf_ctx->svc_ctx_map,
                 svc_id, AXIS2_HASH_KEY_STRING);
-        /*axis2_thread_mutex_unlock(conf_ctx_impl->mutex);*/
     }
-    axis2_thread_mutex_unlock(conf_ctx_impl->mutex);
+    axis2_thread_mutex_unlock(conf_ctx->mutex);
     return rv;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_conf_ctx_register_svc_grp_ctx(
     axis2_conf_ctx_t *conf_ctx,
     const axis2_env_t *env,
     const axis2_char_t *svc_grp_id,
     axis2_svc_grp_ctx_t *svc_grp_ctx)
 {
-    axis2_conf_ctx_impl_t *conf_ctx_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    conf_ctx_impl = AXIS2_INTF_TO_IMPL(conf_ctx);
-    axis2_thread_mutex_lock(conf_ctx_impl->mutex);
-    if (conf_ctx_impl->svc_grp_ctx_map)
+    axis2_thread_mutex_lock(conf_ctx->mutex);
+    if (conf_ctx->svc_grp_ctx_map)
     {
-        axis2_hash_set(conf_ctx_impl->svc_grp_ctx_map,
+        axis2_hash_set(conf_ctx->svc_grp_ctx_map,
                 svc_grp_id, AXIS2_HASH_KEY_STRING, svc_grp_ctx);
     }
-    axis2_thread_mutex_unlock(conf_ctx_impl->mutex);
+    axis2_thread_mutex_unlock(conf_ctx->mutex);
     return AXIS2_SUCCESS;
 }
 
-axis2_svc_grp_ctx_t *AXIS2_CALL
+AXIS2_EXTERN axis2_svc_grp_ctx_t *AXIS2_CALL
 axis2_conf_ctx_get_svc_grp_ctx(
     const axis2_conf_ctx_t *conf_ctx,
     const axis2_env_t *env,
     const axis2_char_t *svc_grp_id)
 {
-    axis2_conf_ctx_impl_t *conf_ctx_impl = NULL;
     axis2_svc_grp_ctx_t *rv = NULL;
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    conf_ctx_impl = AXIS2_INTF_TO_IMPL(conf_ctx);
-    axis2_thread_mutex_lock(conf_ctx_impl->mutex);
-    if (conf_ctx_impl->svc_grp_ctx_map)
-    {
-        rv = (axis2_svc_grp_ctx_t*)axis2_hash_get(conf_ctx_impl->svc_grp_ctx_map
-                , svc_grp_id, AXIS2_HASH_KEY_STRING);
-        /*axis2_thread_mutex_unlock(conf_ctx_impl->mutex);*/
+    axis2_thread_mutex_lock(conf_ctx->mutex);
+    if (conf_ctx->svc_grp_ctx_map)
+    {
+        rv = (axis2_svc_grp_ctx_t*)axis2_hash_get(conf_ctx->svc_grp_ctx_map, 
+            svc_grp_id, AXIS2_HASH_KEY_STRING);
     }
-    axis2_thread_mutex_unlock(conf_ctx_impl->mutex);
+    axis2_thread_mutex_unlock(conf_ctx->mutex);
     return rv;
 }
 
-const axis2_char_t *AXIS2_CALL
+AXIS2_EXTERN const axis2_char_t *AXIS2_CALL
 axis2_conf_ctx_get_root_dir(
     const axis2_conf_ctx_t *conf_ctx,
     const axis2_env_t *env)
 {
     axis2_char_t *rv = NULL;
-    axis2_conf_ctx_impl_t *conf_ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    conf_ctx_impl = AXIS2_INTF_TO_IMPL(conf_ctx);
-    axis2_thread_mutex_lock(conf_ctx_impl->mutex);
-    rv = AXIS2_INTF_TO_IMPL(conf_ctx)->root_dir;
-    axis2_thread_mutex_unlock(conf_ctx_impl->mutex);
+    axis2_thread_mutex_lock(conf_ctx->mutex);
+    rv = conf_ctx->root_dir;
+    axis2_thread_mutex_unlock(conf_ctx->mutex);
     return rv;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_conf_ctx_set_root_dir(
     axis2_conf_ctx_t *conf_ctx,
     const axis2_env_t *env,
     const axis2_char_t *path)
 {
-    axis2_conf_ctx_impl_t *conf_ctx_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    conf_ctx_impl = AXIS2_INTF_TO_IMPL(conf_ctx);
-    axis2_thread_mutex_lock(conf_ctx_impl->mutex);
-    if (conf_ctx_impl->root_dir)
+    axis2_thread_mutex_lock(conf_ctx->mutex);
+    if (conf_ctx->root_dir)
     {
-        AXIS2_FREE(env->allocator, conf_ctx_impl->root_dir);
-        conf_ctx_impl->root_dir = NULL;
+        AXIS2_FREE(env->allocator, conf_ctx->root_dir);
+        conf_ctx->root_dir = NULL;
     }
 
     if (path)
     {
-        conf_ctx_impl->root_dir = AXIS2_STRDUP(path, env);
-        if (!(conf_ctx_impl->root_dir))
+        conf_ctx->root_dir = AXIS2_STRDUP(path, env);
+        if (!(conf_ctx->root_dir))
         {
             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-            axis2_thread_mutex_unlock(conf_ctx_impl->mutex);
+            axis2_thread_mutex_unlock(conf_ctx->mutex);
             return AXIS2_FAILURE;
         }
     }
-    axis2_thread_mutex_unlock(conf_ctx_impl->mutex);
+    axis2_thread_mutex_unlock(conf_ctx->mutex);
     return AXIS2_SUCCESS;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_conf_ctx_init(
     axis2_conf_ctx_t *conf_ctx,
     const axis2_env_t *env,
     axis2_conf_t *conf)
 {
-    axis2_conf_ctx_impl_t *conf_ctx_impl = NULL;
     axis2_hash_index_t *hi = NULL;
     void *ctx = NULL;
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    conf_ctx_impl = AXIS2_INTF_TO_IMPL(conf_ctx);
-    axis2_thread_mutex_lock(conf_ctx_impl->mutex);
-    conf_ctx_impl->conf = conf;
+    axis2_thread_mutex_lock(conf_ctx->mutex);
+    conf_ctx->conf = conf;
 
-    for (hi = axis2_hash_first(conf_ctx_impl->op_ctx_map, env);
+    for (hi = axis2_hash_first(conf_ctx->op_ctx_map, env);
             hi; hi = axis2_hash_next(env, hi))
     {
         axis2_hash_this(hi, NULL, NULL, &ctx);
@@ -542,7 +348,7 @@
         }
     }
 
-    for (hi = axis2_hash_first(conf_ctx_impl->svc_ctx_map, env);
+    for (hi = axis2_hash_first(conf_ctx->svc_ctx_map, env);
             hi; hi = axis2_hash_next(env, hi))
     {
         axis2_hash_this(hi, NULL, NULL, &ctx);
@@ -553,7 +359,7 @@
         }
     }
 
-    for (hi = axis2_hash_first(conf_ctx_impl->svc_grp_ctx_map, env);
+    for (hi = axis2_hash_first(conf_ctx->svc_grp_ctx_map, env);
             hi; hi = axis2_hash_next(env, hi))
     {
         axis2_hash_this(hi, NULL, NULL, &ctx);
@@ -563,38 +369,28 @@
             AXIS2_SVC_GRP_CTX_INIT(svc_grp_ctx, env, conf);
         }
     }
-    axis2_thread_mutex_unlock(conf_ctx_impl->mutex);
+    axis2_thread_mutex_unlock(conf_ctx->mutex);
     return AXIS2_SUCCESS;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_conf_ctx_free(
     axis2_conf_ctx_t *conf_ctx,
     const axis2_env_t *env)
 {
-    axis2_conf_ctx_impl_t *conf_ctx_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    conf_ctx_impl = AXIS2_INTF_TO_IMPL(conf_ctx);
-
-    if (conf_ctx_impl->conf_ctx.ops)
-    {
-        AXIS2_FREE(env->allocator, conf_ctx_impl->conf_ctx.ops);
-        conf_ctx_impl->conf_ctx.ops = NULL;
-    }
-
-    if (conf_ctx_impl->base)
+    if (conf_ctx->base)
     {
-        AXIS2_CTX_FREE(conf_ctx_impl->base, env);
-        conf_ctx_impl->base = NULL;
+        AXIS2_CTX_FREE(conf_ctx->base, env);
+        conf_ctx->base = NULL;
     }
 
-    if (conf_ctx_impl->op_ctx_map)
+    if (conf_ctx->op_ctx_map)
     {
         axis2_hash_index_t *hi = NULL;
         void *val = NULL;
-        for (hi = axis2_hash_first(conf_ctx_impl->op_ctx_map, env); hi;
+        for (hi = axis2_hash_first(conf_ctx->op_ctx_map, env); hi;
                 hi = axis2_hash_next(env, hi))
         {
             axis2_op_ctx_t *op_ctx = NULL;
@@ -607,15 +403,15 @@
             op_ctx = NULL;
 
         }
-        axis2_hash_free(conf_ctx_impl->op_ctx_map, env);
-        conf_ctx_impl->op_ctx_map = NULL;
+        axis2_hash_free(conf_ctx->op_ctx_map, env);
+        conf_ctx->op_ctx_map = NULL;
     }
 
-    if (conf_ctx_impl->svc_ctx_map)
+    if (conf_ctx->svc_ctx_map)
     {
         axis2_hash_index_t *hi = NULL;
         void *val = NULL;
-        for (hi = axis2_hash_first(conf_ctx_impl->svc_ctx_map, env); hi;
+        for (hi = axis2_hash_first(conf_ctx->svc_ctx_map, env); hi;
                 hi = axis2_hash_next(env, hi))
         {
             axis2_svc_ctx_t *svc_ctx = NULL;
@@ -628,15 +424,15 @@
             svc_ctx = NULL;
 
         }
-        axis2_hash_free(conf_ctx_impl->svc_ctx_map, env);
-        conf_ctx_impl->svc_ctx_map = NULL;
+        axis2_hash_free(conf_ctx->svc_ctx_map, env);
+        conf_ctx->svc_ctx_map = NULL;
     }
 
-    if (conf_ctx_impl->svc_grp_ctx_map)
+    if (conf_ctx->svc_grp_ctx_map)
     {
         axis2_hash_index_t *hi = NULL;
         void *val = NULL;
-        for (hi = axis2_hash_first(conf_ctx_impl->svc_grp_ctx_map, env); hi;
+        for (hi = axis2_hash_first(conf_ctx->svc_grp_ctx_map, env); hi;
                 hi = axis2_hash_next(env, hi))
         {
             axis2_svc_grp_ctx_t *svc_grp_ctx = NULL;
@@ -649,33 +445,32 @@
             svc_grp_ctx = NULL;
 
         }
-        axis2_hash_free(conf_ctx_impl->svc_grp_ctx_map, env);
-        conf_ctx_impl->svc_grp_ctx_map = NULL;
+        axis2_hash_free(conf_ctx->svc_grp_ctx_map, env);
+        conf_ctx->svc_grp_ctx_map = NULL;
     }
-    if (conf_ctx_impl->conf)
+    if (conf_ctx->conf)
     {
-        AXIS2_CONF_FREE(conf_ctx_impl->conf, env);
-        conf_ctx_impl->conf = NULL;
+        AXIS2_CONF_FREE(conf_ctx->conf, env);
+        conf_ctx->conf = NULL;
     }
-    if (conf_ctx_impl->mutex)
+    if (conf_ctx->mutex)
     {
-        axis2_thread_mutex_destroy(conf_ctx_impl->mutex);
-        conf_ctx_impl->mutex = NULL;
+        axis2_thread_mutex_destroy(conf_ctx->mutex);
+        conf_ctx->mutex = NULL;
     }
 
-    AXIS2_FREE(env->allocator, conf_ctx_impl);
-    conf_ctx_impl = NULL;
+    AXIS2_FREE(env->allocator, conf_ctx);
+    conf_ctx = NULL;
 
     return AXIS2_SUCCESS;
 }
 
-axis2_svc_grp_ctx_t *AXIS2_CALL
+AXIS2_EXTERN axis2_svc_grp_ctx_t *AXIS2_CALL
 axis2_conf_ctx_fill_ctxs(
     axis2_conf_ctx_t *conf_ctx,
     const axis2_env_t *env,
     axis2_msg_ctx_t *msg_ctx)
 {
-    axis2_conf_ctx_impl_t *conf_ctx_impl = NULL;
     const axis2_char_t *svc_grp_ctx_id = NULL;
     axis2_svc_grp_ctx_t *svc_grp_ctx = NULL;
     axis2_svc_ctx_t *svc_ctx = NULL;
@@ -688,8 +483,6 @@
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    conf_ctx_impl = AXIS2_INTF_TO_IMPL(conf_ctx);
-
     AXIS2_PARAM_CHECK(env->error, msg_ctx, NULL);
 
     svc = AXIS2_MSG_CTX_GET_SVC(msg_ctx, env);
@@ -732,7 +525,7 @@
     if (svc_grp_ctx_id)
     {
         svc_grp_ctx = (axis2_svc_grp_ctx_t*)
-                axis2_hash_get(conf_ctx_impl->svc_grp_ctx_map,
+                axis2_hash_get(conf_ctx->svc_grp_ctx_map,
                         svc_grp_ctx_id, AXIS2_HASH_KEY_STRING);
         if (svc_grp_ctx)
         {
@@ -781,3 +574,4 @@
     AXIS2_MSG_CTX_SET_SVC_GRP_CTX(msg_ctx, env, svc_grp_ctx);
     return svc_grp_ctx;
 }
+

Modified: webservices/axis2/trunk/c/modules/core/context/ctx.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/context/ctx.c?view=diff&rev=494687&r1=494686&r2=494687
==============================================================================
--- webservices/axis2/trunk/c/modules/core/context/ctx.c (original)
+++ webservices/axis2/trunk/c/modules/core/context/ctx.c Tue Jan  9 18:11:15 2007
@@ -19,10 +19,8 @@
 #include <axis2_const.h>
 #include <axis2_hash.h>
 
-typedef struct axis2_ctx_impl
+struct axis2_ctx
 {
-    /** context base struct */
-    axis2_ctx_t ctx;
     /** non persistent map */
     axis2_hash_t *non_persistent_map;
     axis2_bool_t non_persistent_map_deep_copy;
@@ -30,117 +28,45 @@
     axis2_hash_t *persistent_map;
     /*axis2_ctx_t *parent; This will not be required as the responsibility of
     knowing the parent is  delegated to impl structs */
-}
-axis2_ctx_impl_t;
-
-/** Interface to implementation conversion macro */
-#define AXIS2_INTF_TO_IMPL(ctx) ((axis2_ctx_impl_t *)ctx)
-
-axis2_property_t *AXIS2_CALL
-axis2_ctx_get_property(
-    const axis2_ctx_t *ctx,
-    const axis2_env_t *env,
-    const axis2_char_t *key,
-    const axis2_bool_t persistent);
-
-axis2_hash_t *AXIS2_CALL
-axis2_ctx_get_all_properties(
-    const axis2_ctx_t *ctx,
-    const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_ctx_set_property(
-    struct axis2_ctx *ctx,
-    const axis2_env_t *env,
-    const axis2_char_t *key,
-    axis2_property_t *value,
-    const axis2_bool_t persistent);
-
-axis2_hash_t *AXIS2_CALL
-axis2_ctx_get_non_persistent_map(
-    const axis2_ctx_t *ctx,
-    const axis2_env_t *env);
-
-
-axis2_hash_t *AXIS2_CALL
-axis2_ctx_get_persistent_map(
-    const axis2_ctx_t *ctx,
-    const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_ctx_set_non_persistent_map(
-    struct axis2_ctx *ctx,
-    const axis2_env_t *env,
-    axis2_hash_t *map);
-
-axis2_status_t AXIS2_CALL
-axis2_ctx_set_persistent_map(
-    struct axis2_ctx *ctx,
-    const axis2_env_t *env,
-    axis2_hash_t *map);
-
-axis2_status_t AXIS2_CALL
-axis2_ctx_free(
-    struct axis2_ctx *ctx,
-    const axis2_env_t *env);
-
+};
 
 AXIS2_EXTERN axis2_ctx_t *AXIS2_CALL
 axis2_ctx_create(
     const axis2_env_t *env)
 {
-    axis2_ctx_impl_t *ctx_impl = NULL;
+    axis2_ctx_t *ctx = NULL;
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    ctx_impl = AXIS2_MALLOC(env->allocator, sizeof(axis2_ctx_impl_t));
-    if (!ctx_impl)
+    ctx = AXIS2_MALLOC(env->allocator, sizeof(axis2_ctx_t));
+    if (!ctx)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
 
-    ctx_impl->persistent_map = NULL;
-    ctx_impl->non_persistent_map = NULL;
+    ctx->persistent_map = NULL;
+    ctx->non_persistent_map = NULL;
 
-    ctx_impl->persistent_map = axis2_hash_make(env);
-    if (!(ctx_impl->persistent_map))
+    ctx->persistent_map = axis2_hash_make(env);
+    if (!(ctx->persistent_map))
     {
-        axis2_ctx_free(&(ctx_impl->ctx), env);
+        axis2_ctx_free(ctx, env);
         return NULL;
     }
 
-    ctx_impl->non_persistent_map = axis2_hash_make(env);
-    ctx_impl->non_persistent_map_deep_copy = AXIS2_TRUE;
-    if (!(ctx_impl->non_persistent_map))
+    ctx->non_persistent_map = axis2_hash_make(env);
+    ctx->non_persistent_map_deep_copy = AXIS2_TRUE;
+    if (!(ctx->non_persistent_map))
     {
-        axis2_ctx_free(&(ctx_impl->ctx), env);
+        axis2_ctx_free(ctx, env);
         return NULL;
     }
 
-    /* initialize ops */
-    ctx_impl->ctx.ops = NULL;
-    ctx_impl->ctx.ops  = AXIS2_MALLOC(env->allocator, sizeof(axis2_ctx_ops_t));
-    if (!ctx_impl->ctx.ops)
-    {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        axis2_ctx_free(&(ctx_impl->ctx), env);
-        return NULL;
-    }
-
-    ctx_impl->ctx.ops->get_property = axis2_ctx_get_property;
-    ctx_impl->ctx.ops->get_all_properties = axis2_ctx_get_all_properties;
-    ctx_impl->ctx.ops->set_property = axis2_ctx_set_property;
-    ctx_impl->ctx.ops->get_non_persistent_map = axis2_ctx_get_non_persistent_map;
-    ctx_impl->ctx.ops->get_persistent_map = axis2_ctx_get_persistent_map;
-    ctx_impl->ctx.ops->set_non_persistent_map = axis2_ctx_set_non_persistent_map;
-    ctx_impl->ctx.ops->set_persistent_map = axis2_ctx_set_persistent_map;
-    ctx_impl->ctx.ops->free = axis2_ctx_free;
-
-    return &(ctx_impl->ctx);
+    return ctx;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_ctx_set_property(
     struct axis2_ctx *ctx,
     const axis2_env_t *env,
@@ -148,16 +74,12 @@
     axis2_property_t *value,
     const axis2_bool_t persistent)
 {
-    axis2_ctx_impl_t *ctx_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
-
     if (persistent)
     {
-        if (ctx_impl->persistent_map)
-            axis2_hash_set(ctx_impl->persistent_map, key,
+        if (ctx->persistent_map)
+            axis2_hash_set(ctx->persistent_map, key,
                     AXIS2_HASH_KEY_STRING, value);
     }
     else
@@ -167,7 +89,7 @@
             /* handle the case where we are setting a new value with the 
                same key, we would have to free the existing value */
             axis2_property_t *temp_value = 
-                axis2_hash_get(ctx_impl->non_persistent_map, key, 
+                axis2_hash_get(ctx->non_persistent_map, key, 
                     AXIS2_HASH_KEY_STRING);
 			if (temp_value)
 			{
@@ -179,37 +101,34 @@
 				}
 			}
         }
-        if (ctx_impl->non_persistent_map)
-            axis2_hash_set(ctx_impl->non_persistent_map, key,
+        if (ctx->non_persistent_map)
+            axis2_hash_set(ctx->non_persistent_map, key,
                     AXIS2_HASH_KEY_STRING, value);
     }
     return AXIS2_SUCCESS;
 }
 
-axis2_property_t *AXIS2_CALL
+AXIS2_EXTERN axis2_property_t *AXIS2_CALL
 axis2_ctx_get_property(
     const axis2_ctx_t *ctx,
     const axis2_env_t *env,
     const axis2_char_t *key,
     const axis2_bool_t persistent)
 {
-    axis2_ctx_impl_t *ctx_impl = NULL;
     axis2_property_t *ret = NULL;
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
-
     if (persistent)
     {
-        if (ctx_impl->persistent_map)
-            ret = axis2_hash_get(ctx_impl->persistent_map, key, AXIS2_HASH_KEY_STRING);
+        if (ctx->persistent_map)
+            ret = axis2_hash_get(ctx->persistent_map, key, AXIS2_HASH_KEY_STRING);
     }
 
     if (!ret)
     {
-        if (ctx_impl->non_persistent_map)
-            ret = axis2_hash_get(ctx_impl->non_persistent_map, key, AXIS2_HASH_KEY_STRING);
+        if (ctx->non_persistent_map)
+            ret = axis2_hash_get(ctx->non_persistent_map, key, AXIS2_HASH_KEY_STRING);
     }
     /** it is the responsibility of the caller to look-up parent if key is not found here
         Note that in C implementation it is the responsibility of the deriving struct to

@@ -219,62 +138,48 @@
     return ret;
 }
 
-axis2_hash_t *AXIS2_CALL
+AXIS2_EXTERN axis2_hash_t *AXIS2_CALL
 axis2_ctx_get_all_properties(
     const axis2_ctx_t *ctx,
     const axis2_env_t *env)
 {
-    axis2_ctx_impl_t *ctx_impl = NULL;
-
     AXIS2_ENV_CHECK(env, NULL);
 
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
-
-    return ctx_impl->non_persistent_map;
+    return ctx->non_persistent_map;
 }
 
 
-axis2_hash_t *AXIS2_CALL
+AXIS2_EXTERN axis2_hash_t *AXIS2_CALL
 axis2_ctx_get_non_persistent_map(
     const axis2_ctx_t *ctx,
     const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return AXIS2_INTF_TO_IMPL(ctx)->non_persistent_map;
+    return ctx->non_persistent_map;
 }
 
-axis2_hash_t *AXIS2_CALL
+AXIS2_EXTERN axis2_hash_t *AXIS2_CALL
 axis2_ctx_get_persistent_map(
     const axis2_ctx_t *ctx,
     const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return AXIS2_INTF_TO_IMPL(ctx)->persistent_map;
+    return ctx->persistent_map;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_ctx_free(
     struct axis2_ctx *ctx,
     const axis2_env_t *env)
 {
-    axis2_ctx_impl_t *ctx_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
-
-    if (ctx_impl->ctx.ops)
-    {
-        AXIS2_FREE(env->allocator, ctx_impl->ctx.ops);
-        ctx_impl->ctx.ops = NULL;
-    }
-
-    if (ctx_impl->non_persistent_map && ctx_impl->non_persistent_map_deep_copy)
+    if (ctx->non_persistent_map && ctx->non_persistent_map_deep_copy)
     {
         axis2_hash_index_t *hi = NULL;
         void *val = NULL;
         const void *key = NULL;
-        for (hi = axis2_hash_first(ctx_impl->non_persistent_map, env);
+        for (hi = axis2_hash_first(ctx->non_persistent_map, env);
                 hi; hi = axis2_hash_next(env, hi))
         {
             axis2_property_t *property = NULL;
@@ -291,16 +196,16 @@
             val = NULL;
             key = NULL;
         }
-        axis2_hash_free(ctx_impl->non_persistent_map, env);
-        ctx_impl->non_persistent_map = NULL;
+        axis2_hash_free(ctx->non_persistent_map, env);
+        ctx->non_persistent_map = NULL;
     }
 
-    if (ctx_impl->persistent_map)
+    if (ctx->persistent_map)
     {
         axis2_hash_index_t *hi = NULL;
         void *val = NULL;
         const void *key = NULL;
-        for (hi = axis2_hash_first(ctx_impl->persistent_map, env);
+        for (hi = axis2_hash_first(ctx->persistent_map, env);
                 hi; hi = axis2_hash_next(env, hi))
         {
             axis2_property_t *property = NULL;
@@ -317,34 +222,30 @@
             val = NULL;
             key = NULL;
         }
-        axis2_hash_free(ctx_impl->persistent_map, env);
-        ctx_impl->persistent_map = NULL;
+        axis2_hash_free(ctx->persistent_map, env);
+        ctx->persistent_map = NULL;
     }
 
-    AXIS2_FREE(env->allocator, ctx_impl);
-    ctx_impl = NULL;
+    AXIS2_FREE(env->allocator, ctx);
+    ctx = NULL;
 
     return AXIS2_SUCCESS;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_ctx_set_non_persistent_map(
     struct axis2_ctx *ctx,
     const axis2_env_t *env,
     axis2_hash_t *map)
 {
-    axis2_ctx_impl_t *ctx_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
-
-    if (ctx_impl->non_persistent_map && ctx_impl->non_persistent_map_deep_copy)
+    if (ctx->non_persistent_map && ctx->non_persistent_map_deep_copy)
     {
         axis2_hash_index_t *hi = NULL;
         void *val = NULL;
         const void *key = NULL;
-        for (hi = axis2_hash_first(ctx_impl->non_persistent_map, env);
+        for (hi = axis2_hash_first(ctx->non_persistent_map, env);
                 hi; hi = axis2_hash_next(env, hi))
         {
             axis2_property_t *property = NULL;
@@ -361,37 +262,33 @@
             val = NULL;
             key = NULL;
         }
-        if (ctx_impl->non_persistent_map != map) /* handle repeated invocation case */
+        if (ctx->non_persistent_map != map) /* handle repeated invocation case */
         {
-            axis2_hash_free(ctx_impl->non_persistent_map, env);
-            ctx_impl->non_persistent_map = NULL;
+            axis2_hash_free(ctx->non_persistent_map, env);
+            ctx->non_persistent_map = NULL;
         }
     }
 
-    ctx_impl->non_persistent_map = map;
-    ctx_impl->non_persistent_map_deep_copy = AXIS2_FALSE;
+    ctx->non_persistent_map = map;
+    ctx->non_persistent_map_deep_copy = AXIS2_FALSE;
 
     return AXIS2_SUCCESS;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_ctx_set_persistent_map(
     struct axis2_ctx *ctx,
     const axis2_env_t *env,
     axis2_hash_t *map)
 {
-    axis2_ctx_impl_t *ctx_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
-
-    if (ctx_impl->persistent_map)
+    if (ctx->persistent_map)
     {
         axis2_hash_index_t *hi = NULL;
         void *val = NULL;
         const void *key = NULL;
-        for (hi = axis2_hash_first(ctx_impl->persistent_map, env);
+        for (hi = axis2_hash_first(ctx->persistent_map, env);
                 hi; hi = axis2_hash_next(env, hi))
         {
             axis2_property_t *property = NULL;
@@ -408,11 +305,11 @@
             val = NULL;
             key = NULL;
         }
-        axis2_hash_free(ctx_impl->persistent_map, env);
-        ctx_impl->persistent_map = NULL;
+        axis2_hash_free(ctx->persistent_map, env);
+        ctx->persistent_map = NULL;
     }
 
-    ctx_impl->persistent_map = map;
+    ctx->persistent_map = map;
 
     return AXIS2_SUCCESS;
 }



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


Mime
View raw message