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 sa...@apache.org on 2006/07/19 12:55:29 UTC

svn commit: r423433 - in /webservices/sandesha/trunk/c: include/ include/sandesha2/ src/util/

Author: sahan
Date: Wed Jul 19 03:55:29 2006
New Revision: 423433

URL: http://svn.apache.org/viewvc?rev=423433&view=rev
Log:
Adding Terminate Manager

Added:
    webservices/sandesha/trunk/c/include/sandesha2/sandesha2_terminate_mgr.h
    webservices/sandesha/trunk/c/src/util/terminate_mgr.c
Modified:
    webservices/sandesha/trunk/c/include/sandesha2_ack_mgr.h
    webservices/sandesha/trunk/c/include/sandesha2_sender.h
    webservices/sandesha/trunk/c/include/sandesha2_seq_mgr.h
    webservices/sandesha/trunk/c/src/util/Makefile.am
    webservices/sandesha/trunk/c/src/util/ack_mgr.c
    webservices/sandesha/trunk/c/src/util/seq_mgr.c

Added: webservices/sandesha/trunk/c/include/sandesha2/sandesha2_terminate_mgr.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2/sandesha2_terminate_mgr.h?rev=423433&view=auto
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2/sandesha2_terminate_mgr.h (added)
+++ webservices/sandesha/trunk/c/include/sandesha2/sandesha2_terminate_mgr.h Wed Jul 19 03:55:29 2006
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+#ifndef SANDESHA2_TERMINATER_MGR_H
+#define SANDESHA2_TERMINATER_MGR_H
+
+
+
+/**
+  * @file sandesha2_terminate_mgr.h
+  * @brief 
+  */
+
+#include <sandesha2_storage_mgr.h>
+#include <axis2_conf_ctx.h>
+#include <axis2_conf.h>
+#include <axiom_soap_envelope.h>
+#include <axis2_qname.h>
+#include <axis2_array_list.h>
+#include <axis2_op.h>
+#include <sandesha2/sandesha2_property_bean.h>
+#include <sandesha2/sandesha2_msg_ctx.h>
+#include <axiom_soap_envelope.h>
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** @defgroup sandesha2_terminate_mgr
+ * @ingroup sandesha2_util
+ * @{
+ */
+#define SANDESHA2_CLEANED_ON_TERMINATE_MSG "CleanedOnTerminateMsg"
+#define SANDESHA2_CLEANED_AFTER_INVOCATION "CleanedAfterInvocation"
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+sandesha2_clean_recv_side_after_terminate_msg(
+                        const axis2_env_t *env,
+                        axis2_conf_ctx_t *conf_ctx,
+                        axis2_char_t *seq_id,
+                        sandesha2_storage_mgr_t *storage_man);
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+sandesha2_clean_recv_side_after_invocation(
+                        const axis2_env_t *env,
+                        axis2_conf_ctx_t *conf_ctx,
+                        axis2_char_t *seq_id,
+                        sandesha2_storage_mgr_t *storage_man);
+                        
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+sandesha2_terminate_mgr_complete_term_on_recv_side(
+                        const axis2_env_t *env,
+                        axis2_conf_ctx_t *conf_ctx,
+                        axis2_char_t *seq_id,
+                        sandesha2_storage_mgr_t *storage_man);
+                        
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+sandesha2_terminate_mgr_remove_recv_side_propertis(
+                        const axis2_env_t *env,
+                        axis2_conf_ctx_t *conf_ctx,
+                        axis2_char_t *seq_id,
+                        sandesha2_storage_mgr_t *storage_man);
+                        
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+sandesha2_terminate_mgr_terminate_sending_side(
+                        const axis2_env_t *env,
+                        axis2_conf_ctx_t *conf_ctx,
+                        axis2_char_t *seq_id,
+                        axis2_bool_t svr_side,
+                        sandesha2_storage_mgr_t *storage_man);
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+sandesha2_terminate_mgr_do_updates_if_needed(
+                        const axis2_env_t *env,
+                        axis2_char_t *seq_id,
+                        sandesha2_seq_property_bean_t *prop_bean,
+                        sandesha2_seq_property_mgr_t *prop_mgr);
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+sandesha2_terminate_mgr_is_property_deletable(
+                        const axis2_env_t *env,
+                        axis2_char_t *name);
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+sandesha2_terminate_mgr_time_out_sending_side_seq(
+                        const axis2_env_t *env,
+                        axis2_conf_ctx_t *conf_ctx,
+                        axis2_char_t *seq_id,
+                        axis2_bool_t svr_side,
+                        sandesha2_storage_mgr_t *storage_man);
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+sandesha2_terminate_mgr_clean_sending_side_data(
+                        const axis2_env_t *env,
+                        axis2_conf_ctx_t *conf_ctx,
+                        axis2_char_t *seq_id,
+                        axis2_bool_t svr_side,
+                        sandesha2_storage_mgr_t *storage_man);
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+sandesha2_terminate_mgr_add_terminate_seq_msg(
+                        const axis2_env_t *env,
+                        sandesha2_msg_ctx_t *rm_msg_ctx,
+                        axis2_char_t *out_seq_id,
+                        axis2_char_t *int_seq_id,
+                        sandesha2_storage_mgr_t *storage_man);
+
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif                          /* SANDESHA2_TERMINATER_MGR_H */
+

Modified: webservices/sandesha/trunk/c/include/sandesha2_ack_mgr.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_ack_mgr.h?rev=423433&r1=423432&r2=423433&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_ack_mgr.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_ack_mgr.h Wed Jul 19 03:55:29 2006
@@ -62,6 +62,11 @@
         axis2_char_t *seq_id,
         sandesha2_seq_property_mgr_t *seq_prop_mgr);
 
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+sandesha2_ack_mgr_verify_seq_completion(const axis2_env_t *env,
+        axis2_array_list_t *ack_ranges,
+        long last_msg_no);
+
 /** @} */
 #ifdef __cplusplus
 }

