ws-sandesha-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r603151 - in /webservices/sandesha/trunk/c/src: msgprocessors/ polling/ storage/sqlite/ util/
Date Tue, 11 Dec 2007 06:08:25 GMT
Author: damitha
Date: Mon Dec 10 22:08:23 2007
New Revision: 603151

URL: http://svn.apache.org/viewvc?rev=603151&view=rev
Log:
Now make connection messages are sending

Modified:
    webservices/sandesha/trunk/c/src/msgprocessors/make_connection_msg_processor.c
    webservices/sandesha/trunk/c/src/polling/polling_mgr.c
    webservices/sandesha/trunk/c/src/storage/sqlite/permanent_bean_mgr.c
    webservices/sandesha/trunk/c/src/storage/sqlite/permanent_next_msg_mgr.c
    webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c
    webservices/sandesha/trunk/c/src/util/sandesha2_utils.c
    webservices/sandesha/trunk/c/src/util/seq_mgr.c

Modified: webservices/sandesha/trunk/c/src/msgprocessors/make_connection_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/make_connection_msg_processor.c?rev=603151&r1=603150&r2=603151&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/make_connection_msg_processor.c (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/make_connection_msg_processor.c Mon Dec
10 22:08:23 2007
@@ -288,6 +288,12 @@
         env);
     return_msg_ctx = sandesha2_storage_mgr_retrieve_msg_ctx(storage_mgr, env, 
         msg_storage_key, conf_ctx, AXIS2_TRUE);
+    if(!return_msg_ctx)
+    {
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]msg_ctx not "\
+            "found for the msg_storage_key:%s", msg_storage_key);
+        return AXIS2_FAILURE;
+    }
     return_rm_msg_ctx = sandesha2_msg_init_init_msg(env, return_msg_ctx);
     add_msg_pending_header(env, return_rm_msg_ctx, pending);
     set_transport_properties(env, return_msg_ctx, rm_msg_ctx);

Modified: webservices/sandesha/trunk/c/src/polling/polling_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/polling/polling_mgr.c?rev=603151&r1=603150&r2=603151&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/polling/polling_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/polling/polling_mgr.c Mon Dec 10 22:08:23 2007
@@ -153,7 +153,8 @@
     const axis2_char_t *internal_seq_id)
 {
     sandesha2_storage_mgr_t *storage_mgr = NULL;
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
+        "[sandesha2]Entry:sandesha2_polling_mgr_start");
     AXIS2_PARAM_CHECK(env->error, conf_ctx, AXIS2_FAILURE);
     
     axutil_thread_mutex_lock(polling_mgr->mutex);
@@ -175,6 +176,8 @@
         internal_seq_id);
     sandesha2_polling_mgr_run(polling_mgr, env, storage_mgr);
     axutil_thread_mutex_unlock(polling_mgr->mutex);
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
+        "[sandesha2]Exit:sandesha2_polling_mgr_start");
     return AXIS2_SUCCESS;
 }
             
@@ -186,7 +189,6 @@
 {
     axutil_thread_t *worker_thread = NULL;
     sandesha2_polling_mgr_args_t *args = NULL;
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     
     args = AXIS2_MALLOC(env->allocator, sizeof(
                         sandesha2_polling_mgr_args_t)); 
@@ -223,6 +225,8 @@
     env = args->env;
     polling_mgr = args->impl;
     storage_mgr = args->storage_mgr;
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
+        "[sandesha2]Entry:sandesha2_polling_mgr_worker_func");
 
     while(polling_mgr->poll)
     {
@@ -374,7 +378,9 @@
                 SANDESHA2_MSG_TYPE_MAKE_CONNECTION_MSG);
             sandesha2_sender_bean_set_resend(make_conn_sender_bean, env, AXIS2_FALSE);
             sandesha2_sender_bean_set_send(make_conn_sender_bean, env, AXIS2_TRUE);
