Author: damitha
Date: Fri Jan 25 04:41:42 2008
New Revision: 615209

URL: http://svn.apache.org/viewvc?rev=615209&view=rev
Log:
Adding terminate delay as a configurable module parameter

Modified:
    webservices/sandesha/trunk/c/config/module.xml
    webservices/sandesha/trunk/c/include/sandesha2_constants.h
    webservices/sandesha/trunk/c/include/sandesha2_property_bean.h
    webservices/sandesha/trunk/c/src/util/property_bean.c
    webservices/sandesha/trunk/c/src/util/property_mgr.c
    webservices/sandesha/trunk/c/src/util/terminate_mgr.c

Modified: webservices/sandesha/trunk/c/config/module.xml
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/config/module.xml?rev=615209&r1=615208&r2=615209&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/config/module.xml (original)
+++ webservices/sandesha/trunk/c/config/module.xml Fri Jan 25 04:41:42 2008
@@ -85,5 +85,6 @@
     <parameter name="SenderSleepTime" locked="false">100000</parameter><!--In 
micro seconds-->
     <parameter name="InvokerSleepTime" locked="false">1</parameter>
     <parameter name="PollingWaitTime" locked="false">3</parameter>
+    <parameter name="TerminateDelay" locked="false">4</parameter>
 
 </module>

Modified: webservices/sandesha/trunk/c/include/sandesha2_constants.h
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_constants.h?rev=615209&r1=615208&r2=615209&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_constants.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_constants.h Fri Jan 25 
04:41:42 2008
@@ -366,6 +366,8 @@
        #define SANDESHA2_PROPERTIES_INACTIVETIMEOUT  "InactivityTimeout"
                
        #define SANDESHA2_PROPERTIES_INACTIVETIMEOUT_MEASURE  
"InactivityTimeoutMeasure"
+       
+    #define SANDESHA2_PROPERTIES_TERMINATE_DELAY  "TerminateDelay"
                
        #define SANDESHA2_PROPERTIES_STORAGE_MGR  "StorageManager"
                

Modified: webservices/sandesha/trunk/c/include/sandesha2_property_bean.h
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_property_bean.h?rev=615209&r1=615208&r2=615209&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_property_bean.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_property_bean.h Fri Jan 25 
04:41:42 2008
@@ -193,6 +193,17 @@
     void *arg,
     const axutil_env_t *env);
 
+int AXIS2_CALL
+sandesha2_property_bean_get_terminate_delay (
+    sandesha2_property_bean_t *bean,
+    const axutil_env_t *env);
+            
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_terminate_delay(
+    sandesha2_property_bean_t *bean,
+    const axutil_env_t *env, 
+    int delay);
+
                        
 /** @} */
 #ifdef __cplusplus

Modified: webservices/sandesha/trunk/c/src/util/property_bean.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/property_bean.c?rev=615209&r1=615208&r2=615209&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/property_bean.c (original)
+++ webservices/sandesha/trunk/c/src/util/property_bean.c Fri Jan 25 04:41:42 
2008
@@ -33,6 +33,7 @@
     axis2_bool_t is_in_order;
     axutil_array_list_t *msg_types_to_drop;
     int max_retrans_count;
+    int terminate_delay;
     axis2_char_t *db_path;
 };
 
@@ -58,6 +59,7 @@
     bean->is_in_order = AXIS2_FALSE;
     bean->msg_types_to_drop = NULL;
     bean->max_retrans_count = 0;
+    bean->terminate_delay = 0;
     bean->db_path = NULL;
     
        return bean;
@@ -285,6 +287,25 @@
     bean->max_retrans_count = count;
     return AXIS2_SUCCESS;
 }
+
+int AXIS2_CALL
+sandesha2_property_bean_get_terminate_delay (
+    sandesha2_property_bean_t *bean,
+    const axutil_env_t *env)
+{
+    return bean->terminate_delay;
+}
+            
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_terminate_delay(
+    sandesha2_property_bean_t *bean,
+    const axutil_env_t *env, 
+    int delay)
+{
+    bean->terminate_delay = delay;
+    return AXIS2_SUCCESS;
+}
+
 
 axis2_char_t *AXIS2_CALL
 sandesha2_property_bean_get_db_path(

Modified: webservices/sandesha/trunk/c/src/util/property_mgr.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/property_mgr.c?rev=615209&r1=615208&r2=615209&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/property_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/property_mgr.c Fri Jan 25 04:41:42 
2008
@@ -94,6 +94,8 @@
         SANDESHA2_DEF_VAL_MAX_RETR_COUNT);
     sandesha2_property_mgr_load_msg_types_to_drop(env, 
         SANDESHA2_DEF_VAL_MSG_TYPES_TO_DROP, property_bean);
+    sandesha2_property_bean_set_terminate_delay(property_bean, env,
+        SANDESHA2_TERMINATE_DELAY);
     return property_bean;
 }
 
@@ -203,6 +205,23 @@
             AXIS2_FREE(env->allocator, str);
     }
 
+    param = axis2_module_desc_get_param(module_desc, env, 
+        SANDESHA2_PROPERTIES_TERMINATE_DELAY);
+    if(param)
+    {
+        int terminate_delay = -1;
+        axis2_char_t *terminate_delay_str = axutil_param_get_value(param, env);
+        axis2_char_t *str = sandesha2_utils_trim_string(env, 
terminate_delay_str);
+        if(str)
+            terminate_delay = atoi(str);
+        else
+            terminate_delay = SANDESHA2_TERMINATE_DELAY;
+        if(0 < terminate_delay)
+            sandesha2_property_bean_set_terminate_delay(property_bean, env, 
+                terminate_delay);
+        if(str)
+            AXIS2_FREE(env->allocator, str);
+    }
     return property_bean;
 }
 

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=615209&r1=615208&r2=615209&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/terminate_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/terminate_mgr.c Fri Jan 25 04:41:42 
2008
@@ -703,6 +703,8 @@
     long send_time = -1;
     sandesha2_terminate_seq_t *terminate_seq = NULL;
     axis2_char_t *seq_id = NULL;
+    int terminate_delay = -1;
+    sandesha2_property_bean_t *property_bean = NULL;
 
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
         "[sandesha2]Entry:sandesha2_terminate_mgr_add_terminate_seq_msg");
@@ -833,8 +835,12 @@
     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) +
-        SANDESHA2_TERMINATE_DELAY;
+        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));



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to