You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2007/03/23 13:21:46 UTC
svn commit: r521694 - in /webservices/axis2/trunk/c: include/axis2_ctx.h
modules/core/context/ctx.c modules/core/context/msg_ctx.c
modules/core/util/core_utils.c
Author: samisa
Date: Fri Mar 23 05:21:45 2007
New Revision: 521694
URL: http://svn.apache.org/viewvc?view=rev&rev=521694
Log:
More fixes related to AXIS2C-207
Modified:
webservices/axis2/trunk/c/include/axis2_ctx.h
webservices/axis2/trunk/c/modules/core/context/ctx.c
webservices/axis2/trunk/c/modules/core/context/msg_ctx.c
webservices/axis2/trunk/c/modules/core/util/core_utils.c
Modified: webservices/axis2/trunk/c/include/axis2_ctx.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_ctx.h?view=diff&rev=521694&r1=521693&r2=521694
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_ctx.h (original)
+++ webservices/axis2/trunk/c/include/axis2_ctx.h Fri Mar 23 05:21:45 2007
@@ -97,21 +97,10 @@
* properties
*/
AXIS2_EXTERN axis2_hash_t *AXIS2_CALL
- axis2_ctx_get_non_persistent_map(const axis2_ctx_t *ctx,
+ axis2_ctx_get_property_map(const axis2_ctx_t *ctx,
const axis2_env_t *env);
/**
- * Gets the persistent map of properties.
- * @param ctx pointer to context struct
- * @param env pointer to environment struct
- * @return pointer to the hash map which stores the persistent
- * properties
- */
- AXIS2_EXTERN axis2_hash_t *AXIS2_CALL
- axis2_ctx_get_persistent_map(const axis2_ctx_t *ctx,
- const axis2_env_t *env);
-
- /**
* Gets all properties stored within context.
* @param ctx pointer to context struct
* @param env pointer to environment struct
@@ -140,19 +129,7 @@
* @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
*/
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);
-
- /**
- * Sets persistent map of properties.
- * @param ctx pointer to context struct
- * @param env pointer to environment struct
- * @param map pointer to hash map, context assumes ownership of the map
- * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
- */
- AXIS2_EXTERN axis2_status_t AXIS2_CALL
- axis2_ctx_set_persistent_map(struct axis2_ctx *ctx,
+ axis2_ctx_set_property_map(struct axis2_ctx *ctx,
const axis2_env_t *env,
axis2_hash_t *map);
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=521694&r1=521693&r2=521694
==============================================================================
--- webservices/axis2/trunk/c/modules/core/context/ctx.c (original)
+++ webservices/axis2/trunk/c/modules/core/context/ctx.c Fri Mar 23 05:21:45 2007
@@ -22,11 +22,9 @@
struct axis2_ctx
{
/** non persistent map */
- axis2_hash_t *non_persistent_map;
+ axis2_hash_t *property_map;
/** non persistent map is a deep copy */
- axis2_bool_t non_persistent_map_deep_copy;
- /** persistent map */
- axis2_hash_t *persistent_map;
+ axis2_bool_t property_map_deep_copy;
};
AXIS2_EXTERN axis2_ctx_t *AXIS2_CALL
@@ -43,19 +41,11 @@
return NULL;
}
- ctx->persistent_map = NULL;
- ctx->non_persistent_map = NULL;
+ ctx->property_map = NULL;
- ctx->persistent_map = axis2_hash_make(env);
- if (!(ctx->persistent_map))
- {
- axis2_ctx_free(ctx, env);
- return NULL;
- }
-
- ctx->non_persistent_map = axis2_hash_make(env);
- ctx->non_persistent_map_deep_copy = AXIS2_TRUE;
- if (!(ctx->non_persistent_map))
+ ctx->property_map = axis2_hash_make(env);
+ ctx->property_map_deep_copy = AXIS2_TRUE;
+ if (!(ctx->property_map))
{
axis2_ctx_free(ctx, env);
return NULL;
@@ -76,7 +66,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->non_persistent_map,
+ axis2_property_t *temp_value = axis2_hash_get(ctx->property_map,
key,
AXIS2_HASH_KEY_STRING);
if (temp_value)
@@ -89,9 +79,9 @@
}
}
}
- if (ctx->non_persistent_map)
+ if (ctx->property_map)
{
- axis2_hash_set(ctx->non_persistent_map, key,
+ axis2_hash_set(ctx->property_map, key,
AXIS2_HASH_KEY_STRING, value);
}
@@ -105,9 +95,9 @@
{
axis2_property_t *ret = NULL;
- if (ctx->non_persistent_map)
+ if (ctx->property_map)
{
- ret = axis2_hash_get(ctx->non_persistent_map, key,
+ ret = axis2_hash_get(ctx->property_map, key,
AXIS2_HASH_KEY_STRING);
}
/** it is the responsibility of the caller to look-up parent if key is not found here
@@ -122,22 +112,15 @@
axis2_ctx_get_all_properties(const axis2_ctx_t *ctx,
const axis2_env_t *env)
{
- return ctx->non_persistent_map;
+ return ctx->property_map;
}
AXIS2_EXTERN axis2_hash_t *AXIS2_CALL
-axis2_ctx_get_non_persistent_map(const axis2_ctx_t *ctx,
- const axis2_env_t *env)
-{
- return ctx->non_persistent_map;
-}
-
-AXIS2_EXTERN axis2_hash_t *AXIS2_CALL
-axis2_ctx_get_persistent_map(const axis2_ctx_t *ctx,
+axis2_ctx_get_property_map(const axis2_ctx_t *ctx,
const axis2_env_t *env)
{
- return ctx->persistent_map;
+ return ctx->property_map;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
@@ -146,33 +129,12 @@
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- 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->non_persistent_map, env);
- hi; hi = axis2_hash_next(env, hi))
- {
- axis2_property_t *property = NULL;
-
- axis2_hash_this(hi, &key, NULL, &val);
- property = (axis2_property_t *) val;
-
- if (property)
- {
- axis2_property_free(property, env);
- }
- }
- axis2_hash_free(ctx->non_persistent_map, env);
- }
-
- if (ctx->persistent_map)
+ if (ctx->property_map && ctx->property_map_deep_copy)
{
axis2_hash_index_t *hi = NULL;
void *val = NULL;
const void *key = NULL;
- for (hi = axis2_hash_first(ctx->persistent_map, env);
+ for (hi = axis2_hash_first(ctx->property_map, env);
hi; hi = axis2_hash_next(env, hi))
{
axis2_property_t *property = NULL;
@@ -185,7 +147,7 @@
axis2_property_free(property, env);
}
}
- axis2_hash_free(ctx->persistent_map, env);
+ axis2_hash_free(ctx->property_map, env);
}
AXIS2_FREE(env->allocator, ctx);
@@ -194,18 +156,18 @@
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axis2_ctx_set_non_persistent_map(struct axis2_ctx *ctx,
+axis2_ctx_set_property_map(struct axis2_ctx *ctx,
const axis2_env_t *env,
axis2_hash_t *map)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- if (ctx->non_persistent_map && ctx->non_persistent_map_deep_copy)
+ if (ctx->property_map && ctx->property_map_deep_copy)
{
axis2_hash_index_t *hi = NULL;
void *val = NULL;
const void *key = NULL;
- for (hi = axis2_hash_first(ctx->non_persistent_map, env);
+ for (hi = axis2_hash_first(ctx->property_map, env);
hi; hi = axis2_hash_next(env, hi))
{
axis2_property_t *property = NULL;
@@ -218,47 +180,14 @@
axis2_property_free(property, env);
}
}
- if (ctx->non_persistent_map != map) /* handle repeated invocation case */
+ if (ctx->property_map != map) /* handle repeated invocation case */
{
- axis2_hash_free(ctx->non_persistent_map, env);
- }
- }
-
- ctx->non_persistent_map = map;
- ctx->non_persistent_map_deep_copy = AXIS2_FALSE;
-
- return AXIS2_SUCCESS;
-}
-
-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_ENV_CHECK(env, AXIS2_FAILURE);
-
- if (ctx->persistent_map)
- {
- axis2_hash_index_t *hi = NULL;
- void *val = NULL;
- const void *key = NULL;
- for (hi = axis2_hash_first(ctx->persistent_map, env);
- hi; hi = axis2_hash_next(env, hi))
- {
- axis2_property_t *property = NULL;
-
- axis2_hash_this(hi, &key, NULL, &val);
- property = (axis2_property_t *) val;
-
- if (property)
- {
- axis2_property_free(property, env);
- }
+ axis2_hash_free(ctx->property_map, env);
}
- axis2_hash_free(ctx->persistent_map, env);
}
- ctx->persistent_map = map;
+ ctx->property_map = map;
+ ctx->property_map_deep_copy = AXIS2_FALSE;
return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/modules/core/context/msg_ctx.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/context/msg_ctx.c?view=diff&rev=521694&r1=521693&r2=521694
==============================================================================
--- webservices/axis2/trunk/c/modules/core/context/msg_ctx.c (original)
+++ webservices/axis2/trunk/c/modules/core/context/msg_ctx.c Fri Mar 23 05:21:45 2007
@@ -1541,7 +1541,7 @@
options = axis2_options_create(env);
axis2_options_set_msg_info_headers(options, env,
msg_ctx->msg_info_headers);
- properties = axis2_ctx_get_non_persistent_map(msg_ctx->base, env);
+ properties = axis2_ctx_get_property_map(msg_ctx->base, env);
axis2_options_set_properties(options, env, properties);
return options;
}
@@ -1571,7 +1571,7 @@
msg_ctx->doing_mtom = axis2_options_get_enable_mtom(options, env);
- axis2_ctx_set_non_persistent_map(msg_ctx->base, env,
+ axis2_ctx_set_property_map(msg_ctx->base, env,
axis2_options_get_properties(options, env));
rest_val = (axis2_property_t *) axis2_msg_ctx_get_property(msg_ctx, env,
AXIS2_ENABLE_REST);
Modified: webservices/axis2/trunk/c/modules/core/util/core_utils.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/util/core_utils.c?view=diff&rev=521694&r1=521693&r2=521694
==============================================================================
--- webservices/axis2/trunk/c/modules/core/util/core_utils.c (original)
+++ webservices/axis2/trunk/c/modules/core/util/core_utils.c Fri Mar 23 05:21:45 2007
@@ -114,8 +114,8 @@
axis2_ctx_t *new_ctx = axis2_msg_ctx_get_base(new_msg_ctx, env);
if (new_ctx)
{
- axis2_ctx_set_non_persistent_map(new_ctx, env,
- axis2_ctx_get_non_persistent_map(ctx, env));
+ axis2_ctx_set_property_map(new_ctx, env,
+ axis2_ctx_get_property_map(ctx, env));
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org