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/11 04:57:58 UTC
svn commit: r420684 - in /webservices/sandesha/trunk/c:
include/sandesha2/sandesha2_fault_data.h
include/sandesha2/sandesha2_fault_manager.h
src/msgprocessors/app_msg_processor.c
Author: sahan
Date: Mon Jul 10 19:57:57 2006
New Revision: 420684
URL: http://svn.apache.org/viewvc?rev=420684&view=rev
Log:
Adding fault manager, fault data
Modifying app msg processor
Added:
webservices/sandesha/trunk/c/include/sandesha2/sandesha2_fault_data.h
webservices/sandesha/trunk/c/include/sandesha2/sandesha2_fault_manager.h
Modified:
webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
Added: webservices/sandesha/trunk/c/include/sandesha2/sandesha2_fault_data.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2/sandesha2_fault_data.h?rev=420684&view=auto
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2/sandesha2_fault_data.h (added)
+++ webservices/sandesha/trunk/c/include/sandesha2/sandesha2_fault_data.h Mon Jul 10 19:57:57 2006
@@ -0,0 +1,181 @@
+/*
+ * 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_FAULT_DATA_H
+#define SANDESHA2_FAULT_DATA_H
+
+/**
+ * @file sandesha2_fault_data.h
+ * @brief
+ */
+
+#include <axis2_utils_defines.h>
+#include <axis2_env.h>
+#include <axis2_conf_ctx.h>
+#include <axiom_node.h>
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/**
+ * @ingroup sandesha2_util
+ * @{
+ */
+
+ typedef struct sandesha2_fault_data_ops sandesha2_fault_data_ops_t;
+ typedef struct sandesha2_fault_data sandesha2_fault_data_t;
+ /**
+ * @brief Sandesha2 Fault Data ops struct
+ * Encapsulator struct for ops of sandesha2_fault_data
+ */
+AXIS2_DECLARE_DATA struct sandesha2_fault_data_ops
+{
+
+ axiom_node_t *(AXIS2_CALL *
+ get_detail)
+ (sandesha2_fault_data_t *data,
+ const axis2_env_t *env);
+
+ axis2_status_t (AXIS2_CALL *
+ set_detail)
+ (sandesha2_fault_data_t *data,
+ const axis2_env_t *env,
+ axiom_node_t *detail);
+
+ axis2_char_t *(AXIS2_CALL *
+ get_reason)
+ (sandesha2_fault_data_t *data,
+ const axis2_env_t *env);
+
+ axis2_status_t (AXIS2_CALL *
+ set_reason)
+ (sandesha2_fault_data_t *data,
+ const axis2_env_t *env,
+ axis2_char_t *reason);
+
+ axis2_char_t *(AXIS2_CALL *
+ get_sub_code)
+ (sandesha2_fault_data_t *data,
+ const axis2_env_t *env);
+
+ axis2_status_t (AXIS2_CALL *
+ set_sub_code)
+ (sandesha2_fault_data_t *data,
+ const axis2_env_t *env,
+ axis2_char_t *sub_code);
+
+ axis2_char_t *(AXIS2_CALL *
+ get_code)
+ (sandesha2_fault_data_t *data,
+ const axis2_env_t *env);
+
+ axis2_status_t (AXIS2_CALL *
+ set_code)
+ (sandesha2_fault_data_t *data,
+ const axis2_env_t *env,
+ axis2_char_t *sub_code);
+
+ int (AXIS2_CALL *
+ get_type)
+ (sandesha2_fault_data_t *data,
+ const axis2_env_t *env);
+
+ axis2_status_t (AXIS2_CALL *
+ set_type)
+ (sandesha2_fault_data_t *data,
+ const axis2_env_t *env,
+ int type);
+
+ axis2_char_t *(AXIS2_CALL *
+ get_seq_id)
+ (sandesha2_fault_data_t *data,
+ const axis2_env_t *env);
+
+ axis2_status_t (AXIS2_CALL *
+ set_seq_id)
+ (sandesha2_fault_data_t *data,
+ const axis2_env_t *env,
+ axis2_char_t *seq_id);
+
+ axis2_status_t (AXIS2_CALL *
+ free)
+ (sandesha2_fault_data_t *data,
+ const axis2_env_t *env);
+};
+
+/**
+ * @brief sandesha2_fault_data_ops
+ * sandesha2_fault_data_ops
+ */
+AXIS2_DECLARE_DATA struct sandesha2_fault_data
+{
+ sandesha2_fault_data_ops_t *ops;
+};
+
+AXIS2_EXTERN sandesha2_fault_data_t* AXIS2_CALL
+sandesha2_fault_data_create(
+ const axis2_env_t *env);
+
+/************************** Start of function macros **************************/
+#define SANDESHA2_FAULT_DATA_FREE(data, env) \
+ ((data)->ops->free (data, env))
+
+#define SANDESHA2_FAULT_DATA_GET_DETAIL(data, env) \
+ ((data)->ops->get_detail(data, env))
+
+#define SANDESHA2_FAULT_DATA_SET_DETAIL(data, env, detail) \
+ ((data)->ops->set_detail(data, env. detail))
+
+#define SANDESHA2_FAULT_DATA_GET_REASON(data, env) \
+ ((data)->ops->get_reason(data, env))
+
+#define SANDESHA2_FAULT_DATA_SET_REASON(data, env, reason) \
+ ((data)->ops->set_reason(data, env. reason))
+
+#define SANDESHA2_FAULT_DATA_GET_SUB_CODE(data, env) \
+ ((data)->ops->get_sub_code(data, env))
+
+#define SANDESHA2_FAULT_DATA_SET_SUB_CODE(data, env, sub_code) \
+ ((data)->ops->set_sub_code(data, env. sub_code))
+
+#define SANDESHA2_FAULT_DATA_GET_CODE(data, env) \
+ ((data)->ops->get_sub_code(data, env))
+
+#define SANDESHA2_FAULT_DATA_SET_CODE(data, env, code) \
+ ((data)->ops->set_code(data, env. code))
+
+#define SANDESHA2_FAULT_DATA_GET_TYPE(data, env) \
+ ((data)->ops->get_type(data, env))
+
+#define SANDESHA2_FAULT_DATA_SET_TYPE(data, env, type) \
+ ((data)->ops->set_type(data, env. type))
+
+#define SANDESHA2_FAULT_DATA_GET_SEQ_ID(data, env) \
+ ((data)->ops->get_seq_id(data, env))
+
+#define SANDESHA2_FAULT_DATA_SET_SEQ_ID(data, env, seq_id) \
+ ((data)->ops->set_seq_id(data, env. seq_id)
+/************************** End of function macros ****************************/
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*SANDESHA2_FAULT_DATA_H*/
Added: webservices/sandesha/trunk/c/include/sandesha2/sandesha2_fault_manager.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2/sandesha2_fault_manager.h?rev=420684&view=auto
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2/sandesha2_fault_manager.h (added)
+++ webservices/sandesha/trunk/c/include/sandesha2/sandesha2_fault_manager.h Mon Jul 10 19:57:57 2006
@@ -0,0 +1,169 @@
+/*
+ * 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_FAULT_MANAGER_H
+#define SANDESHA2_FAULT_MANAGER_H
+
+/**
+ * @file sandesha2_fault_manager.h
+ * @brief
+ */
+
+#include <axis2_utils_defines.h>
+#include <axis2_env.h>
+#include <axis2_conf_ctx.h>
+#include <sandesha2/sandesha2_msg_ctx.h>
+#include <sandesha2/sandesha2_storage_manager.h>
+#include <sandesha2/sandesha2_fault_data.h>
+#include <axis2_msg_ctx.h>
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/**
+ * @ingroup sandesha2_util
+ * @{
+ */
+
+ typedef struct sandesha2_fault_manager_ops sandesha2_fault_manager_ops_t;
+ typedef struct sandesha2_fault_manager sandesha2_fault_manager_t;
+ /**
+ * @brief Sandesha2 Fault Manager ops struct
+ * Encapsulator struct for ops of sandesha2_fault_manager
+ */
+AXIS2_DECLARE_DATA struct sandesha2_fault_manager_ops
+{
+
+ sandesha2_msg_ctx_t* (AXIS2_CALL *
+ check_for_create_seq_refused)
+ (sandesha2_fault_manager_t *fault_mgr,
+ const axis2_env_t *env,
+ axis2_msg_ctx_t *create_seq_msg,
+ sandesha2_storage_manager_t *storage_man);
+
+ sandesha2_msg_ctx_t* (AXIS2_CALL *
+ check_for_last_msg_num_exceeded)
+ (sandesha2_fault_manager_t *fault_mgr,
+ const axis2_env_t *env,
+ sandesha2_msg_ctx_t *app_rm_msg,
+ sandesha2_storage_manager_t *storage_man);
+
+ sandesha2_msg_ctx_t* (AXIS2_CALL *
+ check_for_msg_num_rollover)
+ (sandesha2_fault_manager_t *fault_mgr,
+ const axis2_env_t *env,
+ sandesha2_msg_ctx_t *create_seq_msg,
+ sandesha2_storage_manager_t *storage_man);
+
+ sandesha2_msg_ctx_t* (AXIS2_CALL *
+ check_for_unknown_seq)
+ (sandesha2_fault_manager_t *fault_mgr,
+ const axis2_env_t *env,
+ sandesha2_msg_ctx_t *create_seq_msg,
+ axis2_char_t *seq_id,
+ sandesha2_storage_manager_t *storage_man);
+
+ sandesha2_msg_ctx_t* (AXIS2_CALL *
+ check_for_invalid_ack)
+ (sandesha2_fault_manager_t *fault_mgr,
+ const axis2_env_t *env,
+ sandesha2_msg_ctx_t *ack_rm_msg,
+ sandesha2_storage_manager_t *storage_man);
+
+ sandesha2_msg_ctx_t* (AXIS2_CALL *
+ check_for_seq_closed)
+ (sandesha2_fault_manager_t *fault_mgr,
+ const axis2_env_t *env,
+ sandesha2_msg_ctx_t *create_seq_msg,
+ axis2_char_t *seq_id,
+ sandesha2_storage_manager_t *storage_man);
+
+ sandesha2_msg_ctx_t* (AXIS2_CALL *
+ get_fault)
+ (sandesha2_fault_manager_t *fault_mgr,
+ const axis2_env_t *env,
+ sandesha2_msg_ctx_t *create_seq_msg,
+ sandesha2_fault_data_t *fault_data,
+ axis2_char_t *addr_ns_uri,
+ sandesha2_storage_manager_t *storage_man);
+
+ axis2_status_t (AXIS2_CALL *
+ free)
+ (sandesha2_fault_manager_t *fault_mgr,
+ const axis2_env_t *env);
+};
+
+/**
+ * @brief sandesha2_fault_manager_ops
+ * sandesha2_fault_manager_ops
+ */
+AXIS2_DECLARE_DATA struct sandesha2_fault_manager
+{
+ sandesha2_fault_manager_ops_t *ops;
+};
+
+AXIS2_EXTERN sandesha2_fault_manager_t* AXIS2_CALL
+sandesha2_fault_manager_create(
+ const axis2_env_t *env);
+
+/************************** Start of function macros **************************/
+#define SANDESHA2_FAULT_MANAGER_FREE(fault_mgr, env) \
+ ((fault_mgr)->ops->free (fault_mgr, env))
+
+#define SANDESHA2_FAULT_MANAGER_CHECK_FOR_CREATE_SEQ_REFUSED(fault_mgr, env, \
+ msg, storage_man) \
+ ((fault_mgr)->ops->check_for_create_seq_refused(fault_mgr, env, msg, \
+ storage_man))
+
+#define SANDESHA2_FAULT_MANAGER_CHECK_FOR_LAST_MSG_NUM_EXCEEDED(fault_mgr, \
+ env, msg, storage_man) \
+ ((fault_mgr)->ops->check_for_last_msg_num_exceeded(fault_mgr, env, msg, \
+ storage_man))
+
+#define SANDESHA2_FAULT_MANAGER_CHECK_FOR_MSG_NUM_ROLLOVER(fault_mgr, \
+ env, msg, storage_man) \
+ ((fault_mgr)->ops->check_for_msg_num_rollover(fault_mgr, env, msg, \
+ storage_man))
+
+#define SANDESHA2_FAULT_MANAGER_CHECK_FOR_UNKNOWN_SEQ(fault_mgr, env, msg, \
+ seq_id, storage_man) \
+ ((fault_mgr)->ops->check_for_unknown_seq(fault_mgr, env, msg, seq_id, \
+ storage_man))
+
+#define SANDESHA2_FAULT_MANAGER_CHECK_FOR_INVALID_ACK(fault_mgr, env, msg, \
+ storage_man) \
+ ((fault_mgr)->ops->check_for_invalid_ack(fault_mgr, env, msg, storage_man))
+
+#define SANDESHA2_FAULT_MANAGER_CHECK_FOR_SEQ_CLOSED(fault_mgr, env, msg, \
+ seq_id, storage_man) \
+ ((fault_mgr)->ops->check_for_seq_closed(fault_mgr, env, msg, seq_id, \
+ storage_man))
+
+#define SANDESHA2_FAULT_MANAGER_GET_FAULT(fault_mgr, env, msg, fault_data,\
+ addr_ns_uri, storage_man) \
+ ((fault_mgr)->ops->get_fault(fault_mgr, env, msg, fault_data, addr_ns_uri, \
+ storage_man))
+/************************** End of function macros ****************************/
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*SANDESHA2_FAULT_MANAGER_H*/
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=420684&r1=420683&r2=420684&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c Mon Jul 10 19:57:57 2006
@@ -23,7 +23,9 @@
#include <sandesha2/sandesha2_invoker_bean_manager.h>
#include <sandesha2/sandesha2_next_msg_bean_manager.h>
#include <sandesha2/sandesha2_seq_property_bean_manager.h>
+#include <sandesha2/sandesha2_seq_property_bean.h>
#include <sandesha2/sandesha2_storage_manager.h>
+#include <sandesha2/sandesha2_fault_manager.h>
#include <sandesha2/sandesha2_constants.h>
#include <sandesha2/sandesha2_utils.h>
#include <axis2_string.h>
@@ -194,13 +196,15 @@
sandesha2_next_msg_bean_t *next_msg_bean = NULL;
axis2_bool_t in_order_invoke = AXIS2_FALSE;
sandesha2_invoker_bean_t *invoker_bean = NULL;
- sandesha2_seq_property_manager_t *next_bean_mgr = NULL;
-
+ sandesha2_seq_property_bean_manager_t *seq_prop_mgr = NULL;
+ axis2_char_t *highest_in_msg_no_str = NULL;
+ axis2_char_t *highest_in_msg_key_str = NULL;
+
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
- seq_ack = SANDESHA2_MSG_CTX_GET_MSG_PART(msg_ctx, env,
- SANDESHA2_MSG_PART_SEQ_ACKNOWLEDGEMENT);
+ seq_ack = (sandesha2_seq_ack_t*)SANDESHA2_MSG_CTX_GET_MSG_PART(msg_ctx,
+ env, SANDESHA2_MSG_PART_SEQ_ACKNOWLEDGEMENT);
if(NULL != seq_ack)
{
sandesha2_ack_processor_t *ack_proc = NULL;
@@ -296,7 +300,7 @@
SANDESHA2_SEQUENCE_SET_MUST_UNDERSTAND(sequence, env, AXIS2_FALSE);
SANDESHA2_MSG_CTX_ADD_SOAP_ENVELOPE(msg_ctx, env);
fault_ctx = SANDESHA2_FAULT_MANAGER_CHECK_FOR_SEQ_CLOSED(fault_man, env,
- str_seq_id, storage_man);
+ msg_ctx, str_seq_id, storage_man);
if(NULL != fault_ctx)
{
axis2_engine_t *engine = axis2_engine_create(env, conf_ctx);
@@ -344,9 +348,10 @@
sandesha2_seq_property_bean_t *highest_msg_key_bean = NULL;
highest_in_msg_no = msg_no;
- highest_msg_no_bean = sandesha2_seq_property_bean_create(env, str_seq_id,
- SANDESHA2_SEQ_PROP_HIGHEST_IN_MSG_NUMBER, msg_num_str);
- highest_msg_key_bean = sandesha2_seq_property_bean_create(env,
+ highest_msg_no_bean = sandesha2_seq_property_bean_create_with_data(env,
+ str_seq_id, SANDESHA2_SEQ_PROP_HIGHEST_IN_MSG_NUMBER,
+ msg_num_str);
+ highest_msg_key_bean = sandesha2_seq_property_bean_create_with_data(env,
str_seq_id, SANDESHA2_SEQ_PROP_HIGHEST_IN_MSG_KEY,
highest_in_msg_key_str);
SANDESHA2_STORAGE_MANAGER_REMOVE_MSG_CTX(storage_man, env,
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org