You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sa...@apache.org on 2007/09/28 11:53:04 UTC
svn commit: r580276 [13/26] - in /webservices/axis2/trunk/c/src: core/addr/
core/clientapi/ core/context/ core/deployment/ core/description/
core/engine/ core/phaseresolver/ core/receivers/ core/transport/
core/transport/http/common/ core/transport/htt...
Modified: webservices/axis2/trunk/c/src/core/engine/engine.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/engine/engine.c?rev=580276&r1=580275&r2=580276&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/engine/engine.c (original)
+++ webservices/axis2/trunk/c/src/core/engine/engine.c Fri Sep 28 02:52:58 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -31,19 +32,19 @@
struct axis2_engine
{
+
/** configuration context */
axis2_conf_ctx_t *conf_ctx;
};
-axis2_status_t
-axis2_engine_check_must_understand_headers(
- const axutil_env_t *env,
- axis2_msg_ctx_t *msg_ctx);
+axis2_status_t axis2_engine_check_must_understand_headers(
+ const axutil_env_t * env,
+ axis2_msg_ctx_t * msg_ctx);
AXIS2_EXTERN axis2_engine_t *AXIS2_CALL
axis2_engine_create(
- const axutil_env_t *env,
- axis2_conf_ctx_t *conf_ctx)
+ const axutil_env_t * env,
+ axis2_conf_ctx_t * conf_ctx)
{
axis2_engine_t *engine = NULL;
@@ -60,7 +61,7 @@
if (conf_ctx)
{
- engine->conf_ctx = conf_ctx;
+ engine->conf_ctx = conf_ctx;
}
return engine;
@@ -68,8 +69,8 @@
AXIS2_EXTERN void AXIS2_CALL
axis2_engine_free(
- axis2_engine_t *engine,
- const axutil_env_t *env)
+ axis2_engine_t * engine,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, void);
AXIS2_FREE(env->allocator, engine);
@@ -78,9 +79,9 @@
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_engine_send(
- axis2_engine_t *engine,
- const axutil_env_t *env,
- axis2_msg_ctx_t *msg_ctx)
+ axis2_engine_t * engine,
+ const axutil_env_t * env,
+ axis2_msg_ctx_t * msg_ctx)
{
axis2_status_t status = AXIS2_SUCCESS;
axis2_op_ctx_t *op_ctx = NULL;
@@ -94,38 +95,41 @@
AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
/* find and invoke the phases */
- op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
+ op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
if (op_ctx)
{
- axis2_op_t *op = axis2_op_ctx_get_op(op_ctx, env);
+ axis2_op_t *op = axis2_op_ctx_get_op(op_ctx, env);
if (op)
{
phases = axis2_op_get_out_flow(op, env);
}
}
- if ( axis2_msg_ctx_is_paused(msg_ctx, env))
+ if (axis2_msg_ctx_is_paused(msg_ctx, env))
{
/* message has paused, so rerun it from the position it stopped.
The handler which paused the message will be the first one to resume
invocation
- */
- status = axis2_engine_resume_invocation_phases(engine, env, phases, msg_ctx);
+ */
+ status =
+ axis2_engine_resume_invocation_phases(engine, env, phases, msg_ctx);
if (status != AXIS2_SUCCESS)
{
return status;
}
- conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
+ conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
if (conf_ctx)
{
- conf = axis2_conf_ctx_get_conf(conf_ctx, env);
+ conf = axis2_conf_ctx_get_conf(conf_ctx, env);
if (conf)
{
- axutil_array_list_t *global_out_phase = axis2_conf_get_out_phases(conf, env);
+ axutil_array_list_t *global_out_phase =
+ axis2_conf_get_out_phases(conf, env);
if (global_out_phase)
{
- axis2_engine_invoke_phases(engine, env, global_out_phase, msg_ctx);
+ axis2_engine_invoke_phases(engine, env, global_out_phase,
+ msg_ctx);
}
}
}
@@ -139,31 +143,33 @@
return status;
}
- conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
+ conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
if (conf_ctx)
{
- conf = axis2_conf_ctx_get_conf(conf_ctx, env);
+ conf = axis2_conf_ctx_get_conf(conf_ctx, env);
if (conf)
{
- axutil_array_list_t *global_out_phase = axis2_conf_get_out_phases(conf, env);
+ axutil_array_list_t *global_out_phase =
+ axis2_conf_get_out_phases(conf, env);
if (global_out_phase)
{
- axis2_engine_invoke_phases(engine, env, global_out_phase, msg_ctx);
+ axis2_engine_invoke_phases(engine, env, global_out_phase,
+ msg_ctx);
}
}
}
}
- if (!( axis2_msg_ctx_is_paused(msg_ctx, env)))
+ if (!(axis2_msg_ctx_is_paused(msg_ctx, env)))
{
/* write the message to wire */
axis2_transport_sender_t *transport_sender = NULL;
- axis2_transport_out_desc_t *transport_out =
+ axis2_transport_out_desc_t *transport_out =
axis2_msg_ctx_get_transport_out_desc(msg_ctx, env);
if (transport_out)
{
- transport_sender =
+ transport_sender =
axis2_transport_out_desc_get_sender(transport_out, env);
if (transport_sender)
@@ -175,21 +181,22 @@
}
else
{
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
- "Transport out is not set in message context");
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+ "Transport out is not set in message context");
return AXIS2_FAILURE;
}
}
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "axis2_engine_send end successfully");
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
+ "axis2_engine_send end successfully");
return AXIS2_SUCCESS;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_engine_receive(
- axis2_engine_t *engine,
- const axutil_env_t *env,
- axis2_msg_ctx_t *msg_ctx)
+ axis2_engine_t * engine,
+ const axutil_env_t * env,
+ axis2_msg_ctx_t * msg_ctx)
{
axis2_conf_ctx_t *conf_ctx = NULL;
axis2_conf_t *conf = NULL;
@@ -203,33 +210,31 @@
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
- conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
+ conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
- conf = axis2_conf_ctx_get_conf(conf_ctx, env);
+ conf = axis2_conf_ctx_get_conf(conf_ctx, env);
pre_calculated_phases =
- axis2_conf_get_in_phases_upto_and_including_post_dispatch(conf, env);
+ axis2_conf_get_in_phases_upto_and_including_post_dispatch(conf, env);
- if ( axis2_msg_ctx_is_paused(msg_ctx, env))
+ if (axis2_msg_ctx_is_paused(msg_ctx, env))
{
/* the message has paused, so re-run them from the position they stopped. */
- axis2_engine_resume_invocation_phases(engine, env,
- pre_calculated_phases,
- msg_ctx);
+ axis2_engine_resume_invocation_phases(engine, env,
+ pre_calculated_phases, msg_ctx);
if (axis2_msg_ctx_is_paused(msg_ctx, env))
{
return AXIS2_SUCCESS;
}
/* resume op specific phases */
- op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
+ op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
if (op_ctx)
{
- op = axis2_op_ctx_get_op(op_ctx, env);
+ op = axis2_op_ctx_get_op(op_ctx, env);
op_specific_phases = axis2_op_get_in_flow(op, env);
- axis2_engine_resume_invocation_phases(engine, env,
- op_specific_phases,
- msg_ctx);
+ axis2_engine_resume_invocation_phases(engine, env,
+ op_specific_phases, msg_ctx);
if (axis2_msg_ctx_is_paused(msg_ctx, env))
{
return AXIS2_SUCCESS;
@@ -238,40 +243,40 @@
}
else
{
- status = axis2_engine_invoke_phases(engine, env,
- pre_calculated_phases, msg_ctx);
+ status = axis2_engine_invoke_phases(engine, env,
+ pre_calculated_phases, msg_ctx);
if (status != AXIS2_SUCCESS)
{
- if ( axis2_msg_ctx_get_server_side(msg_ctx, env))
+ if (axis2_msg_ctx_get_server_side(msg_ctx, env))
return status;
}
- if (AXIS2_TRUE == axis2_msg_ctx_is_paused(msg_ctx, env))
+ if (AXIS2_TRUE == axis2_msg_ctx_is_paused(msg_ctx, env))
{
return AXIS2_SUCCESS;
}
- op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
+ op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
if (op_ctx)
{
- op = axis2_op_ctx_get_op(op_ctx, env);
+ op = axis2_op_ctx_get_op(op_ctx, env);
op_specific_phases = axis2_op_get_in_flow(op, env);
- status = axis2_engine_invoke_phases(engine, env,
- op_specific_phases, msg_ctx);
+ status = axis2_engine_invoke_phases(engine, env,
+ op_specific_phases, msg_ctx);
if (status != AXIS2_SUCCESS)
{
return status;
}
- if (AXIS2_TRUE == axis2_msg_ctx_is_paused(msg_ctx, env))
+ if (AXIS2_TRUE == axis2_msg_ctx_is_paused(msg_ctx, env))
{
return AXIS2_SUCCESS;
}
}
}
- if ((axis2_msg_ctx_get_server_side(msg_ctx, env)) &&
- !( axis2_msg_ctx_is_paused(msg_ctx, env)))
+ if ((axis2_msg_ctx_get_server_side(msg_ctx, env)) &&
+ !(axis2_msg_ctx_is_paused(msg_ctx, env)))
{
axis2_msg_recv_t *receiver = NULL;
@@ -285,12 +290,13 @@
receiver = axis2_op_get_msg_recv(op, env);
if (!receiver)
{
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
- "Message receiver not set in operation description");
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+ "Message receiver not set in operation description");
return AXIS2_FAILURE;
}
- status = axis2_msg_recv_receive(receiver, env, msg_ctx,
- axis2_msg_recv_get_derived(receiver, env));
+ status = axis2_msg_recv_receive(receiver, env, msg_ctx,
+ axis2_msg_recv_get_derived(receiver,
+ env));
}
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Axis2 engine receive completed!");
@@ -299,12 +305,11 @@
return status;
}
-
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_engine_send_fault(
- axis2_engine_t *engine,
- const axutil_env_t *env,
- axis2_msg_ctx_t *msg_ctx)
+ axis2_engine_t * engine,
+ const axutil_env_t * env,
+ axis2_msg_ctx_t * msg_ctx)
{
axis2_op_ctx_t *op_ctx = NULL;
axis2_status_t status = AXIS2_SUCCESS;
@@ -315,10 +320,10 @@
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
- op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
+ op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
if (op_ctx)
{
- axis2_op_t *op = axis2_op_ctx_get_op(op_ctx, env);
+ axis2_op_t *op = axis2_op_ctx_get_op(op_ctx, env);
if (op)
{
phases = axis2_op_get_fault_out_flow(op, env);
@@ -330,23 +335,26 @@
/* message has paused, so rerun it from the position it stopped.
The handler which paused the message will be the first one to resume
invocation
- */
- status = axis2_engine_resume_invocation_phases(engine, env, phases, msg_ctx);
+ */
+ status =
+ axis2_engine_resume_invocation_phases(engine, env, phases, msg_ctx);
if (status != AXIS2_SUCCESS)
{
return status;
}
- conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
+ conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
if (conf_ctx)
{
- conf = axis2_conf_ctx_get_conf(conf_ctx, env);
+ conf = axis2_conf_ctx_get_conf(conf_ctx, env);
if (conf)
{
- axutil_array_list_t *global_out_fault_phase = axis2_conf_get_out_fault_flow(conf, env);
+ axutil_array_list_t *global_out_fault_phase =
+ axis2_conf_get_out_fault_flow(conf, env);
if (global_out_fault_phase)
{
- axis2_engine_invoke_phases(engine, env, global_out_fault_phase, msg_ctx);
+ axis2_engine_invoke_phases(engine, env,
+ global_out_fault_phase, msg_ctx);
}
}
}
@@ -355,31 +363,33 @@
{
status = axis2_engine_invoke_phases(engine, env, phases, msg_ctx);
- conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
+ conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
if (conf_ctx)
{
- conf = axis2_conf_ctx_get_conf(conf_ctx, env);
+ conf = axis2_conf_ctx_get_conf(conf_ctx, env);
if (conf)
{
- axutil_array_list_t *global_out_fault_phase = axis2_conf_get_out_fault_flow(conf, env);
+ axutil_array_list_t *global_out_fault_phase =
+ axis2_conf_get_out_fault_flow(conf, env);
if (global_out_fault_phase)
{
- axis2_engine_invoke_phases(engine, env, global_out_fault_phase, msg_ctx);
+ axis2_engine_invoke_phases(engine, env,
+ global_out_fault_phase, msg_ctx);
}
}
}
}
- if (!( axis2_msg_ctx_is_paused(msg_ctx, env)))
+ if (!(axis2_msg_ctx_is_paused(msg_ctx, env)))
{
/* write the message to wire */
axis2_transport_sender_t *transport_sender = NULL;
- axis2_transport_out_desc_t *transport_out =
+ axis2_transport_out_desc_t *transport_out =
axis2_msg_ctx_get_transport_out_desc(msg_ctx, env);
if (transport_out)
{
- transport_sender =
+ transport_sender =
axis2_transport_out_desc_get_sender(transport_out, env);
if (transport_sender)
@@ -391,54 +401,53 @@
}
else
{
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
- "Transport out is not set in message context");
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+ "Transport out is not set in message context");
return AXIS2_FAILURE;
}
}
/*if (!( axis2_msg_ctx_is_paused(msg_ctx, env)))
- {
- axis2_conf_ctx_t *conf_ctx = NULL;
- axis2_transport_sender_t *transport_sender = NULL;
- axis2_transport_out_desc_t *transport_out = NULL;
- conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
- if (conf_ctx)
- {
- axis2_conf_t *conf = axis2_conf_ctx_get_conf(conf_ctx, env);
- if (conf)
- {
- axutil_array_list_t *phases =
- axis2_conf_get_out_fault_flow(conf, env);
- if (phases)
- {
- axis2_engine_invoke_phases(engine, env, phases, msg_ctx);
- }
- }
- }
-
- transport_out = axis2_msg_ctx_get_transport_out_desc(msg_ctx, env);
-
- if (transport_out)
- {
- transport_sender =
- axis2_transport_out_desc_get_sender(transport_out, env);
- }
-
- if (transport_sender)
- {
- AXIS2_TRANSPORT_SENDER_INVOKE(transport_sender, env, msg_ctx);
- }
- }*/
+ {
+ axis2_conf_ctx_t *conf_ctx = NULL;
+ axis2_transport_sender_t *transport_sender = NULL;
+ axis2_transport_out_desc_t *transport_out = NULL;
+ conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
+ if (conf_ctx)
+ {
+ axis2_conf_t *conf = axis2_conf_ctx_get_conf(conf_ctx, env);
+ if (conf)
+ {
+ axutil_array_list_t *phases =
+ axis2_conf_get_out_fault_flow(conf, env);
+ if (phases)
+ {
+ axis2_engine_invoke_phases(engine, env, phases, msg_ctx);
+ }
+ }
+ }
+
+ transport_out = axis2_msg_ctx_get_transport_out_desc(msg_ctx, env);
+
+ if (transport_out)
+ {
+ transport_sender =
+ axis2_transport_out_desc_get_sender(transport_out, env);
+ }
+
+ if (transport_sender)
+ {
+ AXIS2_TRANSPORT_SENDER_INVOKE(transport_sender, env, msg_ctx);
+ }
+ } */
return AXIS2_SUCCESS;
}
-
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_engine_receive_fault(
- axis2_engine_t *engine,
- const axutil_env_t *env,
- axis2_msg_ctx_t *msg_ctx)
+ axis2_engine_t * engine,
+ const axutil_env_t * env,
+ axis2_msg_ctx_t * msg_ctx)
{
axis2_op_ctx_t *op_ctx = NULL;
@@ -446,43 +455,46 @@
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
- op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
+ op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
if (!op_ctx)
{
/* if we do not have an op context that means this may be an incoming
dual channel response. So try to dispatch the service */
- axis2_conf_ctx_t *conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
+ axis2_conf_ctx_t *conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
if (conf_ctx)
{
- axis2_conf_t *conf = axis2_conf_ctx_get_conf(conf_ctx, env);
+ axis2_conf_t *conf = axis2_conf_ctx_get_conf(conf_ctx, env);
if (conf)
{
- axutil_array_list_t *phases =
- axis2_conf_get_in_phases_upto_and_including_post_dispatch(conf, env);
+ axutil_array_list_t *phases =
+ axis2_conf_get_in_phases_upto_and_including_post_dispatch
+ (conf, env);
if (phases)
{
- if ( axis2_msg_ctx_is_paused(msg_ctx, env))
+ if (axis2_msg_ctx_is_paused(msg_ctx, env))
{
- axis2_engine_resume_invocation_phases(engine,
- env, phases, msg_ctx);
+ axis2_engine_resume_invocation_phases(engine,
+ env, phases,
+ msg_ctx);
}
else
{
- axis2_engine_invoke_phases(engine, env, phases, msg_ctx);
+ axis2_engine_invoke_phases(engine, env, phases,
+ msg_ctx);
}
}
}
}
}
- op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
+ op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
/* find and execute the fault in flow handlers */
if (op_ctx)
{
- axis2_op_t *op = axis2_op_ctx_get_op(op_ctx, env);
+ axis2_op_t *op = axis2_op_ctx_get_op(op_ctx, env);
axutil_array_list_t *phases = axis2_op_get_fault_in_flow(op, env);
- if ( axis2_msg_ctx_is_paused(msg_ctx, env))
+ if (axis2_msg_ctx_is_paused(msg_ctx, env))
{
axis2_engine_resume_invocation_phases(engine, env, phases, msg_ctx);
}
@@ -497,11 +509,11 @@
AXIS2_EXTERN axis2_msg_ctx_t *AXIS2_CALL
axis2_engine_create_fault_msg_ctx(
- axis2_engine_t *engine,
- const axutil_env_t *env,
- axis2_msg_ctx_t *processing_context,
- const axis2_char_t *code_value,
- const axis2_char_t *reason_text)
+ axis2_engine_t * engine,
+ const axutil_env_t * env,
+ axis2_msg_ctx_t * processing_context,
+ const axis2_char_t * code_value,
+ const axis2_char_t * reason_text)
{
axis2_msg_ctx_t *fault_ctx = NULL;
axis2_endpoint_ref_t *fault_to = NULL;
@@ -517,44 +529,47 @@
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, processing_context, AXIS2_FAILURE);
- if ( axis2_msg_ctx_get_process_fault(processing_context, env))
+ if (axis2_msg_ctx_get_process_fault(processing_context, env))
{
AXIS2_ERROR_SET(env->error,
- AXIS2_ERROR_INVALID_STATE_PROCESSING_FAULT_ALREADY,
- AXIS2_FAILURE);
+ AXIS2_ERROR_INVALID_STATE_PROCESSING_FAULT_ALREADY,
+ AXIS2_FAILURE);
return NULL;
}
fault_ctx = axis2_msg_ctx_create(env, engine->conf_ctx,
- axis2_msg_ctx_get_transport_in_desc(processing_context, env),
- axis2_msg_ctx_get_transport_out_desc(processing_context, env));
+ axis2_msg_ctx_get_transport_in_desc
+ (processing_context, env),
+ axis2_msg_ctx_get_transport_out_desc
+ (processing_context, env));
- axis2_msg_ctx_set_process_fault(fault_ctx, env, AXIS2_TRUE);
+ axis2_msg_ctx_set_process_fault(fault_ctx, env, AXIS2_TRUE);
- fault_to = axis2_msg_ctx_get_fault_to(processing_context, env);
+ fault_to = axis2_msg_ctx_get_fault_to(processing_context, env);
if (fault_to)
{
- const axis2_char_t *address = axis2_endpoint_ref_get_address(fault_to, env);
+ const axis2_char_t *address =
+ axis2_endpoint_ref_get_address(fault_to, env);
if (!address)
{
fault_to = NULL;
}
else if (axutil_strcmp(AXIS2_WSA_NONE_URL, address) == 0 ||
- axutil_strcmp(AXIS2_WSA_NONE_URL_SUBMISSION, address) == 0)
+ axutil_strcmp(AXIS2_WSA_NONE_URL_SUBMISSION, address) == 0)
{
- reply_to = axis2_msg_ctx_get_reply_to(processing_context, env);
+ reply_to = axis2_msg_ctx_get_reply_to(processing_context, env);
if (reply_to)
{
- axis2_msg_ctx_set_fault_to(fault_ctx, env, reply_to);
+ axis2_msg_ctx_set_fault_to(fault_ctx, env, reply_to);
}
else
{
- axis2_msg_ctx_set_fault_to(fault_ctx, env, fault_to);
+ axis2_msg_ctx_set_fault_to(fault_ctx, env, fault_to);
}
}
else
{
- axis2_msg_ctx_set_fault_to(fault_ctx, env, fault_to);
+ axis2_msg_ctx_set_fault_to(fault_ctx, env, fault_to);
}
}
@@ -568,34 +583,35 @@
if (!fault_to && !stream)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NOWHERE_TO_SEND_FAULT, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NOWHERE_TO_SEND_FAULT,
+ AXIS2_FAILURE);
return NULL;
}
/* set WSA action */
- msg_info_headers =
+ msg_info_headers =
axis2_msg_ctx_get_msg_info_headers(processing_context, env);
if (msg_info_headers)
{
- wsa_action = axis2_msg_info_headers_get_action (msg_info_headers, env);
+ wsa_action = axis2_msg_info_headers_get_action(msg_info_headers, env);
if (wsa_action)
{
- /*
+ /*
We have to use the action set by user,
cannot use the default always.
- wsa_action = "http://www.w3.org/2005/08/addressing/fault"; */
- axis2_msg_ctx_set_wsa_action(fault_ctx, env, wsa_action);
+ wsa_action = "http://www.w3.org/2005/08/addressing/fault"; */
+ axis2_msg_ctx_set_wsa_action(fault_ctx, env, wsa_action);
}
}
/* set relates to */
- msg_id = axis2_msg_ctx_get_msg_id(processing_context, env);
+ msg_id = axis2_msg_ctx_get_msg_id(processing_context, env);
relates_to = axis2_relates_to_create(env, msg_id,
- AXIS2_WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE);
- axis2_msg_ctx_set_relates_to(fault_ctx, env, relates_to);
+ AXIS2_WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE);
+ axis2_msg_ctx_set_relates_to(fault_ctx, env, relates_to);
/* set msg id */
- msg_uuid = axutil_uuid_gen(env);
+ msg_uuid = axutil_uuid_gen(env);
axis2_msg_ctx_set_message_id(fault_ctx, env, msg_uuid);
if (msg_uuid)
{
@@ -603,27 +619,35 @@
msg_uuid = NULL;
}
- axis2_msg_ctx_set_op_ctx(fault_ctx, env,
- axis2_msg_ctx_get_op_ctx(processing_context, env));
- axis2_msg_ctx_set_process_fault(fault_ctx, env, AXIS2_TRUE);
- axis2_msg_ctx_set_server_side(fault_ctx, env, AXIS2_TRUE);
+ axis2_msg_ctx_set_op_ctx(fault_ctx, env,
+ axis2_msg_ctx_get_op_ctx(processing_context, env));
+ axis2_msg_ctx_set_process_fault(fault_ctx, env, AXIS2_TRUE);
+ axis2_msg_ctx_set_server_side(fault_ctx, env, AXIS2_TRUE);
- envelope = axis2_msg_ctx_get_fault_soap_envelope(processing_context, env);
+ envelope = axis2_msg_ctx_get_fault_soap_envelope(processing_context, env);
if (!envelope)
{
- if ( axis2_msg_ctx_get_is_soap_11(processing_context, env))
+ if (axis2_msg_ctx_get_is_soap_11(processing_context, env))
{
- envelope =
- axiom_soap_envelope_create_default_soap_fault_envelope(env,
- code_value, reason_text, AXIOM_SOAP11, NULL, NULL);
+ envelope =
+ axiom_soap_envelope_create_default_soap_fault_envelope(env,
+ code_value,
+ reason_text,
+ AXIOM_SOAP11,
+ NULL,
+ NULL);
}
else
{
- envelope =
- axiom_soap_envelope_create_default_soap_fault_envelope(env,
- code_value, reason_text, AXIOM_SOAP12, NULL, NULL);
+ envelope =
+ axiom_soap_envelope_create_default_soap_fault_envelope(env,
+ code_value,
+ reason_text,
+ AXIOM_SOAP12,
+ NULL,
+ NULL);
}
if (!envelope)
@@ -633,40 +657,38 @@
}
axis2_msg_ctx_set_soap_envelope(fault_ctx, env, envelope);
- axis2_msg_ctx_set_http_out_transport_info(fault_ctx, env,
- axis2_msg_ctx_get_http_out_transport_info(processing_context, env));
+ axis2_msg_ctx_set_http_out_transport_info(fault_ctx, env,
+ axis2_msg_ctx_get_http_out_transport_info
+ (processing_context, env));
return fault_ctx;
}
-
-
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_engine_invoke_phases(
- axis2_engine_t *engine,
- const axutil_env_t *env,
- axutil_array_list_t *phases,
- axis2_msg_ctx_t *msg_ctx)
+ axis2_engine_t * engine,
+ const axutil_env_t * env,
+ axutil_array_list_t * phases,
+ axis2_msg_ctx_t * msg_ctx)
{
int i = 0;
int count = 0;
axis2_status_t status = AXIS2_SUCCESS;
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
- "Start:axis2_engine_invoke_phases");
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Start:axis2_engine_invoke_phases");
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, phases, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
if (phases)
count = axutil_array_list_size(phases, env);
- for (i = 0; (i < count && !( axis2_msg_ctx_is_paused(msg_ctx, env))); i++)
+ for (i = 0; (i < count && !(axis2_msg_ctx_is_paused(msg_ctx, env))); i++)
{
axis2_phase_t *phase = (axis2_phase_t *)
- axutil_array_list_get(phases, env, i);
+ axutil_array_list_get(phases, env, i);
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
- "Invoking phase %s", axis2_phase_get_name(phase, env));
-
+ "Invoking phase %s", axis2_phase_get_name(phase, env));
+
status = axis2_phase_invoke(phase, env, msg_ctx);
if (status != AXIS2_SUCCESS)
@@ -674,54 +696,53 @@
return status;
}
}
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
- "End:axis2_engine_invoke_phases");
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "End:axis2_engine_invoke_phases");
return AXIS2_SUCCESS;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_engine_resume_invocation_phases(
- axis2_engine_t *engine,
- const axutil_env_t *env,
- axutil_array_list_t *phases,
- axis2_msg_ctx_t *msg_ctx)
+ axis2_engine_t * engine,
+ const axutil_env_t * env,
+ axutil_array_list_t * phases,
+ axis2_msg_ctx_t * msg_ctx)
{
int i = 0;
int count = 0;
axis2_bool_t found_match = AXIS2_FALSE;
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
- "Start:axis2_engine_resume_invocation_phases");
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+ "Start:axis2_engine_resume_invocation_phases");
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, phases, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
- axis2_msg_ctx_set_paused(msg_ctx, env, AXIS2_FALSE);
+ axis2_msg_ctx_set_paused(msg_ctx, env, AXIS2_FALSE);
count = axutil_array_list_size(phases, env);
- for (i = 0; i < count && !( axis2_msg_ctx_is_paused(msg_ctx, env)); i++)
+ for (i = 0; i < count && !(axis2_msg_ctx_is_paused(msg_ctx, env)); i++)
{
axis2_phase_t *phase = (axis2_phase_t *) axutil_array_list_get(phases,
- env, i);
- const axis2_char_t *phase_name = axis2_phase_get_name(phase, env);
- const axis2_char_t *paused_phase_name =
+ env, i);
+ const axis2_char_t *phase_name = axis2_phase_get_name(phase, env);
+ const axis2_char_t *paused_phase_name =
axis2_msg_ctx_get_paused_phase_name(msg_ctx, env);
/* skip invoking handlers until we find the paused phase */
- if (phase_name && paused_phase_name && 0 ==
+ if (phase_name && paused_phase_name && 0 ==
axutil_strcmp(phase_name, paused_phase_name))
{
int paused_handler_i = -1;
found_match = AXIS2_TRUE;
- paused_handler_i = axis2_msg_ctx_get_current_handler_index(msg_ctx,
- env);
+ paused_handler_i = axis2_msg_ctx_get_current_handler_index(msg_ctx,
+ env);
/* invoke the paused handler and rest of the handlers of the paused
* phase */
axis2_phase_invoke_start_from_handler(phase, env, paused_handler_i,
- msg_ctx);
+ msg_ctx);
}
- else
+ else
{
/* now we have found the paused phase and invoked the rest of the
* handlers of that phase, invoke all the phases after that */
@@ -732,17 +753,16 @@
}
}
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
- "End:axis2_engine_resume_invocation_phases");
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+ "End:axis2_engine_resume_invocation_phases");
return AXIS2_SUCCESS;
}
-
AXIS2_EXTERN const axis2_char_t *AXIS2_CALL
axis2_engine_get_receiver_fault_code(
- const axis2_engine_t *engine,
- const axutil_env_t *env,
- const axis2_char_t *soap_namespace)
+ const axis2_engine_t * engine,
+ const axutil_env_t * env,
+ const axis2_char_t * soap_namespace)
{
if (axutil_strcmp(AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI, soap_namespace))
return AXIOM_SOAP12_FAULT_CODE_RECEIVER;
@@ -753,8 +773,8 @@
axis2_status_t
axis2_engine_check_must_understand_headers(
- const axutil_env_t *env,
- axis2_msg_ctx_t *msg_ctx)
+ const axutil_env_t * env,
+ axis2_msg_ctx_t * msg_ctx)
{
axiom_soap_envelope_t *soap_envelope = NULL;
axiom_soap_header_t *soap_header = NULL;
@@ -764,7 +784,7 @@
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
- soap_envelope = axis2_msg_ctx_get_soap_envelope(msg_ctx, env);
+ soap_envelope = axis2_msg_ctx_get_soap_envelope(msg_ctx, env);
if (!soap_envelope)
return AXIS2_FAILURE;
@@ -777,19 +797,19 @@
return AXIS2_SUCCESS;
for (hash_index = axutil_hash_first(header_block_ht, env); hash_index;
- hash_index = axutil_hash_next(env, hash_index))
+ hash_index = axutil_hash_next(env, hash_index))
{
void *hb = NULL;
axiom_soap_header_block_t *header_block = NULL;
axis2_char_t *role = NULL;
axutil_hash_this(hash_index, NULL, NULL, &hb);
- header_block = (axiom_soap_header_block_t *)hb;
+ header_block = (axiom_soap_header_block_t *) hb;
if (header_block)
{
- if (axiom_soap_header_block_is_processed(header_block , env) ||
- !axiom_soap_header_block_get_must_understand(header_block, env))
+ if (axiom_soap_header_block_is_processed(header_block, env) ||
+ !axiom_soap_header_block_get_must_understand(header_block, env))
{
continue;
}
@@ -801,35 +821,41 @@
that role too have been dealt with. */
role = axiom_soap_header_block_get_role(header_block, env);
- if ( axis2_msg_ctx_get_is_soap_11(msg_ctx, env) != AXIS2_TRUE)
+ if (axis2_msg_ctx_get_is_soap_11(msg_ctx, env) != AXIS2_TRUE)
{
/* SOAP 1.2 */
- if (!role || axutil_strcmp(role, AXIOM_SOAP12_SOAP_ROLE_NEXT) != 0)
+ if (!role ||
+ axutil_strcmp(role, AXIOM_SOAP12_SOAP_ROLE_NEXT) != 0)
{
axiom_soap_envelope_t *temp_env =
- axiom_soap_envelope_create_default_soap_fault_envelope(env,
- "soapenv:MustUnderstand",
- "Header not understood",
- AXIOM_SOAP12, NULL, NULL);
- axis2_msg_ctx_set_fault_soap_envelope(msg_ctx, env, temp_env);
- axis2_msg_ctx_set_wsa_action(msg_ctx, env,
- "http://www.w3.org/2005/08/addressing/fault");
+ axiom_soap_envelope_create_default_soap_fault_envelope
+ (env,
+ "soapenv:MustUnderstand",
+ "Header not understood",
+ AXIOM_SOAP12, NULL, NULL);
+ axis2_msg_ctx_set_fault_soap_envelope(msg_ctx, env,
+ temp_env);
+ axis2_msg_ctx_set_wsa_action(msg_ctx, env,
+ "http://www.w3.org/2005/08/addressing/fault");
return AXIS2_FAILURE;
}
}
else
{
/* SOAP 1.1 */
- if (!role || axutil_strcmp(role, AXIOM_SOAP11_SOAP_ACTOR_NEXT) != 0)
+ if (!role ||
+ axutil_strcmp(role, AXIOM_SOAP11_SOAP_ACTOR_NEXT) != 0)
{
axiom_soap_envelope_t *temp_env =
- axiom_soap_envelope_create_default_soap_fault_envelope(env,
- "soapenv:MustUnderstand",
- "Header not understood",
- AXIOM_SOAP11, NULL, NULL);
- axis2_msg_ctx_set_fault_soap_envelope(msg_ctx, env, temp_env);
- axis2_msg_ctx_set_wsa_action(msg_ctx, env,
- "http://www.w3.org/2005/08/addressing/fault");
+ axiom_soap_envelope_create_default_soap_fault_envelope
+ (env,
+ "soapenv:MustUnderstand",
+ "Header not understood",
+ AXIOM_SOAP11, NULL, NULL);
+ axis2_msg_ctx_set_fault_soap_envelope(msg_ctx, env,
+ temp_env);
+ axis2_msg_ctx_set_wsa_action(msg_ctx, env,
+ "http://www.w3.org/2005/08/addressing/fault");
return AXIS2_FAILURE;
}
@@ -843,52 +869,53 @@
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_engine_resume_receive(
- axis2_engine_t *engine,
- const axutil_env_t *env,
- axis2_msg_ctx_t *msg_ctx)
+ axis2_engine_t * engine,
+ const axutil_env_t * env,
+ axis2_msg_ctx_t * msg_ctx)
{
axis2_status_t status = AXIS2_FAILURE;
axis2_conf_ctx_t *conf_ctx = NULL;
axis2_conf_t *conf = NULL;
axutil_array_list_t *phases = NULL;
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Start:axis2_engine_resume_receive");
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
+ "Start:axis2_engine_resume_receive");
/* find and invoke the phases */
- conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
- conf = axis2_conf_ctx_get_conf(conf_ctx, env);
+ conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
+ conf = axis2_conf_ctx_get_conf(conf_ctx, env);
phases =
- axis2_conf_get_in_phases_upto_and_including_post_dispatch(conf, env);
+ axis2_conf_get_in_phases_upto_and_including_post_dispatch(conf, env);
axis2_engine_resume_invocation_phases(engine, env, phases, msg_ctx);
/* invoking the message receiver */
- if ( axis2_msg_ctx_get_server_side(msg_ctx, env) &&
- !axis2_msg_ctx_is_paused(msg_ctx, env))
+ if (axis2_msg_ctx_get_server_side(msg_ctx, env) &&
+ !axis2_msg_ctx_is_paused(msg_ctx, env))
{
/* invoke the message receivers */
axis2_op_ctx_t *op_ctx = NULL;
- status =
- axis2_engine_check_must_understand_headers(env, msg_ctx);
+ status = axis2_engine_check_must_understand_headers(env, msg_ctx);
if (status != AXIS2_SUCCESS)
return status;
- op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
+ op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
if (op_ctx)
{
- axis2_op_t *op = axis2_op_ctx_get_op(op_ctx, env);
+ axis2_op_t *op = axis2_op_ctx_get_op(op_ctx, env);
if (op)
{
axis2_msg_recv_t *receiver = NULL;
receiver = axis2_op_get_msg_recv(op, env);
if (!receiver)
{
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
- "Message receiver not set in operation description");
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+ "Message receiver not set in operation description");
return AXIS2_FAILURE;
}
- status = axis2_msg_recv_receive(receiver, env, msg_ctx,
- axis2_msg_recv_get_derived(receiver, env));
+ status = axis2_msg_recv_receive(receiver, env, msg_ctx,
+ axis2_msg_recv_get_derived
+ (receiver, env));
}
}
}
@@ -898,9 +925,9 @@
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_engine_resume_send(
- axis2_engine_t *engine,
- const axutil_env_t *env,
- axis2_msg_ctx_t *msg_ctx)
+ axis2_engine_t * engine,
+ const axutil_env_t * env,
+ axis2_msg_ctx_t * msg_ctx)
{
axis2_op_ctx_t *op_ctx = NULL;
axutil_array_list_t *phases = NULL;
@@ -908,10 +935,10 @@
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Start:axis2_engine_resume_send");
/* invoke the phases */
- op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
+ op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
if (op_ctx)
{
- axis2_op_t *op = axis2_op_ctx_get_op(op_ctx, env);
+ axis2_op_t *op = axis2_op_ctx_get_op(op_ctx, env);
if (op)
{
phases = axis2_op_get_out_flow(op, env);
@@ -925,7 +952,7 @@
/* write the message to the wire */
axis2_transport_out_desc_t *transport_out = NULL;
axis2_transport_sender_t *sender = NULL;
- transport_out = axis2_msg_ctx_get_transport_out_desc(msg_ctx, env);
+ transport_out = axis2_msg_ctx_get_transport_out_desc(msg_ctx, env);
if (transport_out)
{
sender = axis2_transport_out_desc_get_sender(transport_out, env);
Modified: webservices/axis2/trunk/c/src/core/engine/handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/engine/handler.c?rev=580276&r1=580275&r2=580276&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/engine/handler.c (original)
+++ webservices/axis2/trunk/c/src/core/engine/handler.c Fri Sep 28 02:52:58 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -20,8 +21,10 @@
struct axis2_handler
{
+
/** handler description. This is a reference, hence a shallow copy. */
axis2_handler_desc_t *handler_desc;
+
/**
* Invoke is called to do the actual work assigned to the handler.
* The phase that owns the handler is responsible for calling invoke
@@ -33,15 +36,16 @@
* @param msg_ctx pointer to message context
* @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
*/
- axis2_status_t (AXIS2_CALL *
- invoke)(axis2_handler_t *handler,
- const axutil_env_t *env,
- struct axis2_msg_ctx *msg_ctx);
+ axis2_status_t(
+ AXIS2_CALL * invoke) (
+ axis2_handler_t * handler,
+ const axutil_env_t * env,
+ struct axis2_msg_ctx * msg_ctx);
};
AXIS2_EXTERN axis2_handler_t *AXIS2_CALL
axis2_handler_create(
- const axutil_env_t *env)
+ const axutil_env_t * env)
{
axis2_handler_t *handler = NULL;
@@ -62,8 +66,8 @@
AXIS2_EXTERN void AXIS2_CALL
axis2_handler_free(
- axis2_handler_t *handler,
- const axutil_env_t *env)
+ axis2_handler_t * handler,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_FREE(env->allocator, handler);
@@ -72,8 +76,8 @@
AXIS2_EXTERN const axutil_string_t *AXIS2_CALL
axis2_handler_get_name(
- const axis2_handler_t *handler,
- const axutil_env_t *env)
+ const axis2_handler_t * handler,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, NULL);
@@ -84,18 +88,19 @@
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axis2_handler_invoke(axis2_handler_t *handler,
- const axutil_env_t *env,
- struct axis2_msg_ctx *msg_ctx)
+axis2_handler_invoke(
+ axis2_handler_t * handler,
+ const axutil_env_t * env,
+ struct axis2_msg_ctx * msg_ctx)
{
return handler->invoke(handler, env, msg_ctx);
}
AXIS2_EXTERN axutil_param_t *AXIS2_CALL
axis2_handler_get_param(
- const axis2_handler_t *handler,
- const axutil_env_t *env,
- const axis2_char_t *name)
+ const axis2_handler_t * handler,
+ const axutil_env_t * env,
+ const axis2_char_t * name)
{
AXIS2_ENV_CHECK(env, NULL);
@@ -107,9 +112,9 @@
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_handler_init(
- axis2_handler_t *handler,
- const axutil_env_t *env,
- axis2_handler_desc_t *handler_desc)
+ axis2_handler_t * handler,
+ const axutil_env_t * env,
+ axis2_handler_desc_t * handler_desc)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
handler->handler_desc = handler_desc;
@@ -120,16 +125,16 @@
AXIS2_EXTERN axis2_handler_desc_t *AXIS2_CALL
axis2_handler_get_handler_desc(
- const axis2_handler_t *handler,
- const axutil_env_t *env)
+ const axis2_handler_t * handler,
+ const axutil_env_t * env)
{
return handler->handler_desc;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_handler_set_invoke(
- axis2_handler_t *handler,
- const axutil_env_t *env,
+ axis2_handler_t * handler,
+ const axutil_env_t * env,
void *func)
{
handler->invoke = func;
Modified: webservices/axis2/trunk/c/src/core/engine/phase.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/engine/phase.c?rev=580276&r1=580275&r2=580276&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/engine/phase.c (original)
+++ webservices/axis2/trunk/c/src/core/engine/phase.c Fri Sep 28 02:52:58 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -15,39 +16,43 @@
* limitations under the License.
*/
-
#include <axutil_string.h>
#include <axis2_phase.h>
#include <axutil_array_list.h>
#include <axis2_msg_ctx.h>
#include <axis2_const.h>
-static axis2_status_t
-axis2_phase_add_unique(
- const axutil_env_t *env,
- axutil_array_list_t *list,
- axis2_handler_t *handler);
-
-static axis2_status_t
-axis2_phase_remove_unique(
- const axutil_env_t *env,
- axutil_array_list_t *list,
- axis2_handler_t *handler);
+static axis2_status_t axis2_phase_add_unique(
+ const axutil_env_t * env,
+ axutil_array_list_t * list,
+ axis2_handler_t * handler);
+
+static axis2_status_t axis2_phase_remove_unique(
+ const axutil_env_t * env,
+ axutil_array_list_t * list,
+ axis2_handler_t * handler);
struct axis2_phase
{
+
/** phase name */
axis2_char_t *name;
+
/** array list of handlers */
- axutil_array_list_t* handlers;
+ axutil_array_list_t *handlers;
+
/** first handler of phase */
axis2_handler_t *first_handler;
+
/** first handler of phase set? */
axis2_bool_t first_handler_set;
+
/** last handler of phase */
axis2_handler_t *last_handler;
+
/** last handler of phase set? */
axis2_bool_t last_handler_set;
+
/**
* handler_first and handler_last are the same handler
* that is for this phase there is only one handler
@@ -59,8 +64,8 @@
AXIS2_EXTERN axis2_phase_t *AXIS2_CALL
axis2_phase_create(
- const axutil_env_t *env,
- const axis2_char_t *phase_name)
+ const axutil_env_t * env,
+ const axis2_char_t * phase_name)
{
axis2_phase_t *phase = NULL;
@@ -85,6 +90,7 @@
phase->handlers = axutil_array_list_create(env, 10);
if (!(phase->handlers))
{
+
/** error is already set by last method array list container create */
axis2_phase_free(phase, env);
return NULL;
@@ -106,75 +112,75 @@
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_phase_add_handler_at(
- axis2_phase_t *phase,
- const axutil_env_t *env,
+ axis2_phase_t * phase,
+ const axutil_env_t * env,
int index,
- axis2_handler_t *handler)
+ axis2_handler_t * handler)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
- "axis2_handler_t *%s added to the index %d of the phase %s",
- axutil_string_get_buffer(axis2_handler_get_name(handler, env), env),
- index,
- phase->name);
+ "axis2_handler_t *%s added to the index %d of the phase %s",
+ axutil_string_get_buffer(axis2_handler_get_name
+ (handler, env), env), index,
+ phase->name);
return axutil_array_list_add_at(phase->handlers, env, index, handler);
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_phase_add_handler(
- axis2_phase_t *phase,
- const axutil_env_t *env,
- axis2_handler_t *handler)
+ axis2_phase_t * phase,
+ const axutil_env_t * env,
+ axis2_handler_t * handler)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_LOG_INFO(env->log, "Handler %s added to phase %s",
- axutil_string_get_buffer(axis2_handler_get_name(handler, env), env),
- phase->name);
+ axutil_string_get_buffer(axis2_handler_get_name
+ (handler, env), env), phase->name);
return axis2_phase_add_unique(env, phase->handlers, handler);
}
-
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_phase_remove_handler(
- axis2_phase_t *phase,
- const axutil_env_t *env,
- axis2_handler_t *handler)
+ axis2_phase_t * phase,
+ const axutil_env_t * env,
+ axis2_handler_t * handler)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_LOG_INFO(env->log, "Handler %s romoved from phase %s",
- axutil_string_get_buffer(axis2_handler_get_name(handler, env), env),
- phase->name);
+ axutil_string_get_buffer(axis2_handler_get_name
+ (handler, env), env), phase->name);
return axis2_phase_remove_unique(env, phase->handlers, handler);
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_phase_invoke(
- axis2_phase_t *phase,
- const axutil_env_t *env,
- axis2_msg_ctx_t *msg_ctx)
+ axis2_phase_t * phase,
+ const axutil_env_t * env,
+ axis2_msg_ctx_t * msg_ctx)
{
- int index = 0, size = 0;
+ int index = 0,
+ size = 0;
axis2_status_t status = AXIS2_SUCCESS;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- axis2_msg_ctx_set_paused_phase_name(msg_ctx, env, phase->name);
+ axis2_msg_ctx_set_paused_phase_name(msg_ctx, env, phase->name);
if (phase->first_handler)
{
- if ( axis2_msg_ctx_is_paused(msg_ctx, env))
+ if (axis2_msg_ctx_is_paused(msg_ctx, env))
{
return AXIS2_SUCCESS;
}
else
{
AXIS2_LOG_INFO(env->log,
- "Invoke the first handler %s within the phase %s",
- axutil_string_get_buffer(
- axis2_handler_get_name(phase->first_handler, env), env),
- phase->name);
+ "Invoke the first handler %s within the phase %s",
+ axutil_string_get_buffer(axis2_handler_get_name
+ (phase->first_handler, env),
+ env), phase->name);
status = axis2_handler_invoke(phase->first_handler, env, msg_ctx);
if (status != AXIS2_SUCCESS)
@@ -185,20 +191,21 @@
size = axutil_array_list_size(phase->handlers, env);
while (index < size)
{
- if ( axis2_msg_ctx_is_paused(msg_ctx, env))
+ if (axis2_msg_ctx_is_paused(msg_ctx, env))
{
break;
}
else
{
- axis2_handler_t *handler = (axis2_handler_t*)
- axutil_array_list_get(phase->handlers, env, index);
+ axis2_handler_t *handler = (axis2_handler_t *)
+ axutil_array_list_get(phase->handlers, env, index);
if (handler)
{
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
- "Invoke the handler %s within the phase %s",
- axutil_string_get_buffer(axis2_handler_get_name(handler, env), env),
- phase->name);
+ "Invoke the handler %s within the phase %s",
+ axutil_string_get_buffer(axis2_handler_get_name
+ (handler, env), env),
+ phase->name);
status = axis2_handler_invoke(handler, env, msg_ctx);
if (status != AXIS2_SUCCESS)
return status;
@@ -210,20 +217,20 @@
}
}
- /* If phase last handler is there invoke it here*/
+ /* If phase last handler is there invoke it here */
if (phase->last_handler)
{
- if ( axis2_msg_ctx_is_paused(msg_ctx, env))
+ if (axis2_msg_ctx_is_paused(msg_ctx, env))
{
return AXIS2_SUCCESS;
}
else
{
- AXIS2_LOG_INFO(env->log,
- "Invoke the last handler %s within the phase %s",
- axutil_string_get_buffer(
- axis2_handler_get_name(phase->last_handler, env), env),
- phase->name);
+ AXIS2_LOG_INFO(env->log,
+ "Invoke the last handler %s within the phase %s",
+ axutil_string_get_buffer(axis2_handler_get_name
+ (phase->last_handler, env),
+ env), phase->name);
status = axis2_handler_invoke(phase->last_handler, env, msg_ctx);
if (status != AXIS2_SUCCESS)
return status;
@@ -233,30 +240,29 @@
return AXIS2_SUCCESS;
}
-
AXIS2_EXTERN const axis2_char_t *AXIS2_CALL
axis2_phase_get_name(
- const axis2_phase_t *phase,
- const axutil_env_t *env)
+ const axis2_phase_t * phase,
+ const axutil_env_t * env)
{
return phase->name;
}
AXIS2_EXTERN int AXIS2_CALL
axis2_phase_get_handler_count(
- const axis2_phase_t *phase,
- const axutil_env_t *env)
+ const axis2_phase_t * phase,
+ const axutil_env_t * env)
{
return axutil_array_list_size(phase->handlers, env);
}
-
AXIS2_EXTERN int AXIS2_CALL
_axis2_phase_get_before_after(
- axis2_handler_t *handler,
- const axutil_env_t *env)
+ axis2_handler_t * handler,
+ const axutil_env_t * env)
{
- const axis2_char_t *before = NULL, *after = NULL;
+ const axis2_char_t *before = NULL,
+ *after = NULL;
axis2_handler_desc_t *handler_desc = NULL;
axis2_phase_rule_t *rules = NULL;
@@ -265,14 +271,16 @@
handler_desc = axis2_handler_get_handler_desc(handler, env);
if (!handler_desc)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
rules = axis2_handler_desc_get_rules(handler_desc, env);
if (!rules)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
@@ -283,7 +291,8 @@
{
if (axutil_strcmp(before, after) == 0)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_BEFORE_AFTER_HANDLERS_SAME, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_BEFORE_AFTER_HANDLERS_SAME,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
return AXIS2_PHASE_BOTH_BEFORE_AFTER;
@@ -304,22 +313,24 @@
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_phase_set_first_handler(
- axis2_phase_t *phase,
- const axutil_env_t *env,
- axis2_handler_t *handler)
+ axis2_phase_t * phase,
+ const axutil_env_t * env,
+ axis2_handler_t * handler)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
if (phase->first_handler_set)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_PHASE_FIRST_HANDLER_ALREADY_SET, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_PHASE_FIRST_HANDLER_ALREADY_SET,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
else
{
if (_axis2_phase_get_before_after(handler, env) != AXIS2_PHASE_ANYWHERE)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_PHASE_FIRST_HANDLER, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_PHASE_FIRST_HANDLER,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
phase->first_handler = handler;
@@ -331,22 +342,24 @@
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_phase_set_last_handler(
- axis2_phase_t *phase,
- const axutil_env_t *env,
- axis2_handler_t *handler)
+ axis2_phase_t * phase,
+ const axutil_env_t * env,
+ axis2_handler_t * handler)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
if (phase->last_handler_set)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_PHASE_LAST_HANDLER_ALREADY_SET, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_PHASE_LAST_HANDLER_ALREADY_SET,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
else
{
if (_axis2_phase_get_before_after(handler, env) != AXIS2_PHASE_ANYWHERE)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_PHASE_LAST_HANDLER, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_PHASE_LAST_HANDLER,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
phase->last_handler = handler;
@@ -358,20 +371,22 @@
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_phase_add_handler_desc(
- axis2_phase_t *phase,
- const axutil_env_t *env,
- axis2_handler_desc_t *handler_desc)
+ axis2_phase_t * phase,
+ const axutil_env_t * env,
+ axis2_handler_desc_t * handler_desc)
{
axis2_phase_rule_t *rules = NULL;
axis2_handler_t *handler = NULL;
axis2_status_t status = AXIS2_SUCCESS;
- axis2_bool_t first = AXIS2_FALSE, last = AXIS2_FALSE;
+ axis2_bool_t first = AXIS2_FALSE,
+ last = AXIS2_FALSE;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
if (phase->is_one_handler)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_PHASE_ADD_HANDLER_INVALID, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_PHASE_ADD_HANDLER_INVALID,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
else
@@ -379,7 +394,8 @@
rules = axis2_handler_desc_get_rules(handler_desc, env);
if (!rules)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
@@ -390,18 +406,20 @@
{
if (axutil_array_list_size(phase->handlers, env) > 0)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_RULES, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_RULES,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
handler = axis2_handler_desc_get_handler(handler_desc, env);
if (!handler)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
- /*status = axutil_array_list_add(phase->handlers, env, handler);*/
+ /*status = axutil_array_list_add(phase->handlers, env, handler); */
status = axis2_phase_add_unique(env, phase->handlers, handler);
if (status == AXIS2_SUCCESS)
phase->is_one_handler = AXIS2_TRUE;
@@ -412,7 +430,8 @@
handler = axis2_handler_desc_get_handler(handler_desc, env);
if (!handler)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
return axis2_phase_set_first_handler(phase, env, handler);
@@ -422,7 +441,8 @@
handler = axis2_handler_desc_get_handler(handler_desc, env);
if (!handler)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
return axis2_phase_set_last_handler(phase, env, handler);
@@ -432,7 +452,8 @@
handler = axis2_handler_desc_get_handler(handler_desc, env);
if (!handler)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
@@ -443,23 +464,27 @@
AXIS2_EXTERN axis2_bool_t AXIS2_CALL
_axis2_phase_is_valid_before(
- axis2_phase_t *phase,
- const axutil_env_t *env,
- axis2_handler_t *handler)
+ axis2_phase_t * phase,
+ const axutil_env_t * env,
+ axis2_handler_t * handler)
{
axis2_phase_rule_t *rules = NULL;
axis2_handler_desc_t *handler_desc = NULL;
- const axis2_char_t *first_handler_name = NULL, *before = NULL;
+ const axis2_char_t *first_handler_name = NULL,
+ *before = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
if (phase->first_handler)
{
- handler_desc = axis2_handler_get_handler_desc(phase->first_handler, env);
+ handler_desc =
+ axis2_handler_get_handler_desc(phase->first_handler, env);
if (!handler_desc)
return AXIS2_TRUE;
- first_handler_name = axutil_string_get_buffer(axis2_handler_desc_get_name(handler_desc, env), env);
+ first_handler_name =
+ axutil_string_get_buffer(axis2_handler_desc_get_name
+ (handler_desc, env), env);
if (!first_handler_name)
return AXIS2_TRUE;
@@ -487,13 +512,14 @@
AXIS2_EXTERN axis2_bool_t AXIS2_CALL
_axis2_phase_is_valid_after(
- axis2_phase_t *phase,
- const axutil_env_t *env,
- axis2_handler_t *handler)
+ axis2_phase_t * phase,
+ const axutil_env_t * env,
+ axis2_handler_t * handler)
{
axis2_phase_rule_t *rules = NULL;
axis2_handler_desc_t *handler_desc = NULL;
- const axis2_char_t *last_handler_name = NULL, *after = NULL;
+ const axis2_char_t *last_handler_name = NULL,
+ *after = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -503,7 +529,9 @@
if (!handler_desc)
return AXIS2_TRUE;
- last_handler_name = axutil_string_get_buffer(axis2_handler_desc_get_name(handler_desc, env), env);
+ last_handler_name =
+ axutil_string_get_buffer(axis2_handler_desc_get_name
+ (handler_desc, env), env);
if (!last_handler_name)
return AXIS2_TRUE;
@@ -531,13 +559,14 @@
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_phase_insert_before(
- axis2_phase_t *phase,
- const axutil_env_t *env,
- axis2_handler_t *handler)
+ axis2_phase_t * phase,
+ const axutil_env_t * env,
+ axis2_handler_t * handler)
{
axis2_phase_rule_t *rules = NULL;
axis2_handler_desc_t *handler_desc = NULL;
- const axis2_char_t *handler_name = NULL, *before = NULL;
+ const axis2_char_t *handler_name = NULL,
+ *before = NULL;
int i = 0;
int size = 0;
@@ -546,21 +575,24 @@
handler_desc = axis2_handler_get_handler_desc(handler, env);
if (!handler_desc)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
rules = axis2_handler_desc_get_rules(handler_desc, env);
if (!rules)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
before = axis2_phase_rule_get_before(rules, env);
if (!before)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
@@ -569,20 +601,24 @@
handler_desc = axis2_handler_get_handler_desc(phase->last_handler, env);
if (!handler_desc)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
- handler_name = axutil_string_get_buffer(axis2_handler_desc_get_name(handler_desc, env), env);
+ handler_name =
+ axutil_string_get_buffer(axis2_handler_desc_get_name
+ (handler_desc, env), env);
if (!handler_name)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
if (axutil_strcmp(before, handler_name) == 0)
{
- /*return axutil_array_list_add(phase->handlers, env, handler);*/
+ /*return axutil_array_list_add(phase->handlers, env, handler); */
return axis2_phase_add_unique(env, phase->handlers, handler);
}
}
@@ -591,26 +627,32 @@
for (i = 0; i < size; i++)
{
- axis2_handler_t *temp_handler = (axis2_handler_t *) axutil_array_list_get(phase->handlers, env, i);
+ axis2_handler_t *temp_handler =
+ (axis2_handler_t *) axutil_array_list_get(phase->handlers, env, i);
if (temp_handler)
{
handler_desc = axis2_handler_get_handler_desc(temp_handler, env);
if (!handler_desc)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
- handler_name = axutil_string_get_buffer(axis2_handler_desc_get_name(handler_desc, env), env);
+ handler_name =
+ axutil_string_get_buffer(axis2_handler_desc_get_name
+ (handler_desc, env), env);
if (!handler_name)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
if (axutil_strcmp(before, handler_name) == 0)
{
- return axutil_array_list_add_at(phase->handlers, env, i, handler);
+ return axutil_array_list_add_at(phase->handlers, env, i,
+ handler);
}
}
}
@@ -621,9 +663,9 @@
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_phase_insert_after(
- axis2_phase_t *phase,
- const axutil_env_t *env,
- axis2_handler_t *handler)
+ axis2_phase_t * phase,
+ const axutil_env_t * env,
+ axis2_handler_t * handler)
{
axis2_phase_rule_t *rules = NULL;
axis2_handler_desc_t *handler_desc = NULL;
@@ -637,37 +679,45 @@
handler_desc = axis2_handler_get_handler_desc(handler, env);
if (!handler_desc)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
rules = axis2_handler_desc_get_rules(handler_desc, env);
if (!rules)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
after = axis2_phase_rule_get_after(rules, env);
if (!after)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
if (phase->first_handler)
{
- handler_desc = axis2_handler_get_handler_desc(phase->first_handler, env);
+ handler_desc =
+ axis2_handler_get_handler_desc(phase->first_handler, env);
if (!handler_desc)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
- handler_name = axutil_string_get_buffer(axis2_handler_desc_get_name(handler_desc, env), env);
+ handler_name =
+ axutil_string_get_buffer(axis2_handler_desc_get_name
+ (handler_desc, env), env);
if (!handler_name)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
@@ -681,20 +731,25 @@
for (i = 0; i < size; i++)
{
- axis2_handler_t *temp_handler = (axis2_handler_t *) axutil_array_list_get(phase->handlers, env, i);
+ axis2_handler_t *temp_handler =
+ (axis2_handler_t *) axutil_array_list_get(phase->handlers, env, i);
if (temp_handler)
{
handler_desc = axis2_handler_get_handler_desc(temp_handler, env);
if (!handler_desc)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
- handler_name = axutil_string_get_buffer(axis2_handler_desc_get_name(handler_desc, env), env);
+ handler_name =
+ axutil_string_get_buffer(axis2_handler_desc_get_name
+ (handler_desc, env), env);
if (!handler_name)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
@@ -702,10 +757,12 @@
{
if (i == (size - 1))
{
- return axis2_phase_add_unique(env, phase->handlers, handler);
+ return axis2_phase_add_unique(env, phase->handlers,
+ handler);
}
else
- return axutil_array_list_add_at(phase->handlers, env, i + 1, handler);
+ return axutil_array_list_add_at(phase->handlers, env, i + 1,
+ handler);
}
}
}
@@ -720,16 +777,19 @@
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_phase_insert_before_and_after(
- axis2_phase_t *phase,
- const axutil_env_t *env,
- axis2_handler_t *handler)
+ axis2_phase_t * phase,
+ const axutil_env_t * env,
+ axis2_handler_t * handler)
{
int before = -1;
int after = -1;
axis2_phase_rule_t *rules = NULL;
axis2_handler_desc_t *handler_desc = NULL;
- const axis2_char_t *before_handler_name = NULL, *after_handler_name = NULL,
- *after_name = NULL, *before_name = NULL, *handler_name = NULL;
+ const axis2_char_t *before_handler_name = NULL,
+ *after_handler_name = NULL,
+ *after_name = NULL,
+ *before_name = NULL,
+ *handler_name = NULL;
int i = 0;
int size = 0;
@@ -738,44 +798,53 @@
handler_desc = axis2_handler_get_handler_desc(handler, env);
if (!handler_desc)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
rules = axis2_handler_desc_get_rules(handler_desc, env);
if (!rules)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
before_name = axis2_phase_rule_get_before(rules, env);
if (!before_name)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
after_name = axis2_phase_rule_get_after(rules, env);
if (!after_name)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
if (phase->first_handler)
{
- handler_desc = axis2_handler_get_handler_desc(phase->first_handler, env);
+ handler_desc =
+ axis2_handler_get_handler_desc(phase->first_handler, env);
if (!handler_desc)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
- before_handler_name = axutil_string_get_buffer(axis2_handler_desc_get_name(handler_desc, env), env);
+ before_handler_name =
+ axutil_string_get_buffer(axis2_handler_desc_get_name
+ (handler_desc, env), env);
if (!handler_name)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
}
@@ -785,14 +854,18 @@
handler_desc = axis2_handler_get_handler_desc(phase->last_handler, env);
if (!handler_desc)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
- after_handler_name = axutil_string_get_buffer(axis2_handler_desc_get_name(handler_desc, env), env);
+ after_handler_name =
+ axutil_string_get_buffer(axis2_handler_desc_get_name
+ (handler_desc, env), env);
if (!handler_name)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
}
@@ -800,7 +873,7 @@
if (before_handler_name && after_handler_name)
{
if (axutil_strcmp(before_handler_name, before_name) == 0 &&
- axutil_strcmp(after_handler_name, after_name) == 0)
+ axutil_strcmp(after_handler_name, after_name) == 0)
{
return axis2_phase_add_unique(env, phase->handlers, handler);
}
@@ -822,20 +895,25 @@
for (i = 0; i < size; i++)
{
- axis2_handler_t *temp_handler = (axis2_handler_t *) axutil_array_list_get(phase->handlers, env, i);
+ axis2_handler_t *temp_handler =
+ (axis2_handler_t *) axutil_array_list_get(phase->handlers, env, i);
if (temp_handler)
{
handler_desc = axis2_handler_get_handler_desc(temp_handler, env);
if (!handler_desc)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
- handler_name = axutil_string_get_buffer(axis2_handler_desc_get_name(handler_desc, env), env);
+ handler_name =
+ axutil_string_get_buffer(axis2_handler_desc_get_name
+ (handler_desc, env), env);
if (!handler_name)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
@@ -850,18 +928,21 @@
/*both the before and after indexes have been found */
if (after > before)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
else
{
if (after + 1 < size)
{
- return axutil_array_list_add_at(phase->handlers, env, after + 1, handler);
+ return axutil_array_list_add_at(phase->handlers, env,
+ after + 1, handler);
}
else
{
- return axis2_phase_add_unique(env, phase->handlers, handler);
+ return axis2_phase_add_unique(env, phase->handlers,
+ handler);
}
}
}
@@ -871,9 +952,9 @@
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_phase_insert_handler_desc(
- axis2_phase_t *phase,
- const axutil_env_t *env,
- axis2_handler_desc_t *handler_desc)
+ axis2_phase_t * phase,
+ const axutil_env_t * env,
+ axis2_handler_desc_t * handler_desc)
{
int type = 0;
axis2_handler_t *handler = NULL;
@@ -885,21 +966,22 @@
if (!handler)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
if (!_axis2_phase_is_valid_after(phase, env, handler))
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
if (!_axis2_phase_is_valid_before(phase, env, handler))
{
- AXIS2_ERROR_SET(env->error,
- AXIS2_ERROR_INVALID_HANDLER_STATE,
- AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error,
+ AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
return AXIS2_FAILURE;
}
@@ -907,41 +989,42 @@
switch (type)
{
- case 0: /*AXIS2_BOTH_BEFORE_AFTER:*/
- status = axis2_phase_insert_before_and_after(phase, env, handler);
- break;
- case 1: /*AXIS2_BEFORE:*/
- status = axis2_phase_insert_before(phase, env, handler);
- break;
- case 2: /*AXIS2_AFTER:*/
- status = axis2_phase_insert_after(phase, env, handler);
- break;
- case 3: /*AXIS2_ANYWHERE:*/
- status = axis2_phase_add_unique(env, phase->handlers, handler);
- break;
- default:
- status = AXIS2_FAILURE;
- break;
+ case 0: /*AXIS2_BOTH_BEFORE_AFTER: */
+ status = axis2_phase_insert_before_and_after(phase, env, handler);
+ break;
+ case 1: /*AXIS2_BEFORE: */
+ status = axis2_phase_insert_before(phase, env, handler);
+ break;
+ case 2: /*AXIS2_AFTER: */
+ status = axis2_phase_insert_after(phase, env, handler);
+ break;
+ case 3: /*AXIS2_ANYWHERE: */
+ status = axis2_phase_add_unique(env, phase->handlers, handler);
+ break;
+ default:
+ status = AXIS2_FAILURE;
+ break;
}
return status;
}
AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL
axis2_phase_get_all_handlers(
- const axis2_phase_t *phase,
- const axutil_env_t *env)
+ const axis2_phase_t * phase,
+ const axutil_env_t * env)
{
return phase->handlers;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_phase_invoke_start_from_handler(
- axis2_phase_t *phase,
- const axutil_env_t *env,
+ axis2_phase_t * phase,
+ const axutil_env_t * env,
int paused_handler_index,
- axis2_msg_ctx_t *msg_ctx)
+ axis2_msg_ctx_t * msg_ctx)
{
- int i = 0, size = 0;
+ int i = 0,
+ size = 0;
axis2_status_t status = AXIS2_SUCCESS;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -951,22 +1034,24 @@
size = axutil_array_list_size(phase->handlers, env);
for (i = paused_handler_index; i < size; i++)
{
- axis2_handler_t *handler = (axis2_handler_t *) axutil_array_list_get(
- phase->handlers, env, i);
+ axis2_handler_t *handler =
+ (axis2_handler_t *) axutil_array_list_get(phase->handlers, env, i);
if (handler)
{
int index = -1;
- axis2_handler_desc_t *handler_desc = axis2_handler_get_handler_desc(handler, env);
+ axis2_handler_desc_t *handler_desc =
+ axis2_handler_get_handler_desc(handler, env);
if (!handler_desc)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
axis2_handler_invoke(handler, env, msg_ctx);
- index = axis2_msg_ctx_get_current_handler_index(msg_ctx, env);
- axis2_msg_ctx_set_current_handler_index(msg_ctx, env, (index + 1));
+ index = axis2_msg_ctx_get_current_handler_index(msg_ctx, env);
+ axis2_msg_ctx_set_current_handler_index(msg_ctx, env, (index + 1));
}
}
return status;
@@ -974,8 +1059,8 @@
AXIS2_EXTERN void AXIS2_CALL
axis2_phase_free(
- axis2_phase_t *phase,
- const axutil_env_t *env)
+ axis2_phase_t * phase,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, void);
@@ -983,7 +1068,7 @@
{
return;
}
-
+
if (phase->name)
{
AXIS2_FREE(env->allocator, phase->name);
@@ -997,18 +1082,18 @@
return;
}
-
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_phase_remove_handler_desc(
- axis2_phase_t *phase,
- const axutil_env_t *env,
- axis2_handler_desc_t *handler_desc)
+ axis2_phase_t * phase,
+ const axutil_env_t * env,
+ axis2_handler_desc_t * handler_desc)
{
axis2_handler_t *handler;
handler = axis2_handler_desc_get_handler(handler_desc, env);
if (!handler)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
return axis2_phase_remove_unique(env, phase->handlers, handler);
@@ -1016,11 +1101,12 @@
static axis2_status_t
axis2_phase_add_unique(
- const axutil_env_t *env,
- axutil_array_list_t *list,
- axis2_handler_t *handler)
+ const axutil_env_t * env,
+ axutil_array_list_t * list,
+ axis2_handler_t * handler)
{
- int i = 0, size = 0;
+ int i = 0,
+ size = 0;
axis2_bool_t add_handler = AXIS2_TRUE;
const axutil_string_t *handler_name = NULL;
@@ -1038,8 +1124,8 @@
add_handler = AXIS2_FALSE;
break;
}
- else if (0 == axutil_strcmp(axutil_string_get_buffer(handler_name, env),
- axutil_string_get_buffer(obj_name, env)))
+ else if (0 == axutil_strcmp(axutil_string_get_buffer(handler_name, env),
+ axutil_string_get_buffer(obj_name, env)))
{
add_handler = AXIS2_FALSE;
break;
@@ -1052,11 +1138,12 @@
static axis2_status_t
axis2_phase_remove_unique(
- const axutil_env_t *env,
- axutil_array_list_t *list,
- axis2_handler_t *handler)
+ const axutil_env_t * env,
+ axutil_array_list_t * list,
+ axis2_handler_t * handler)
{
- int i = 0, size = 0;
+ int i = 0,
+ size = 0;
axis2_bool_t remove_handler = AXIS2_FALSE;
const axutil_string_t *handler_name = NULL;
@@ -1074,8 +1161,8 @@
remove_handler = AXIS2_TRUE;
break;
}
- else if (!axutil_strcmp(axutil_string_get_buffer(handler_name, env),
- axutil_string_get_buffer(obj_name, env)))
+ else if (!axutil_strcmp(axutil_string_get_buffer(handler_name, env),
+ axutil_string_get_buffer(obj_name, env)))
{
remove_handler = AXIS2_TRUE;
break;
@@ -1087,11 +1174,11 @@
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axis2_phase_increment_ref(axis2_phase_t *phase,
- const axutil_env_t *env)
+axis2_phase_increment_ref(
+ axis2_phase_t * phase,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
phase->ref++;
return AXIS2_SUCCESS;
}
-
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org