Modified: webservices/sandesha/trunk/c/include/sandesha2_sender.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_sender.h?rev=423433&r1=423432&r2=423433&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_sender.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_sender.h Wed Jul 19 03:55:29 2006
@@ -97,7 +97,7 @@
 #define SANDESHA2_SENDER_STOP_FOR_SEQ(sender, env, \
         seq_id) \
       (((sandesha2_sender_t *) sender)->ops->\
-      stop_for_seq (sender, env, seq_id))
+      stop_sender_for_seq (sender, env, seq_id))
 
 #define SANDESHA2_SENDER_STOP_SENDING(sender, env) \
       (((sandesha2_sender_t *) sender)->ops->\
@@ -113,7 +113,7 @@
 
 #define SANDESHA2_SENDER_RUN_FOR_SEQ(sender, env, conf_ctx, seq_id) \
       (((sandesha2_sender_t *) sender)->ops->\
-      run_for_seq (sender, env, conf_ctx, seq_id))
+      run_sender_for_seq (sender, env, conf_ctx, seq_id))
 
 /** @} */
 #ifdef __cplusplus

Modified: webservices/sandesha/trunk/c/include/sandesha2_seq_mgr.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_seq_mgr.h?rev=423433&r1=423432&r2=423433&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_seq_mgr.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_seq_mgr.h Wed Jul 19 03:55:29 2006
@@ -43,7 +43,7 @@
   * @{
   */
 
-axis2_char_t *AXIS2_CALL
+AXIS_EXTERN axis2_char_t *AXIS2_CALL
 sandesha2_seq_mgr_set_up_new_seq(
         const axis2_env_t *env,
         sandesha2_msg_ctx_t *create_seq_msg, 
@@ -54,7 +54,7 @@
  * @param internal_seq_id
  * @param config_ctx
  */
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 sandesha2_seq_mgr_update_last_activated_time(
         const axis2_env_t *env,
         axis2_char_t *property_key,

Modified: webservices/sandesha/trunk/c/src/util/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/Makefile.am?rev=423433&r1=423432&r2=423433&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/Makefile.am (original)
+++ webservices/sandesha/trunk/c/src/util/Makefile.am Wed Jul 19 03:55:29 2006
@@ -7,7 +7,8 @@
                             fault_data.c\
                             fault_mgr.c\
                             ack_mgr.c \
-							seq_mgr.c
+							seq_mgr.c\
+                            terminate_mgr.c
 
 INCLUDES = -I$(top_builddir)/include \
 			-I$(top_builddir)/include/sandesha2 \

Modified: webservices/sandesha/trunk/c/src/util/ack_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/ack_mgr.c?rev=423433&r1=423432&r2=423433&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/ack_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/ack_mgr.c Wed Jul 19 03:55:29 2006
@@ -19,6 +19,7 @@
 #include <sandesha2/sandesha2_constants.h>
 #include <sandesha2/sandesha2_property_bean.h>
 #include <sandesha2_seq_property_bean.h>
+#include <sandesha2_ack_range.h>
 #include <sandesha2/sandesha2_spec_specific_consts.h>
 #include <axis2_string.h>
 #include <axis2_uuid_gen.h>
@@ -320,4 +321,42 @@
     }
     return completed_msg_list;
 }
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+sandesha2_ack_mgr_verify_seq_completion(const axis2_env_t *env,
+        axis2_array_list_t *ack_ranges,
+        long last_msg_no)
+{
+    axis2_hash_t *hash = NULL;
+    axis2_char_t tmp[32];
+    int i = 0;
+    long start = 1;
+    
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+    AXIS2_PARAM_CHECK(env->error, ack_ranges, AXIS2_FALSE);
+    
+    hash = axis2_hash_make(env);
+    for(i  = 0; i< AXIS2_ARRAY_LIST_SIZE(ack_ranges, env); i++)
+    {
+        sandesha2_ack_range_t *ack_range = NULL;
+        
+        ack_range = AXIS2_ARRAY_LIST_GET(ack_ranges, env, i);
+        sprintf(tmp, "%ld", SANDESHA2_ACK_RANGE_GET_LOWER_VALUE(ack_range, env));
+        axis2_hash_set(hash, tmp, AXIS2_HASH_KEY_STRING, ack_range);
+    }
     
+    while(AXIS2_TRUE)
+    {
+        sandesha2_ack_range_t *ack_range = NULL;
+        sprintf(tmp, "%ld", start);
+        ack_range = axis2_hash_get(hash, tmp, AXIS2_HASH_KEY_STRING);
+        
+        if(NULL == ack_range)
+            break;
+        if(SANDESHA2_ACK_RANGE_GET_UPPER_VALUE(ack_range, env) >= last_msg_no)
+            return AXIS2_TRUE;
+        start = SANDESHA2_ACK_RANGE_GET_UPPER_VALUE(ack_range, env) + 1;        
+    }
+    return AXIS2_FALSE;
+}

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=423433&r1=423432&r2=423433&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/seq_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/seq_mgr.c Wed Jul 19 03:55:29 2006
@@ -34,7 +34,7 @@
 #include <axis2_log.h>
 #include <axis2_uuid_gen.h>
 
-axis2_char_t *AXIS2_CALL
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
 sandesha2_seq_mgr_set_up_new_seq(
         const axis2_env_t *env,
         sandesha2_msg_ctx_t *create_seq_msg, 
@@ -179,7 +179,7 @@
  * @param internal_seq_id
  * @param config_ctx
  */
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 sandesha2_seq_mgr_update_last_activated_time(
         const axis2_env_t *env,
         axis2_char_t *property_key,

Added: 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=423433&view=auto
==============================================================================
--- webservices/sandesha/trunk/c/src/util/terminate_mgr.c (added)
+++ webservices/sandesha/trunk/c/src/util/terminate_mgr.c Wed Jul 19 03:55:29 2006
@@ -0,0 +1,188 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+#include <sandesha2/sandesha2_utils.h>
+#include <sandesha2_terminate_mgr.h>
+#include <sandesha2/sandesha2_constants.h>
+#include <sandesha2/sandesha2_property_bean.h>
+#include <sandesha2_seq_property_bean.h>
+#include <sandesha2_ack_range.h>
+#include <sandesha2/sandesha2_spec_specific_consts.h>
+#include <axis2_string.h>
+#include <axis2_uuid_gen.h>
+#include <axis2_addr.h>
+#include <axis2_property.h>
+#include <axis2_array_list.h>
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+sandesha2_clean_recv_side_after_terminate_msg(
+                        const axis2_env_t *env,
+                        axis2_conf_ctx_t *conf_ctx,
+                        axis2_char_t *seq_id,
+                        sandesha2_storage_mgr_t *storage_man)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, conf_ctx, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, seq_id, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, storage_man, AXIS2_FAILURE);
+    
+    
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+sandesha2_clean_recv_side_after_invocation(
+                        const axis2_env_t *env,
+                        axis2_conf_ctx_t *conf_ctx,
+                        axis2_char_t *seq_id,
+                        sandesha2_storage_mgr_t *storage_man)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, conf_ctx, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, seq_id, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, storage_man, AXIS2_FAILURE);
+    
+    
+    return AXIS2_SUCCESS;
+}
+                        
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+sandesha2_terminate_mgr_complete_term_on_recv_side(
+                        const axis2_env_t *env,
+                        axis2_conf_ctx_t *conf_ctx,
+                        axis2_char_t *seq_id,
+                        sandesha2_storage_mgr_t *storage_man)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, conf_ctx, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, seq_id, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, storage_man, AXIS2_FAILURE);
+    
+    
+    return AXIS2_SUCCESS;
+}
+                        
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+sandesha2_terminate_mgr_remove_recv_side_propertis(
+                        const axis2_env_t *env,
+                        axis2_conf_ctx_t *conf_ctx,
+                        axis2_char_t *seq_id,
+                        sandesha2_storage_mgr_t *storage_man)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, conf_ctx, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, seq_id, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, storage_man, AXIS2_FAILURE);
+    
+    
+    return AXIS2_SUCCESS;
+}
+                        
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+sandesha2_terminate_mgr_terminate_sending_side(
+                        const axis2_env_t *env,
+                        axis2_conf_ctx_t *conf_ctx,
+                        axis2_char_t *seq_id,
+                        axis2_bool_t svr_side,
+                        sandesha2_storage_mgr_t *storage_man)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, conf_ctx, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, seq_id, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, storage_man, AXIS2_FAILURE);
+    
+    
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+sandesha2_terminate_mgr_do_updates_if_needed(
+                        const axis2_env_t *env,
+                        axis2_char_t *seq_id,
+                        sandesha2_seq_property_bean_t *prop_bean,
+                        sandesha2_seq_property_mgr_t *prop_mgr)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, prop_bean, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, seq_id, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, prop_mgr, AXIS2_FAILURE);
+    
+    
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+sandesha2_terminate_mgr_is_property_deletable(
+                        const axis2_env_t *env,
+                        axis2_char_t *name)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+    AXIS2_PARAM_CHECK(env->error, name, AXIS2_FALSE);
+        
+    
+    return AXIS2_TRUE;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+sandesha2_terminate_mgr_time_out_sending_side_seq(
+                        const axis2_env_t *env,
+                        axis2_conf_ctx_t *conf_ctx,
+                        axis2_char_t *seq_id,
+                        axis2_bool_t svr_side,
+                        sandesha2_storage_mgr_t *storage_man)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, conf_ctx, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, seq_id, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, storage_man, AXIS2_FAILURE);
+    
+    
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+sandesha2_terminate_mgr_clean_sending_side_data(
+                        const axis2_env_t *env,
+                        axis2_conf_ctx_t *conf_ctx,
+                        axis2_char_t *seq_id,
+                        axis2_bool_t svr_side,
+                        sandesha2_storage_mgr_t *storage_man)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, conf_ctx, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, seq_id, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, storage_man, AXIS2_FAILURE);
+    
+    
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+sandesha2_terminate_mgr_add_terminate_seq_msg(
+                        const axis2_env_t *env,
+                        sandesha2_msg_ctx_t *rm_msg_ctx,
+                        axis2_char_t *out_seq_id,
+                        axis2_char_t *int_seq_id,
+                        sandesha2_storage_mgr_t *storage_man)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    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);
+    AXIS2_PARAM_CHECK(env->error, storage_man, AXIS2_FAILURE);
+    
+    return AXIS2_SUCCESS;
+}



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