Author: damitha
Date: Mon May 26 08:42:12 2008
New Revision: 660217
URL: http://svn.apache.org/viewvc?rev=660217&view=rev
Log:
Now all messages are sent in the same thread as the application client thread.
Modified:
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_in_handler.c
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/ack_msg_processor.c
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/workers/sender.c
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/workers/sender_worker.c
Modified:
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_in_handler.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_in_handler.c?rev=660217&r1=660216&r2=660217&view=diff
==============================================================================
---
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_in_handler.c
(original)
+++
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/handlers/sandesha2_in_handler.c
Mon May 26 08:42:12 2008
@@ -128,36 +128,36 @@
return AXIS2_FAILURE;
}
ctx = axis2_msg_ctx_get_base(msg_ctx, env);
- temp_prop = axis2_ctx_get_property(ctx, env,
- SANDESHA2_APPLICATION_PROCESSING_DONE);
+ temp_prop = axis2_ctx_get_property(ctx, env,
SANDESHA2_APPLICATION_PROCESSING_DONE);
if(temp_prop)
+ {
str_done = (axis2_char_t *) axutil_property_get_value(temp_prop, env);
+ }
+
if(str_done && 0 == axutil_strcmp(AXIS2_VALUE_TRUE, str_done))
{
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
- "[sandesha2]Application processing done");
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] Application
processing done");
return AXIS2_SUCCESS;
}
temp_prop = axis2_ctx_get_property(ctx, env, SANDESHA2_REINJECTED_MESSAGE);
if(temp_prop)
- reinjected_msg = (axis2_char_t *) axutil_property_get_value(temp_prop,
- env);
+ {
+ reinjected_msg = (axis2_char_t *) axutil_property_get_value(temp_prop,
env);
+ }
if(reinjected_msg && 0 == axutil_strcmp(AXIS2_VALUE_TRUE, reinjected_msg))
{
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
- "[sandesha2]Reinjected_msg. So return here");
- return AXIS2_SUCCESS; /* Reinjected Messages are not processed by
- sandesha2 inflow handlers */
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] Reinjected_msg.
So return here");
+ return AXIS2_SUCCESS; /* Reinjected Messages are not processed by
sandesha2 inflow handlers */
}
conf = axis2_conf_ctx_get_conf(conf_ctx, env);
svc = axis2_msg_ctx_get_svc(msg_ctx, env);
if(!svc)
{
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "[sandesha2]Axis2 Service is NULL");
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2]Axis2 Service is
NULL");
AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_SVC_NULL, AXIS2_FAILURE);
return AXIS2_FAILURE;
}
+
rm_msg_ctx = sandesha2_msg_init_init_msg(env, msg_ctx);
dbname = sandesha2_util_get_dbname(env, conf_ctx);
storage_mgr = sandesha2_utils_get_storage_mgr(env, dbname);
@@ -170,14 +170,18 @@
if(value && 0 == axutil_strcmp(AXIS2_VALUE_TRUE, value))
isolated_last_msg = AXIS2_TRUE;
if(!isolated_last_msg)
- dropped = sandesha2_in_handler_drop_if_duplicate(handler, env,
- rm_msg_ctx, storage_mgr, seq_prop_mgr, sender_mgr);
+ {
+ dropped = sandesha2_in_handler_drop_if_duplicate(handler, env,
rm_msg_ctx, storage_mgr,
+ seq_prop_mgr, sender_mgr);
+ }
+
if(dropped)
{
- sandesha2_in_handler_process_dropped_msg(handler, env,
- rm_msg_ctx, storage_mgr, seq_prop_mgr, sender_mgr);
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
- "[sandesha2]msg_ctx dropped. So return here");
+ sandesha2_in_handler_process_dropped_msg(handler, env, rm_msg_ctx,
storage_mgr,
+ seq_prop_mgr, sender_mgr);
+
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] msg_ctx dropped.
So return here");
+
if(rm_msg_ctx)
sandesha2_msg_ctx_free(rm_msg_ctx, env);
if(seq_prop_mgr)
@@ -190,14 +194,14 @@
* TODO Validate the message
* sandesha2_msg_validator_validate(env, rm_msg_ctx);
*/
- seq_ack = sandesha2_msg_ctx_get_seq_ack(rm_msg_ctx, env);
+ /*seq_ack = sandesha2_msg_ctx_get_seq_ack(rm_msg_ctx, env);
if(seq_ack)
{
sandesha2_msg_processor_t *ack_proc = NULL;
ack_proc = sandesha2_ack_msg_processor_create(env);
sandesha2_msg_processor_process_in_msg(ack_proc, env, rm_msg_ctx);
sandesha2_msg_processor_free(ack_proc, env);
- }
+ }*/
ack_requested = sandesha2_msg_ctx_get_ack_requested(rm_msg_ctx, env);
if(ack_requested)
{
@@ -211,14 +215,31 @@
sandesha2_msg_processor_process_in_msg(msg_processor, env, rm_msg_ctx);
sandesha2_msg_processor_free(msg_processor, env);
}
+
+ seq_ack = sandesha2_msg_ctx_get_seq_ack(rm_msg_ctx, env);
+ if(seq_ack)
+ {
+ sandesha2_msg_processor_t *ack_proc = NULL;
+ ack_proc = sandesha2_ack_msg_processor_create(env);
+ sandesha2_msg_processor_process_in_msg(ack_proc, env, rm_msg_ctx);
+ sandesha2_msg_processor_free(ack_proc, env);
+ }
+
if(rm_msg_ctx)
+ {
sandesha2_msg_ctx_free(rm_msg_ctx, env);
+ }
if(seq_prop_mgr)
+ {
sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
+ }
if(storage_mgr)
+ {
sandesha2_storage_mgr_free(storage_mgr, env);
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Exit:sandesha2_in_handler_invoke");
+ }
+
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[sandesha2]
Exit:sandesha2_in_handler_invoke");
+
return AXIS2_SUCCESS;
}
@@ -337,10 +358,8 @@
sandesha2_seq_property_mgr_update(seq_prop_mgr, env,
rcvd_msgs_bean);
app_msg_processor =
sandesha2_app_msg_processor_create(env);
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
"came5*************");
- sandesha2_app_msg_processor_send_ack_if_reqd(env,
- rm_msg_ctx, bean_value, storage_mgr, sender_mgr,
- seq_prop_mgr);
+ sandesha2_app_msg_processor_send_ack_if_reqd(env,
rm_msg_ctx, bean_value,
+ storage_mgr, sender_mgr, seq_prop_mgr);
sandesha2_msg_processor_free(app_msg_processor, env);
}
}
@@ -419,9 +438,8 @@
rcvd_msgs_str = sandesha2_seq_property_bean_get_value(
rcvd_msgs_bean, env);
app_msg_processor = sandesha2_app_msg_processor_create(env);
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "came6*************");
- sandesha2_app_msg_processor_send_ack_if_reqd(env, rm_msg_ctx,
- rcvd_msgs_str, storage_mgr, sender_mgr, seq_prop_mgr);
+ sandesha2_app_msg_processor_send_ack_if_reqd(env, rm_msg_ctx,
rcvd_msgs_str,
+ storage_mgr, sender_mgr, seq_prop_mgr);
sandesha2_msg_processor_free(app_msg_processor, env);
}
}
Modified:
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/ack_msg_processor.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/ack_msg_processor.c?rev=660217&r1=660216&r2=660217&view=diff
==============================================================================
---
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/ack_msg_processor.c
(original)
+++
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/ack_msg_processor.c
Mon May 26 08:42:12 2008
@@ -238,16 +238,18 @@
if(fault_msg_ctx)
{
axis2_engine_t *engine = NULL;
+
engine = axis2_engine_create(env, conf_ctx);
- axis2_engine_send_fault(engine, env, sandesha2_msg_ctx_get_msg_ctx(
- fault_msg_ctx, env));
+ axis2_engine_send_fault(engine, env,
sandesha2_msg_ctx_get_msg_ctx(fault_msg_ctx, env));
axis2_msg_ctx_set_paused(msg_ctx, env, AXIS2_TRUE);
sandesha2_msg_ctx_free(fault_msg_ctx, env);
if(engine)
+ {
axis2_engine_free(engine, env);
+ }
}
- fault_msg_ctx = sandesha2_fault_mgr_check_for_invalid_ack(env, rm_msg_ctx,
- seq_prop_mgr);
+
+ fault_msg_ctx = sandesha2_fault_mgr_check_for_invalid_ack(env, rm_msg_ctx,
seq_prop_mgr);
if(fault_msg_ctx)
{
axis2_engine_t *engine = NULL;
@@ -260,8 +262,10 @@
axis2_engine_free(engine, env);
}
if(int_seq_id)
- sandesha2_seq_mgr_update_last_activated_time(env, int_seq_id,
- seq_prop_mgr);
+ {
+ sandesha2_seq_mgr_update_last_activated_time(env, int_seq_id,
seq_prop_mgr);
+ }
+
property = axutil_property_create_with_args(env, 0, 0, 0,
AXIS2_VALUE_TRUE);
axis2_msg_ctx_set_property(msg_ctx, env, SANDESHA2_ACK_PROCSSED, property);
@@ -447,29 +451,34 @@
long highest_out_msg_no = 0;
highest_out_msg_no = atol(last_out_msg_no_str);
if(last_out_msg_no_str)
+ {
AXIS2_FREE(env->allocator, last_out_msg_no_str);
+ }
+
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "highest_out_msg_no:%ld",
highest_out_msg_no);
+
if(highest_out_msg_no > 0)
{
axis2_bool_t completed = AXIS2_FALSE;
axis2_endpoint_ref_t *to = NULL;
axis2_char_t *to_address = NULL;
- completed = sandesha2_ack_mgr_verify_seq_completion(env,
- ack_range_list, highest_out_msg_no);
+ completed = sandesha2_ack_mgr_verify_seq_completion(env,
ack_range_list,
+ highest_out_msg_no);
+
to = sandesha2_msg_ctx_get_to(rm_msg_ctx, env);
+
if(to)
{
to_address = (axis2_char_t*)axis2_endpoint_ref_get_address(to,
env);
}
+
if(completed && sandesha2_utils_is_anon_uri(env, to_address))
{
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
- "[sandesha2]Sequence %s is completed. So adding
terminate msg",
- out_seq_id);
- sandesha2_terminate_mgr_add_terminate_seq_msg(env, rm_msg_ctx,
- out_seq_id, int_seq_id, storage_mgr, seq_prop_mgr,
- create_seq_mgr, sender_mgr);
+ "[sandesha2]Sequence %s is completed. So adding
terminate msg", out_seq_id);
+ sandesha2_terminate_mgr_add_terminate_seq_msg(env, rm_msg_ctx,
out_seq_id,
+ int_seq_id, storage_mgr, seq_prop_mgr, create_seq_mgr,
sender_mgr);
}
}
}
@@ -479,32 +488,27 @@
AXIS2_FREE(env->allocator, int_seq_id);
}
- /*action = axis2_msg_ctx_get_wsa_action(msg_ctx, env);
- if(action)
- {
- axis2_char_t *temp_spec_ver = NULL;
- axis2_char_t *temp_action = NULL;
-
- temp_spec_ver = sandesha2_msg_ctx_get_rm_spec_ver(rm_msg_ctx, env);
- temp_action = sandesha2_spec_specific_consts_get_ack_req_action(env,
- temp_spec_ver);
- if(!axutil_strcmp(action, temp_action))
- {
- sandesha2_msg_ctx_set_paused(rm_msg_ctx, env, AXIS2_TRUE);
- }
- }*/
-
sandesha2_msg_ctx_set_paused(rm_msg_ctx, env, AXIS2_TRUE);
if(seq_prop_mgr)
+ {
sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
+ }
if(create_seq_mgr)
+ {
sandesha2_create_seq_mgr_free(create_seq_mgr, env);
+ }
if(sender_mgr)
+ {
sandesha2_sender_mgr_free(sender_mgr, env);
+ }
if(next_msg_mgr)
+ {
sandesha2_next_msg_mgr_free(next_msg_mgr, env);
+ }
if(storage_mgr)
+ {
sandesha2_storage_mgr_free(storage_mgr, env);
+ }
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
"[sandesha2] Exit:sandesha2_ack_msg_processor_process_in_msg");
Modified:
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c?rev=660217&r1=660216&r2=660217&view=diff
==============================================================================
---
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c
(original)
+++
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c
Mon May 26 08:42:12 2008
@@ -860,8 +860,8 @@
* That means we can send an acknowledgment message in the http back
channel.
*/
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] Back channel is
free");
- sandesha2_app_msg_processor_send_ack_if_reqd(env, rm_msg_ctx,
msgs_str,
- storage_mgr, sender_mgr, seq_prop_mgr);
+ sandesha2_app_msg_processor_send_ack_if_reqd(env, rm_msg_ctx,
msgs_str, storage_mgr,
+ sender_mgr, seq_prop_mgr);
}
else if(sandesha2_utils_is_single_channel(env, rm_version, acks_to_str))
{
@@ -876,8 +876,8 @@
{
/* This is most probably dual channel duplex mode. */
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] Most probably
dual channel duplex mode.");
- sandesha2_app_msg_processor_send_ack_if_reqd(env, rm_msg_ctx,
msgs_str,
- storage_mgr, sender_mgr, seq_prop_mgr);
+ sandesha2_app_msg_processor_send_ack_if_reqd(env, rm_msg_ctx,
msgs_str, storage_mgr,
+ sender_mgr, seq_prop_mgr);
}
if(rm_version)
AXIS2_FREE(env->allocator, rm_version);
@@ -1559,111 +1559,119 @@
axis2_bool_t sent = AXIS2_FALSE;
sandesha2_seq_property_bean_t *int_seq_bean = NULL;
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[Sandesha2] Entry:sandesha2_app_msg_processor_send_ack_if_reqd");
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[Sandesha2]
Entry:sandesha2_app_msg_processor_send_ack_if_reqd");
+
AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, msg_str, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, AXIS2_FAILURE);
+
seq = sandesha2_msg_ctx_get_sequence(rm_msg_ctx, env);
- seq_id = sandesha2_identifier_get_identifier(
- sandesha2_seq_get_identifier(seq, env), env);
- conf_ctx =
axis2_msg_ctx_get_conf_ctx(sandesha2_msg_ctx_get_msg_ctx(rm_msg_ctx,
- env), env);
+ seq_id =
sandesha2_identifier_get_identifier(sandesha2_seq_get_identifier(seq, env),
env);
+ conf_ctx =
axis2_msg_ctx_get_conf_ctx(sandesha2_msg_ctx_get_msg_ctx(rm_msg_ctx, env), env);
if(!conf_ctx)
{
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "[sandesha2] cont_ctx is NULL");
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] cont_ctx is
NULL");
AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_CONF_CTX_NULL,
AXIS2_FAILURE);
return AXIS2_FAILURE;
}
+
ack_requested = sandesha2_msg_ctx_get_ack_requested(rm_msg_ctx, env);
if(ack_requested)
{
- sandesha2_ack_requested_set_must_understand(ack_requested, env,
- AXIS2_FALSE);
+ sandesha2_ack_requested_set_must_understand(ack_requested, env,
AXIS2_FALSE);
sandesha2_msg_ctx_add_soap_envelope(rm_msg_ctx, env);
}
- ack_rm_msg = sandesha2_ack_mgr_generate_ack_msg(env, rm_msg_ctx, seq_id,
- seq_prop_mgr);
+
+ ack_rm_msg = sandesha2_ack_mgr_generate_ack_msg(env, rm_msg_ctx, seq_id,
seq_prop_mgr);
ack_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(ack_rm_msg, env);
- int_seq_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env,
- seq_id, SANDESHA2_SEQ_PROP_SPECIAL_INTERNAL_SEQ_ID);
+ int_seq_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env,
seq_id,
+ SANDESHA2_SEQ_PROP_SPECIAL_INTERNAL_SEQ_ID);
+
/* Following code block send the ack messages through sender. If we
comment this
* it will be sent directly avoiding the sender. We will enter this block
only
* in application client side when sequence offer is on.
*/
if(int_seq_bean)
{
- axis2_transport_out_desc_t *transport_out = NULL;
+ axis2_endpoint_ref_t *reply_to_epr = NULL;
long send_time = -1;
axis2_char_t *key = NULL;
axutil_property_t *property = NULL;
sandesha2_sender_bean_t *ack_bean = NULL;
axis2_char_t *int_seq_id = NULL;
+
key = axutil_uuid_gen(env);
ack_bean = sandesha2_sender_bean_create(env);
sandesha2_sender_bean_set_msg_ctx_ref_key(ack_bean, env, key);
- sandesha2_storage_mgr_store_msg_ctx(storage_mgr, env, key,
- ack_msg_ctx);
+ sandesha2_storage_mgr_store_msg_ctx(storage_mgr, env, key,
ack_msg_ctx);
send_time = sandesha2_utils_get_current_time_in_millis(env);
sandesha2_sender_bean_set_time_to_send(ack_bean, env, send_time);
- sandesha2_sender_bean_set_msg_id(ack_bean, env,
- sandesha2_msg_ctx_get_msg_id(ack_rm_msg, env));
+ sandesha2_sender_bean_set_msg_id(ack_bean, env,
sandesha2_msg_ctx_get_msg_id(ack_rm_msg, env));
sandesha2_sender_bean_set_send(ack_bean, env, AXIS2_TRUE);
int_seq_id = sandesha2_seq_property_bean_get_value(int_seq_bean, env);
sandesha2_sender_bean_set_internal_seq_id(ack_bean, env, int_seq_id);
sandesha2_sender_bean_set_seq_id(ack_bean, env, seq_id);
- property = axutil_property_create_with_args(env, 0, 0, 0,
AXIS2_VALUE_FALSE);
- sandesha2_msg_ctx_set_property(ack_rm_msg, env,
- SANDESHA2_QUALIFIED_FOR_SENDING, property);
- sandesha2_sender_bean_set_msg_type(ack_bean, env,
- SANDESHA2_MSG_TYPE_ACK);
+ /*property = axutil_property_create_with_args(env, 0, 0, 0,
AXIS2_VALUE_FALSE);
+ sandesha2_msg_ctx_set_property(ack_rm_msg, env,
SANDESHA2_QUALIFIED_FOR_SENDING, property);*/
+ sandesha2_sender_bean_set_msg_type(ack_bean, env,
SANDESHA2_MSG_TYPE_ACK);
sandesha2_sender_bean_set_resend(ack_bean, env, AXIS2_FALSE);
sandesha2_sender_mgr_insert(sender_mgr, env, ack_bean);
+
if(ack_bean)
+ {
sandesha2_sender_bean_free(ack_bean, env);
- transport_out = axis2_msg_ctx_get_transport_out_desc(ack_msg_ctx, env);
- property = axutil_property_create_with_args(env, 0, 0,
- axis2_transport_out_desc_free_void_arg, transport_out);
- axis2_msg_ctx_set_property(ack_msg_ctx, env,
- SANDESHA2_ORIGINAL_TRANSPORT_OUT_DESC, property);
+ }
+
+ /*transport_out = axis2_msg_ctx_get_transport_out_desc(ack_msg_ctx,
env);
+ property = axutil_property_create_with_args(env, 0, 0,
+ axis2_transport_out_desc_free_void_arg, transport_out);
+
+ axis2_msg_ctx_set_property(ack_msg_ctx, env,
SANDESHA2_ORIGINAL_TRANSPORT_OUT_DESC, property);
+ axis2_msg_ctx_set_transport_out_desc(ack_msg_ctx, env,
sandesha2_utils_get_transport_out(env));*/
property = axutil_property_create_with_args(env, 0, AXIS2_TRUE, 0,
key);
- axis2_msg_ctx_set_property(ack_msg_ctx, env,
SANDESHA2_MESSAGE_STORE_KEY,
- property);
- property = axutil_property_create_with_args(env, 0, 0, 0,
- AXIS2_VALUE_TRUE);
- axis2_msg_ctx_set_property(ack_msg_ctx, env,
SANDESHA2_SET_SEND_TO_TRUE,
- property);
- axis2_msg_ctx_set_transport_out_desc(ack_msg_ctx, env,
- sandesha2_utils_get_transport_out(env));
- {
- axis2_endpoint_ref_t *reply_to_epr = NULL;
- reply_to_epr = axis2_msg_ctx_get_to(msg_ctx, env);
- if(reply_to_epr)
- axis2_msg_ctx_set_reply_to(ack_msg_ctx, env, reply_to_epr);
+ axis2_msg_ctx_set_property(ack_msg_ctx, env,
SANDESHA2_MESSAGE_STORE_KEY, property);
+
+ property = axutil_property_create_with_args(env, 0, 0, 0,
AXIS2_VALUE_TRUE);
+ axis2_msg_ctx_set_property(ack_msg_ctx, env,
SANDESHA2_SET_SEND_TO_TRUE, property);
+
+ reply_to_epr = axis2_msg_ctx_get_to(msg_ctx, env);
+
+ if(reply_to_epr)
+ {
+ axis2_msg_ctx_set_reply_to(ack_msg_ctx, env, reply_to_epr);
}
+
sandesha2_seq_property_bean_free(int_seq_bean, env);
}
+
if(ack_rm_msg)
{
axis2_engine_t *engine = NULL;
+
engine = axis2_engine_create(env, conf_ctx);
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
"[sandesha2]axis2_engine_send");
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]
axis2_engine_send");
+
sent = axis2_engine_send(engine, env, ack_msg_ctx);
if(ack_rm_msg)
+ {
sandesha2_msg_ctx_free(ack_rm_msg, env);
+ }
if(engine)
+ {
axis2_engine_free(engine, env);
+ }
}
+
if(!sent)
{
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "[Sandesha2]Engine Send failed");
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[Sandesha2] Engine Send
failed");
AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_SENDING_ACK,
AXIS2_FAILURE);
+
return AXIS2_FAILURE;
}
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[Sandesha2]Exit:sandesha2_app_msg_processor_send_ack_if_reqd");
+
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
+ "[Sandesha2] Exit:sandesha2_app_msg_processor_send_ack_if_reqd");
return AXIS2_SUCCESS;
}
Modified:
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c?rev=660217&r1=660216&r2=660217&view=diff
==============================================================================
---
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c
(original)
+++
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c
Mon May 26 08:42:12 2008
@@ -705,9 +705,11 @@
axis2_char_t *seq_id = NULL;
int terminate_delay = -1;
sandesha2_property_bean_t *property_bean = NULL;
+ axis2_endpoint_ref_t *reply_to_epr = NULL;
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Entry:sandesha2_terminate_mgr_add_terminate_seq_msg");
+ "[sandesha2] Entry:sandesha2_terminate_mgr_add_terminate_seq_msg");
+
AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, out_seq_id, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, int_seq_id, AXIS2_FAILURE);
@@ -719,75 +721,77 @@
msg_ctx = sandesha2_msg_ctx_get_msg_ctx(rm_msg_ctx, env);
conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
- terminated = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env,
- out_seq_id, SANDESHA2_SEQ_PROP_TERMINATE_ADDED);
- if(terminated && sandesha2_seq_property_bean_get_value(terminated, env)
- && 0 == axutil_strcmp(AXIS2_VALUE_TRUE,
- sandesha2_seq_property_bean_get_value(terminated, env)))
+ terminated = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env,
out_seq_id,
+ SANDESHA2_SEQ_PROP_TERMINATE_ADDED);
+
+ if(terminated && sandesha2_seq_property_bean_get_value(terminated, env) &&
0 == axutil_strcmp(
+ AXIS2_VALUE_TRUE,
sandesha2_seq_property_bean_get_value(terminated, env)))
{
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] Terminate "\
- "sequence message was added previously");
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+ "[sandesha2] Terminate sequence message was added previously");
+
/* If we do not return at this, there will be two terminate messsages
* sent to the client
*/
return AXIS2_SUCCESS;
}
- terminate_rm_msg = sandesha2_msg_creator_create_terminate_seq_msg(env,
- rm_msg_ctx, out_seq_id, int_seq_id, seq_prop_mgr);
+
+ terminate_rm_msg = sandesha2_msg_creator_create_terminate_seq_msg(env,
rm_msg_ctx, out_seq_id,
+ int_seq_id, seq_prop_mgr);
if(!terminate_rm_msg)
+ {
return AXIS2_FAILURE;
+ }
+
sandesha2_msg_ctx_set_flow(terminate_rm_msg, env, AXIS2_OUT_FLOW);
property = axutil_property_create_with_args(env, 0, 0, 0,
AXIS2_VALUE_TRUE);
- sandesha2_msg_ctx_set_property(terminate_rm_msg, env,
- SANDESHA2_APPLICATION_PROCESSING_DONE, property);
+ sandesha2_msg_ctx_set_property(terminate_rm_msg, env,
SANDESHA2_APPLICATION_PROCESSING_DONE,
+ property);
- to_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env,
int_seq_id,
- SANDESHA2_SEQ_PROP_TO_EPR);
+ to_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env,
int_seq_id,
+ SANDESHA2_SEQ_PROP_TO_EPR);
+
if(to_bean)
{
- to_epr = axis2_endpoint_ref_create(env,
- sandesha2_seq_property_bean_get_value(to_bean, env));
+ to_epr = axis2_endpoint_ref_create(env,
sandesha2_seq_property_bean_get_value(to_bean, env));
sandesha2_seq_property_bean_free(to_bean, env);
}
- /*if(!to_epr)
- {
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] To EPR has an "
- "invalid value");
- return AXIS2_FAILURE;
- }*/
+
if(to_epr)
+ {
to_addr = axis2_endpoint_ref_get_address(to_epr, env);
+ }
+
sandesha2_msg_ctx_set_to(terminate_rm_msg, env, to_epr);
rm_ver = sandesha2_utils_get_rm_version(env, int_seq_id, seq_prop_mgr);
if(!rm_ver)
{
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] Cannot find the "
- "rm version for msg");
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] Cannot find the
rm version for msg");
return AXIS2_FAILURE;
}
+
sandesha2_msg_ctx_set_wsa_action(terminate_rm_msg, env,
sandesha2_spec_specific_consts_get_terminate_seq_action(env, rm_ver));
- temp_action = sandesha2_spec_specific_consts_get_terminate_seq_soap_action
- (env, rm_ver);
+
+ temp_action =
sandesha2_spec_specific_consts_get_terminate_seq_soap_action(env, rm_ver);
soap_action = axutil_string_create(env, temp_action);
sandesha2_msg_ctx_set_soap_action(terminate_rm_msg, env, soap_action);
- transport_to_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env,
- int_seq_id, SANDESHA2_SEQ_PROP_TRANSPORT_TO);
+ transport_to_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env,
int_seq_id,
+ SANDESHA2_SEQ_PROP_TRANSPORT_TO);
+
if(transport_to_bean)
{
- axis2_char_t *value = sandesha2_seq_property_bean_get_value(
- transport_to_bean, env);
+ axis2_char_t *value =
sandesha2_seq_property_bean_get_value(transport_to_bean, env);
property = axutil_property_create_with_args(env, 0, 0, 0, value);
- sandesha2_msg_ctx_set_property(terminate_rm_msg, env,
- AXIS2_TRANSPORT_URL, property);
+ sandesha2_msg_ctx_set_property(terminate_rm_msg, env,
AXIS2_TRANSPORT_URL, property);
}
sandesha2_msg_ctx_add_soap_envelope(terminate_rm_msg, env);
/* If server side and single channel duplex mode send the terminate
sequence
* message.
*/
- if(axis2_msg_ctx_get_server_side(msg_ctx, env) &&
- sandesha2_utils_is_single_channel(env, rm_ver, to_addr))
+ if(axis2_msg_ctx_get_server_side(msg_ctx, env) &&
sandesha2_utils_is_single_channel(env, rm_ver,
+ to_addr))
{
axis2_msg_ctx_t *msg_ctx2 = NULL;
axis2_bool_t is_svr_side = AXIS2_FALSE;
@@ -798,13 +802,16 @@
axis2_msg_ctx_set_paused(msg_ctx, env, AXIS2_TRUE);
axis2_op_ctx_set_response_written(axis2_msg_ctx_get_op_ctx(msg_ctx,
env), env, AXIS2_TRUE);
engine = axis2_engine_create(env, conf_ctx);
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
"[sandesha2]axis2_engine_send");
+
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]
axis2_engine_send");
+
axis2_engine_send(engine, env, msg_ctx2);
if(engine)
{
axis2_engine_free(engine, env);
engine = NULL;
}
+
/* Clean sending side data */
{
sandesha2_terminate_seq_t *terminate_seq = NULL;
@@ -812,112 +819,128 @@
axis2_char_t *internal_seq_id = NULL;
terminate_seq =
sandesha2_msg_ctx_get_terminate_seq(terminate_rm_msg, env);
- seq_id = sandesha2_identifier_get_identifier(
- sandesha2_terminate_seq_get_identifier(terminate_seq,
- env), env);
+ seq_id =
sandesha2_identifier_get_identifier(sandesha2_terminate_seq_get_identifier(
+ terminate_seq, env), env);
+
internal_seq_id = sandesha2_utils_get_seq_property(env, seq_id,
- SANDESHA2_SEQ_PROP_INTERNAL_SEQ_ID, seq_prop_mgr);
- sandesha2_terminate_mgr_terminate_sending_side(env, conf_ctx,
- internal_seq_id, is_svr_side, storage_mgr, seq_prop_mgr,
- create_seq_mgr, sender_mgr);
+ SANDESHA2_SEQ_PROP_INTERNAL_SEQ_ID, seq_prop_mgr);
+
+ sandesha2_terminate_mgr_terminate_sending_side(env, conf_ctx,
internal_seq_id,
+ is_svr_side, storage_mgr, seq_prop_mgr, create_seq_mgr,
sender_mgr);
terminate_added = sandesha2_seq_property_bean_create(env);
+
sandesha2_seq_property_bean_set_name(terminate_added, env,
- SANDESHA2_SEQ_PROP_TERMINATE_ADDED);
- sandesha2_seq_property_bean_set_seq_id(terminate_added, env,
- out_seq_id);
- sandesha2_seq_property_bean_set_value(terminate_added, env,
- AXIS2_VALUE_TRUE);
- sandesha2_seq_property_mgr_insert(seq_prop_mgr, env,
- terminate_added);
+ SANDESHA2_SEQ_PROP_TERMINATE_ADDED);
+
+ sandesha2_seq_property_bean_set_seq_id(terminate_added, env,
out_seq_id);
+ sandesha2_seq_property_bean_set_value(terminate_added, env,
AXIS2_VALUE_TRUE);
+ sandesha2_seq_property_mgr_insert(seq_prop_mgr, env,
terminate_added);
+
if(internal_seq_id)
+ {
AXIS2_FREE(env->allocator, internal_seq_id);
+ }
if(terminate_added)
+ {
sandesha2_seq_property_bean_free(terminate_added, env);
+ }
}
+
if(rm_ver)
+ {
AXIS2_FREE(env->allocator, rm_ver);
+ }
+
return AXIS2_SUCCESS;
}
+
if(rm_ver)
+ {
AXIS2_FREE(env->allocator, rm_ver);
+ }
+
key = axutil_uuid_gen(env);
terminate_bean = sandesha2_sender_bean_create(env);
sandesha2_sender_bean_set_msg_ctx_ref_key(terminate_bean, env, key);
terminate_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(terminate_rm_msg, env);
- sandesha2_storage_mgr_store_msg_ctx(storage_mgr, env, key,
- terminate_msg_ctx);
- property_bean = sandesha2_utils_get_property_bean(env,
- axis2_conf_ctx_get_conf(conf_ctx, env));
- terminate_delay =
sandesha2_property_bean_get_terminate_delay(property_bean,
- env);
- send_time = sandesha2_utils_get_current_time_in_millis(env) +
- terminate_delay;
+ sandesha2_storage_mgr_store_msg_ctx(storage_mgr, env, key,
terminate_msg_ctx);
+ property_bean = sandesha2_utils_get_property_bean(env,
axis2_conf_ctx_get_conf(conf_ctx, env));
+ terminate_delay =
sandesha2_property_bean_get_terminate_delay(property_bean, env);
+ send_time = sandesha2_utils_get_current_time_in_millis(env) +
terminate_delay;
sandesha2_sender_bean_set_time_to_send(terminate_bean, env, send_time);
- sandesha2_sender_bean_set_msg_id(terminate_bean, env,
- sandesha2_msg_ctx_get_msg_id(terminate_rm_msg, env));
+
+ sandesha2_sender_bean_set_msg_id(terminate_bean, env,
sandesha2_msg_ctx_get_msg_id(
+ terminate_rm_msg, env));
+
sandesha2_sender_bean_set_send(terminate_bean, env, AXIS2_TRUE);
terminate_seq = sandesha2_msg_ctx_get_terminate_seq(terminate_rm_msg, env);
- seq_id = sandesha2_identifier_get_identifier(
- sandesha2_terminate_seq_get_identifier(terminate_seq,
- env), env);
+
+ seq_id =
sandesha2_identifier_get_identifier(sandesha2_terminate_seq_get_identifier(
+ terminate_seq, env), env);
+
sandesha2_sender_bean_set_seq_id(terminate_bean, env, seq_id);
sandesha2_sender_bean_set_internal_seq_id(terminate_bean, env, int_seq_id);
property = axutil_property_create_with_args(env, 0, 0, 0,
AXIS2_VALUE_FALSE);
- sandesha2_msg_ctx_set_property(terminate_rm_msg, env,
- SANDESHA2_QUALIFIED_FOR_SENDING, property);
- sandesha2_sender_bean_set_msg_type(terminate_bean, env,
- SANDESHA2_MSG_TYPE_TERMINATE_SEQ);
+ sandesha2_msg_ctx_set_property(terminate_rm_msg, env,
SANDESHA2_QUALIFIED_FOR_SENDING, property);
+ sandesha2_sender_bean_set_msg_type(terminate_bean, env,
SANDESHA2_MSG_TYPE_TERMINATE_SEQ);
sandesha2_sender_bean_set_resend(terminate_bean, env, AXIS2_FALSE);
sandesha2_sender_mgr_insert(sender_mgr, env, terminate_bean);
if(terminate_bean)
+ {
sandesha2_sender_bean_free(terminate_bean, env);
+ }
terminate_added = sandesha2_seq_property_bean_create(env);
- sandesha2_seq_property_bean_set_name(terminate_added, env,
- SANDESHA2_SEQ_PROP_TERMINATE_ADDED);
+ sandesha2_seq_property_bean_set_name(terminate_added, env,
SANDESHA2_SEQ_PROP_TERMINATE_ADDED);
sandesha2_seq_property_bean_set_seq_id(terminate_added, env, out_seq_id);
- sandesha2_seq_property_bean_set_value(terminate_added, env,
- AXIS2_VALUE_TRUE);
+ sandesha2_seq_property_bean_set_value(terminate_added, env,
AXIS2_VALUE_TRUE);
sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, terminate_added);
if(terminate_added)
+ {
sandesha2_seq_property_bean_free(terminate_added, env);
+ }
+
msg_ctx1 = sandesha2_msg_ctx_get_msg_ctx(terminate_rm_msg, env);
if(terminate_rm_msg)
+ {
sandesha2_msg_ctx_free(terminate_rm_msg, env);
- transport_out = axis2_msg_ctx_get_transport_out_desc(msg_ctx1, env);
+ }
+
+ /*transport_out = axis2_msg_ctx_get_transport_out_desc(msg_ctx1, env);
- property = axutil_property_create_with_args(env, 0, 0,
- axis2_transport_out_desc_free_void_arg, transport_out);
- axis2_msg_ctx_set_property(msg_ctx1, env,
- SANDESHA2_ORIGINAL_TRANSPORT_OUT_DESC, property);
+ property = axutil_property_create_with_args(env, 0, 0,
axis2_transport_out_desc_free_void_arg,
+ transport_out);
+
+ axis2_msg_ctx_set_property(msg_ctx1, env,
SANDESHA2_ORIGINAL_TRANSPORT_OUT_DESC, property);*/
property = axutil_property_create_with_args(env, 0, AXIS2_TRUE, 0, key);
- axis2_msg_ctx_set_property(msg_ctx1, env, SANDESHA2_MESSAGE_STORE_KEY,
- property);
+ axis2_msg_ctx_set_property(msg_ctx1, env, SANDESHA2_MESSAGE_STORE_KEY,
property);
- property = axutil_property_create_with_args(env, 0, 0, 0,
- AXIS2_VALUE_TRUE);
- axis2_msg_ctx_set_property(msg_ctx1, env, SANDESHA2_SET_SEND_TO_TRUE,
- property);
+ property = axutil_property_create_with_args(env, 0, 0, 0,
AXIS2_VALUE_TRUE);
+ axis2_msg_ctx_set_property(msg_ctx1, env, SANDESHA2_SET_SEND_TO_TRUE,
property);
- axis2_msg_ctx_set_transport_out_desc(msg_ctx1, env,
- sandesha2_utils_get_transport_out(env));
- {
- axis2_endpoint_ref_t *reply_to_epr = NULL;
- reply_to_epr = axis2_msg_ctx_get_to(msg_ctx, env);
- if(reply_to_epr)
- axis2_msg_ctx_set_reply_to(msg_ctx1, env, reply_to_epr);
+ /*axis2_msg_ctx_set_transport_out_desc(msg_ctx1, env,
sandesha2_utils_get_transport_out(env));*/
+
+ reply_to_epr = axis2_msg_ctx_get_to(msg_ctx, env);
+ if(reply_to_epr)
+ {
+ axis2_msg_ctx_set_reply_to(msg_ctx1, env, reply_to_epr);
}
+
engine = axis2_engine_create(env, conf_ctx);
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]axis2_engine_send");
+
status = axis2_engine_send(engine, env, msg_ctx1);
if(engine)
+ {
axis2_engine_free(engine, env);
+ }
+
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Exit:sandesha2_terminate_mgr_add_terminate_seq_msg");
+ "[sandesha2] Exit:sandesha2_terminate_mgr_add_terminate_seq_msg");
+
return status;
}
Modified:
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/workers/sender.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/workers/sender.c?rev=660217&r1=660216&r2=660217&view=diff
==============================================================================
---
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/workers/sender.c
(original)
+++
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/workers/sender.c
Mon May 26 08:42:12 2008
@@ -74,8 +74,7 @@
axutil_thread_t *worker_thread = NULL;
sandesha2_sender_args_t *args = NULL;
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Entry:sandesha2_sender_run_for_seq");
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[sandesha2]
Entry:sandesha2_sender_run_for_seq");
axutil_allocator_switch_to_global_pool(env->allocator);
args = AXIS2_MALLOC(env->allocator, sizeof(sandesha2_sender_args_t));
@@ -86,7 +85,7 @@
args->persistent_msg_ctx = persistent_msg_ctx;
++(env->allocator->ref_pool_allocator);
- worker_thread = axutil_thread_pool_get_thread(env->thread_pool,
+ /*worker_thread = axutil_thread_pool_get_thread(env->thread_pool,
sandesha2_sender_worker_func, (void*)args);
if(!worker_thread)
{
@@ -94,9 +93,9 @@
"[sandesha2]Thread creation failed for sandesha2_sender_run");
return AXIS2_FAILURE;
}
- axutil_thread_pool_thread_detach(env->thread_pool, worker_thread);
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Exit:sandesha2_sender_run_for_seq");
+ axutil_thread_pool_thread_detach(env->thread_pool, worker_thread);*/
+
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[sandesha2]
Exit:sandesha2_sender_run_for_seq");
return AXIS2_SUCCESS;
}
Modified:
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/workers/sender_worker.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/workers/sender_worker.c?rev=660217&r1=660216&r2=660217&view=diff
==============================================================================
---
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/workers/sender_worker.c
(original)
+++
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/workers/sender_worker.c
Mon May 26 08:42:12 2008
@@ -312,6 +312,11 @@
seq_id = sandesha2_identifier_get_identifier(identifier, env);
return AXIS2_SUCCESS;
}
+ if(msg_type == SANDESHA2_MSG_TYPE_ACK)
+ {
+ return AXIS2_SUCCESS;
+ }
+
if(sandesha2_sender_worker_is_piggybackable_msg_type(sender_worker, env,
msg_type) && AXIS2_FALSE ==
sandesha2_sender_worker_is_ack_already_piggybacked(sender_worker, env,
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]