-            sandesha2_sender_bean_set_seq_id(make_conn_sender_bean, env, seq_id);
+            /*sandesha2_sender_bean_set_seq_id(make_conn_sender_bean, env, seq_id);*/
+            sandesha2_sender_bean_set_internal_seq_id(make_conn_sender_bean, 
+                env, seq_id);
             to = sandesha2_msg_ctx_get_to(make_conn_rm_msg_ctx, env);
             if(to)
             {
@@ -399,6 +405,9 @@
             sandesha2_sender_mgr_insert(sender_bean_mgr, env, 
                 make_conn_sender_bean);
         }
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]Sending the make "\
+            "connection message for the sequence with internal sequence id %s", 
+            seq_id);
         status = sandesha2_utils_execute_and_store(env, make_conn_rm_msg_ctx, 
             make_conn_msg_store_key);
         if(!status)
@@ -408,6 +417,8 @@
             return NULL;
         }
     }
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
+        "[sandesha2]Exit:sandesha2_polling_mgr_worker_func");
     return NULL;
 }
 

Modified: webservices/sandesha/trunk/c/src/storage/sqlite/permanent_bean_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/sqlite/permanent_bean_mgr.c?rev=603151&r1=603150&r2=603151&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/sqlite/permanent_bean_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/storage/sqlite/permanent_bean_mgr.c Mon Dec 10 22:08:23
2007
@@ -501,7 +501,7 @@
         size = axutil_array_list_size(beans, env);
     if( size > 1)
     {
-        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2] Non-Unique result");
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]Result is not unique");
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NON_UNIQUE_RESULT, 
             AXIS2_FAILURE);
         return NULL;

Modified: webservices/sandesha/trunk/c/src/storage/sqlite/permanent_next_msg_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/sqlite/permanent_next_msg_mgr.c?rev=603151&r1=603150&r2=603151&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/sqlite/permanent_next_msg_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/storage/sqlite/permanent_next_msg_mgr.c Mon Dec 10 22:08:23
2007
@@ -73,6 +73,10 @@
         {
             sandesha2_next_msg_bean_set_seq_id(bean, env, argv[i]);
         }
