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 da...@apache.org on 2008/06/30 10:41:12 UTC
svn commit: r672729 - in /webservices/axis2/trunk/c/src/core:
context/conf_ctx.c engine/ctx_handler.c
Author: damitha
Date: Mon Jun 30 01:41:11 2008
New Revision: 672729
URL: http://svn.apache.org/viewvc?rev=672729&view=rev
Log:
Applying coding conventions
Modified:
webservices/axis2/trunk/c/src/core/context/conf_ctx.c
webservices/axis2/trunk/c/src/core/engine/ctx_handler.c
Modified: webservices/axis2/trunk/c/src/core/context/conf_ctx.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/context/conf_ctx.c?rev=672729&r1=672728&r2=672729&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/context/conf_ctx.c (original)
+++ webservices/axis2/trunk/c/src/core/context/conf_ctx.c Mon Jun 30 01:41:11 2008
@@ -466,30 +466,26 @@
svc = axis2_msg_ctx_get_svc(msg_ctx, env);
if (!svc)
{
- AXIS2_ERROR_SET(env->error,
- AXIS2_ERROR_SERVICE_NOT_YET_FOUND, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SERVICE_NOT_YET_FOUND, AXIS2_FAILURE);
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "Service not yet found in message context. Cannot proceed");
+ "Service not yet found in message context. Cannot proceed");
+
return NULL;
}
qname = axis2_svc_get_qname(svc, env);
if (!qname)
{
- AXIS2_ERROR_SET(env->error,
- AXIS2_ERROR_INVALID_STATE_SVC, AXIS2_FAILURE);
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "Service found in message context has no name.");
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_SVC, AXIS2_FAILURE);
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Service found in message context has no name.");
return NULL;
}
svc_id = axutil_qname_get_localpart(qname, env);
if (!svc_id)
{
- AXIS2_ERROR_SET(env->error,
- AXIS2_ERROR_INVALID_STATE_SVC, AXIS2_FAILURE);
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "Service found message context has no name.");
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_SVC, AXIS2_FAILURE);
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Service found in message context has no name.");
return NULL;
}
@@ -501,30 +497,27 @@
if (!svc_grp_ctx_id)
{
- svc_grp_ctx_id =
- (axis2_char_t *)
- axutil_string_get_buffer(axis2_msg_ctx_get_svc_grp_ctx_id
- (msg_ctx, env), env);
+ svc_grp_ctx_id = (axis2_char_t *) axutil_string_get_buffer(axis2_msg_ctx_get_svc_grp_ctx_id(
+ msg_ctx, env), env);
}
- /* By this time service group context id must have a value,
- either from transport or from addressing */
+ /* By this time service group context id must have a value, either from transport or from
+ * addressing
+ */
if (svc_grp_ctx_id)
{
- svc_grp_ctx = (axis2_svc_grp_ctx_t *)
- axutil_hash_get(conf_ctx->svc_grp_ctx_map,
- svc_grp_ctx_id, AXIS2_HASH_KEY_STRING);
+ svc_grp_ctx = (axis2_svc_grp_ctx_t *) axutil_hash_get(conf_ctx->svc_grp_ctx_map,
+ svc_grp_ctx_id, AXIS2_HASH_KEY_STRING);
+
if (svc_grp_ctx)
{
svc_ctx = axis2_svc_grp_ctx_get_svc_ctx(svc_grp_ctx, env, svc_id);
if (!svc_ctx)
{
- AXIS2_ERROR_SET(env->error,
- AXIS2_ERROR_INVALID_STATE_SVC_GRP,
- AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_SVC_GRP, AXIS2_FAILURE);
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "Service group context has no servie context set for "\
- "service %s", svc_id);
+ "Service group context has no servie context set for service %s", svc_id);
+
return NULL;
}
}
@@ -535,8 +528,9 @@
svc_grp_ctx_id = axutil_uuid_gen(env);
if (svc_grp_ctx_id)
{
- axutil_string_t *svc_grp_ctx_id_str =
- axutil_string_create_assume_ownership(env, &svc_grp_ctx_id);
+ axutil_string_t *svc_grp_ctx_id_str = axutil_string_create_assume_ownership(env,
+ &svc_grp_ctx_id);
+
axis2_msg_ctx_set_svc_grp_ctx_id(msg_ctx, env, svc_grp_ctx_id_str);
axutil_string_free(svc_grp_ctx_id_str, env);
}
@@ -550,16 +544,15 @@
svc_ctx = axis2_svc_grp_ctx_get_svc_ctx(svc_grp_ctx, env, svc_id);
if (!svc_ctx)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_SVC_GRP,
- AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_SVC_GRP, AXIS2_FAILURE);
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "Service group context has no servie context set for "\
- "service %s", svc_id);
+ "Service group context has no servie context set for service %s", svc_id);
+
return NULL;
}
+
axis2_svc_grp_ctx_set_id(svc_grp_ctx, env, svc_grp_ctx_id);
- axis2_conf_ctx_register_svc_grp_ctx(conf_ctx, env, svc_grp_ctx_id,
- svc_grp_ctx);
+ axis2_conf_ctx_register_svc_grp_ctx(conf_ctx, env, svc_grp_ctx_id, svc_grp_ctx);
}
/* When you come here operation context MUST have already been assigned
@@ -567,10 +560,8 @@
op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
if (!op_ctx)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_MSG_CTX,
- AXIS2_FAILURE);
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "Operation context not set for message context");
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_MSG_CTX, AXIS2_FAILURE);
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Operation context not set for message context");
return NULL;
}
Modified: webservices/axis2/trunk/c/src/core/engine/ctx_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/engine/ctx_handler.c?rev=672729&r1=672728&r2=672729&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/engine/ctx_handler.c (original)
+++ webservices/axis2/trunk/c/src/core/engine/ctx_handler.c Mon Jun 30 01:41:11 2008
@@ -57,9 +57,7 @@
{
/* create default string */
handler_string =
- axutil_string_create_const(env,
- (axis2_char_t **) &
- AXIS2_CTX_HANDLER_NAME);
+ axutil_string_create_const(env, (axis2_char_t **) & AXIS2_CTX_HANDLER_NAME);
if (!handler_string)
{
return NULL;
@@ -123,7 +121,9 @@
op = axis2_msg_ctx_get_op(msg_ctx, env);
if (op)
+ {
op_ctx = axis2_op_find_existing_op_ctx(op, env, msg_ctx);
+ }
if (op_ctx)
{
@@ -143,18 +143,18 @@
axis2_msg_ctx_set_svc_grp_ctx_id(msg_ctx, env, svc_grp_ctx_id_str);
axutil_string_free(svc_grp_ctx_id_str, env);
}
+
return AXIS2_SUCCESS;
}
else if (op) /* 2. if no op_ctx, create new op_ctx */
{
axis2_conf_ctx_t *conf_ctx = NULL;
axis2_bool_t use_pools = AXIS2_FALSE;
- axutil_param_t *param = axis2_msg_ctx_get_parameter(msg_ctx, env,
- AXIS2_PERSIST_OP_CTX);
+ axutil_param_t *param = axis2_msg_ctx_get_parameter(msg_ctx, env, AXIS2_PERSIST_OP_CTX);
+
+ use_pools = (param && 0 == axutil_strcmp(AXIS2_VALUE_TRUE, axutil_param_get_value(param,
+ env)));
- use_pools = (param && 0 == axutil_strcmp(AXIS2_VALUE_TRUE,
- axutil_param_get_value(param,
- env)));
if (use_pools)
{
axutil_allocator_switch_to_global_pool(env->allocator);
@@ -162,10 +162,10 @@
op_ctx = axis2_op_ctx_create(env, op, NULL);
if (!op_ctx)
{
- axis2_char_t *op_name =
- axutil_qname_get_localpart(axis2_op_get_qname(op, env), env);
+ axis2_char_t *op_name = axutil_qname_get_localpart(axis2_op_get_qname(op, env), env);
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "Could not create Operation context for operatoin %s", op_name);
+ "Could not create Operation context for operatoin %s", op_name);
+
return AXIS2_FAILURE;
}
@@ -197,11 +197,12 @@
if (!svc_grp_ctx && (axis2_msg_ctx_get_server_side(msg_ctx, env)))
{
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "Service group context not found");
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Service group context not found");
return AXIS2_FAILURE;
}
+
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Exit:axis2_ctx_handler_invoke");
+
return AXIS2_SUCCESS;
}