You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by da...@apache.org on 2008/10/10 12:25:54 UTC
svn commit: r703384 - in /webservices/sandesha/trunk/c:
include/sandesha2_constants.h src/msgprocessors/app_msg_processor.c
src/util/terminate_mgr.c
Author: damitha
Date: Fri Oct 10 03:25:54 2008
New Revision: 703384
URL: http://svn.apache.org/viewvc?rev=703384&view=rev
Log:
Add code comments.
Modified:
webservices/sandesha/trunk/c/include/sandesha2_constants.h
webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
webservices/sandesha/trunk/c/src/util/terminate_mgr.c
Modified: webservices/sandesha/trunk/c/include/sandesha2_constants.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_constants.h?rev=703384&r1=703383&r2=703384&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_constants.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_constants.h Fri Oct 10 03:25:54 2008
@@ -326,7 +326,7 @@
#define SANDESHA2_SEQ_PROP_HIGHEST_IN_MSG_ID "HighestInMsgId"
- #define SANDESHA2_SEQ_PROP_1_0_REPLAY "Replay1_0"
+ #define SANDESHA2_SEQ_PROP_REPLAY "Replay"
#define SANDESHA2_SEQ_PROP_RELATED_MSG_ID "related_msg_id"
Modified: webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c?rev=703384&r1=703383&r2=703384&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c Fri Oct 10 03:25:54 2008
@@ -3212,12 +3212,15 @@
sandesha2_seq_property_bean_free(relates_to_bean, env);
}
+ /* If mep is out-in we need to mark that this is replay mode. This is used in terminate
+ * manager.
+ */
if(!axutil_strcmp(mep, AXIS2_MEP_URI_OUT_IN))
{
sandesha2_seq_property_bean_t *replay_bean = NULL;
replay_bean = sandesha2_seq_property_bean_create_with_data(env, rms_sequence_id,
- SANDESHA2_SEQ_PROP_1_0_REPLAY, NULL);
+ SANDESHA2_SEQ_PROP_REPLAY, NULL);
sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, replay_bean);
if(replay_bean)
{
@@ -3285,6 +3288,7 @@
status = AXIS2_FAILURE;
}
+ /* Loop until timeout or exceed specified number of resends */
while(AXIS2_TRUE && transport_sender)
{
continue_sending = sandesha2_msg_retrans_adjuster_adjust_retrans(env, sender_bean,
@@ -3360,7 +3364,7 @@
return status;
}
- else /* Not client side or twoway client side*/
+ else /* Sending in twoway. This could be in client or server. Sending always happen within a thread.*/
{
/* This is actually a trick that get the msg_ctx traversed through all the out phases.
* Once all the phases are passed it will get hit into the false sandesha2 transport
@@ -3389,12 +3393,18 @@
{
axis2_engine_free(engine, env);
}
-
+
+ /* Store the application message context. This ensures that message context is stored before
+ * trying to write it into the wire at transport. When the sender thread start it retrieve
+ * the message context from the storage and send it.
+ */
sandesha2_storage_mgr_store_msg_ctx(storage_mgr, env, storage_key, app_msg_ctx, AXIS2_TRUE);
- /* If not (single channel) spawn a thread and see whether acknowledgment has arrived through the
- * sandesha2_sender_mgr_get_application_msg_to_send() function. If it has arrived exit from
- * the thread.*/
+ /* Start the application message sender. Here we spawn a thread and see whether acknowledgment
+ * has arrived through the sandesha2_sender_mgr_get_application_msg_to_send() function. If it
+ * has arrived exit from the thread. Otherwise retry until timeout or number of re-sends
+ * exceed the value specified in Policy.
+ */
status = sandesha2_app_msg_processor_start_application_msg_resender(env, conf_ctx,
internal_sequence_id, msg_id, is_svr_side, retrans_interval, app_msg_ctx, seq);
}
Modified: webservices/sandesha/trunk/c/src/util/terminate_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/terminate_mgr.c?rev=703384&r1=703383&r2=703384&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/terminate_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/terminate_mgr.c Fri Oct 10 03:25:54 2008
@@ -1082,8 +1082,9 @@
is_svr_side = sandesha2_msg_ctx_get_server_side(ack_rm_msg_ctx, env); /* Do we need this?:damitha */
engine = axis2_engine_create(env, conf_ctx);
+ /* Check whether this is replay mode. This value set when sending application message */
replay_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env,
- rms_sequence_id, SANDESHA2_SEQ_PROP_1_0_REPLAY);
+ rms_sequence_id, SANDESHA2_SEQ_PROP_REPLAY);
if(replay_bean)
{
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] replay on");
@@ -1099,6 +1100,9 @@
}
else if(AXIS2_SUCCESS == axis2_engine_send(engine, env, terminate_msg_ctx))
{
+ /* We need to resend the terminate sequence message or process the response in the back
+ * channel only in the replay mode.
+ */
if(replay_bean)
{
axiom_soap_envelope_t *res_envelope = NULL;
@@ -1308,8 +1312,6 @@
axis2_msg_ctx_set_soap_envelope(response_msg_ctx, env, response_envelope);
- /*axis2_msg_ctx_set_server_side(response_msg_ctx, env, AXIS2_TRUE);*/
-
axis2_msg_ctx_set_op_ctx(response_msg_ctx, env, axis2_msg_ctx_get_op_ctx(msg_ctx, env));
axis2_msg_ctx_set_svc_ctx(response_msg_ctx, env, axis2_msg_ctx_get_svc_ctx(msg_ctx, env));
axis2_msg_ctx_set_svc_grp_ctx(response_msg_ctx, env, axis2_msg_ctx_get_svc_grp_ctx(msg_ctx, env));
@@ -1330,6 +1332,7 @@
axis2_engine_free(engine, env);
}
+ /* We are not interested about the message context after now. So pause it. */
axis2_msg_ctx_set_paused(response_msg_ctx, env, AXIS2_FALSE);
axis2_msg_ctx_free(response_msg_ctx, env);
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org