+        if(0 == axutil_strcmp(col_name[i], "internal_seq_id"))
+        {
+            sandesha2_next_msg_bean_set_internal_seq_id(bean, env, argv[i]);
+        }
         if(0 == axutil_strcmp(col_name[i], "ref_msg_key"))
         {
             if(argv[i] && 0 != axutil_strcmp("(null)", argv[i]))
@@ -117,6 +121,8 @@
     {
         if(0 == axutil_strcmp(col_name[i], "seq_id"))
             sandesha2_next_msg_bean_set_seq_id(bean, env, argv[i]);
+        if(0 == axutil_strcmp(col_name[i], "internal_seq_id"))
+            sandesha2_next_msg_bean_set_internal_seq_id(bean, env, argv[i]);
         if(0 == axutil_strcmp(col_name[i], "ref_msg_key"))
             if(argv[i] && 0 != axutil_strcmp("(null)", argv[i]))
             {
@@ -256,6 +262,7 @@
 {
     axis2_char_t sql_insert[1024];
 	axis2_char_t *seq_id = NULL;
+	axis2_char_t *internal_seq_id = NULL;
 	axis2_char_t *ref_msg_key = NULL;
 	axis2_bool_t polling_mode;
 	long msg_no;
@@ -267,14 +274,19 @@
 
 	seq_id = sandesha2_next_msg_bean_get_seq_id((sandesha2_rm_bean_t *) bean, 
         env);
+	internal_seq_id = sandesha2_next_msg_bean_get_internal_seq_id(
+        (sandesha2_rm_bean_t *) bean, env);
+	internal_seq_id = sandesha2_next_msg_bean_get_internal_seq_id(
+        (sandesha2_rm_bean_t *) bean, env);
 	ref_msg_key = sandesha2_next_msg_bean_get_ref_msg_key(bean, env);
 	polling_mode = sandesha2_next_msg_bean_is_polling_mode(bean, env);
     msg_no = sandesha2_next_msg_bean_get_next_msg_no_to_process(bean, env);
     next_msg_mgr_impl = SANDESHA2_INTF_TO_IMPL(next_msg_mgr);
 
-    sprintf(sql_insert, "insert into next_msg(seq_id, ref_msg_key,"\
-        "polling_mode, msg_no) values('%s', '%s', %d, %ld);", seq_id, 
-        ref_msg_key, polling_mode, msg_no);
+    sprintf(sql_insert, "insert into next_msg(seq_id, internal_seq_id, "\
+        "ref_msg_key,"\
+        "polling_mode, msg_no) values('%s', '%s', '%s', %d, %ld);", seq_id, 
+        internal_seq_id, ref_msg_key, polling_mode, msg_no);
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
         "[sandesha2]Exit:sandesha2_permanent_next_msg_mgr_insert");
     return sandesha2_permanent_bean_mgr_insert(next_msg_mgr_impl->bean_mgr, env,
@@ -315,8 +327,8 @@
     next_msg_mgr_impl = SANDESHA2_INTF_TO_IMPL(next_msg_mgr);
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
         "[sandesha2]Entry:sandesha2_permanent_next_msg_mgr_retrieve");
-    sprintf(sql_retrieve, "select seq_id, ref_msg_key, polling_mode, msg_no"\
-        " from next_msg where seq_id='%s';", seq_id);
+    sprintf(sql_retrieve, "select seq_id, internal_seq_id, ref_msg_key, "\
+        "polling_mode, msg_no from next_msg where seq_id='%s';", seq_id);
     bean = (sandesha2_next_msg_bean_t *) sandesha2_permanent_bean_mgr_retrieve(
         next_msg_mgr_impl->bean_mgr, env, sandesha2_next_msg_retrieve_callback, 
         sql_retrieve);
@@ -335,6 +347,7 @@
     axis2_bool_t ret = AXIS2_FALSE;
     sandesha2_permanent_next_msg_mgr_t *next_msg_mgr_impl = NULL;
 	axis2_char_t *seq_id = NULL;
+	axis2_char_t *internal_seq_id = NULL;
 	axis2_char_t *ref_msg_key = NULL;
 	axis2_bool_t polling_mode = AXIS2_FALSE;
 	long msg_no;
@@ -343,15 +356,18 @@
     AXIS2_PARAM_CHECK(env->error, bean, AXIS2_FALSE);
 	seq_id = sandesha2_next_msg_bean_get_seq_id((sandesha2_rm_bean_t *) bean, 
         env);
+	internal_seq_id = sandesha2_next_msg_bean_get_internal_seq_id(
+        (sandesha2_rm_bean_t *) bean, env);
     ref_msg_key = sandesha2_next_msg_bean_get_ref_msg_key(bean, env);
 	polling_mode = sandesha2_next_msg_bean_is_polling_mode(bean, env);
     msg_no = sandesha2_next_msg_bean_get_next_msg_no_to_process(bean, env);
 
     next_msg_mgr_impl = SANDESHA2_INTF_TO_IMPL(next_msg_mgr);
 
-    sprintf(sql_update, "update next_msg set ref_msg_key='%s', polling_mode=%d"\
-        ",msg_no=%ld where seq_id='%s';", ref_msg_key, polling_mode, msg_no, 
-        seq_id);
+    sprintf(sql_update, "update next_msg set internal_seq_id='%s', "\
+        "ref_msg_key='%s', polling_mode=%d"\
+        ",msg_no=%ld where seq_id='%s';", internal_seq_id, ref_msg_key, 
+        polling_mode, msg_no, seq_id);
     ret = sandesha2_permanent_bean_mgr_update(next_msg_mgr_impl->bean_mgr, env, 
         sql_update);
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
@@ -371,7 +387,8 @@
     next_msg_mgr_impl = SANDESHA2_INTF_TO_IMPL(next_msg_mgr);
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
         "[sandesha2]Entry:sandesha2_permanent_next_msg_mgr_find");
-    sql_find = "select seq_id,ref_msg_key, polling_mode,msg_no from next_msg";
+    sql_find = "select seq_id,internal_seq_id,ref_msg_key, polling_mode,"\
+        "msg_no from next_msg";
     ret = sandesha2_permanent_bean_mgr_find(next_msg_mgr_impl->bean_mgr, env, 
         (sandesha2_rm_bean_t *) bean, sandesha2_next_msg_find_callback,
         sql_find);
@@ -391,7 +408,8 @@
     sandesha2_permanent_next_msg_mgr_t *next_msg_mgr_impl = NULL;
     AXIS2_PARAM_CHECK(env->error, bean, AXIS2_FALSE);
     next_msg_mgr_impl = SANDESHA2_INTF_TO_IMPL(next_msg_mgr);
-    sql_find = "select seq_id,ref_msg_key,polling_mode,msg_no from next_msg";
+    sql_find = "select seq_id,internal_seq_id,ref_msg_key,polling_mode,msg_no "\
+        "from next_msg";
     ret = (sandesha2_next_msg_bean_t *) sandesha2_permanent_bean_mgr_find_unique(
         next_msg_mgr_impl->bean_mgr, env, (sandesha2_rm_bean_t *) bean, 
         sandesha2_next_msg_find_callback, sql_find);
@@ -406,7 +424,8 @@
     axis2_char_t *sql_find = NULL;
     sandesha2_permanent_next_msg_mgr_t *next_msg_mgr_impl = NULL;
     next_msg_mgr_impl = SANDESHA2_INTF_TO_IMPL(next_msg_mgr);
-    sql_find = "select seq_id,ref_msg_key,polling_mode,msg_no from next_msg";
+    sql_find = "select seq_id,internal_seq_id,ref_msg_key,polling_mode,"\
+        "msg_no from next_msg";
     return (axutil_array_list_t *) sandesha2_next_msg_mgr_find(
         next_msg_mgr, env, NULL);
 }

Modified: webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c?rev=603151&r1=603150&r2=603151&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c Mon Dec 10 22:08:23
2007
@@ -1201,7 +1201,8 @@
         "seq_id varchar(200), wsrm_anon_uri varchar(100), "\
         "to_address varchar(100))";
     sql_stmt4 = "create table if not exists next_msg("\
-        "seq_id varchar(200) primary key, ref_msg_key varchar(100), "\
+        "seq_id varchar(200) primary key, internal_seq_id varchar(200), "\
+        "ref_msg_key varchar(100), "\
         "polling_mode boolean, msg_no long)";
     sql_stmt5 = "create table if not exists seq_property(id varchar(200) ,"\
         "seq_id varchar(200), name varchar(200), value varchar(200))";

Modified: webservices/sandesha/trunk/c/src/util/sandesha2_utils.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/sandesha2_utils.c?rev=603151&r1=603150&r2=603151&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/sandesha2_utils.c (original)
+++ webservices/sandesha/trunk/c/src/util/sandesha2_utils.c Mon Dec 10 22:08:23 2007
@@ -438,7 +438,7 @@
     if(!polling_mgr)
     {
         AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
-            "[sandesha2] Starting the polling manager");
+            "[sandesha2]Starting the polling manager");
         polling_mgr = sandesha2_polling_mgr_create(env);
         property = axutil_property_create_with_args(env, 0, AXIS2_FALSE,
             (void *)sandesha2_polling_mgr_free_void_arg, polling_mgr);

Modified: webservices/sandesha/trunk/c/src/util/seq_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/seq_mgr.c?rev=603151&r1=603150&r2=603151&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/seq_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/seq_mgr.c Mon Dec 10 22:08:23 2007
@@ -86,6 +86,7 @@
     axis2_char_t *spec_version = NULL;
     axis2_char_t *address = NULL;
     axis2_char_t *reply_to_addr = NULL;
+    axis2_char_t *internal_seq_id = NULL;
 
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
         "[sandesha2]Entry:sandesha2_seq_mgr_setup_new_seq");
@@ -157,6 +158,9 @@
     next_msg_mgr = sandesha2_storage_mgr_get_next_msg_mgr(storage_mgr, env);
     next_msg_bean = sandesha2_next_msg_bean_create_with_data(env, seq_id, 1); 
                                                     /* 1 will be the next */
+    internal_seq_id = sandesha2_utils_get_outgoing_internal_seq_id(env, seq_id);
+    sandesha2_next_msg_bean_set_internal_seq_id(next_msg_bean, env, 
+        internal_seq_id);
     sandesha2_next_msg_mgr_insert(next_msg_mgr, env, next_msg_bean);
 
     /* Message to invoke. This will apply for only in-order invocations */



---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org


Mime
View raw message