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/17 04:37:25 UTC
svn commit: r422605 - in /webservices/sandesha/trunk/c: include/sandesha2/
src/msgprocessors/ src/util/ src/workers/
Author: sahan
Date: Sun Jul 16 19:37:25 2006
New Revision: 422605
URL: http://svn.apache.org/viewvc?rev=422605&view=rev
Log:
Addind ack processor, create seq processor, and property bean
Changing the name of fault_manager => fault_mgr
Changing array list to_string to take type
Added:
webservices/sandesha/trunk/c/include/sandesha2/sandesha2_ack_msg_processor.h
webservices/sandesha/trunk/c/include/sandesha2/sandesha2_create_seq_msg_processor.h
webservices/sandesha/trunk/c/src/msgprocessors/ack_msg_processor.c
webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c
webservices/sandesha/trunk/c/src/util/fault_mgr.c
- copied unchanged from r421799, webservices/sandesha/trunk/c/src/util/fault_manager.c
webservices/sandesha/trunk/c/src/util/property_bean.c
Removed:
webservices/sandesha/trunk/c/src/util/fault_manager.c
Modified:
webservices/sandesha/trunk/c/include/sandesha2/sandesha2_app_msg_processor.h
webservices/sandesha/trunk/c/include/sandesha2/sandesha2_create_seq_res.h
webservices/sandesha/trunk/c/include/sandesha2/sandesha2_utils.h
webservices/sandesha/trunk/c/src/msgprocessors/Makefile.am
webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
webservices/sandesha/trunk/c/src/util/Makefile.am
webservices/sandesha/trunk/c/src/util/utils.c
webservices/sandesha/trunk/c/src/workers/in_order_invoker.c
Added: webservices/sandesha/trunk/c/include/sandesha2/sandesha2_ack_msg_processor.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2/sandesha2_ack_msg_processor.h?rev=422605&view=auto
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2/sandesha2_ack_msg_processor.h (added)
+++ webservices/sandesha/trunk/c/include/sandesha2/sandesha2_ack_msg_processor.h Sun Jul 16 19:37:25 2006
@@ -0,0 +1,49 @@
+/*
+ * 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_ACK_MSG_PROCESSOR_H
+#define SANDESHA2_ACK_MSG_PROCESSOR_H
+
+/**
+ * @file sandesha2_ack_msg_processor.h
+ * @brief
+ */
+
+#include <axis2_utils_defines.h>
+#include <axis2_env.h>
+#include <sandesha2/sandesha2_msg_processor.h>
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** @defgroup sandesha2_ack_msg_processor
+ * @ingroup sandesha2_msgprocessors
+ * @{
+ */
+
+AXIS2_EXTERN sandesha2_msg_processor_t* AXIS2_CALL
+sandesha2_ack_msg_processor_create(
+ const axis2_env_t *env);
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* SANDESHA2_ACK_MSG_PROCESSOR_H */
+
Modified: webservices/sandesha/trunk/c/include/sandesha2/sandesha2_app_msg_processor.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2/sandesha2_app_msg_processor.h?rev=422605&r1=422604&r2=422605&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2/sandesha2_app_msg_processor.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2/sandesha2_app_msg_processor.h Sun Jul 16 19:37:25 2006
@@ -39,8 +39,7 @@
AXIS2_EXTERN sandesha2_msg_processor_t* AXIS2_CALL
sandesha2_app_msg_processor_create(
- const axis2_env_t *env,
- sandesha2_msg_ctx_t *rm_msg_ctx);
+ const axis2_env_t *env);
/** @} */
#ifdef __cplusplus
}
Added: webservices/sandesha/trunk/c/include/sandesha2/sandesha2_create_seq_msg_processor.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2/sandesha2_create_seq_msg_processor.h?rev=422605&view=auto
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2/sandesha2_create_seq_msg_processor.h (added)
+++ webservices/sandesha/trunk/c/include/sandesha2/sandesha2_create_seq_msg_processor.h Sun Jul 16 19:37:25 2006
@@ -0,0 +1,49 @@
+/*
+ * 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_CREATE_SEQ_MSG_PROCESSOR_H
+#define SANDESHA2_CREATE_SEQ_MSG_PROCESSOR_H
+
+/**
+ * @file sandesha2_create_seq_msg_processor.h
+ * @brief
+ */
+
+#include <axis2_utils_defines.h>
+#include <axis2_env.h>
+#include <sandesha2/sandesha2_msg_processor.h>
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** @defgroup sandesha2_create_seq_msg_processor
+ * @ingroup sandesha2_msgprocessors
+ * @{
+ */
+
+AXIS2_EXTERN sandesha2_msg_processor_t* AXIS2_CALL
+sandesha2_create_seq_msg_processor_create(
+ const axis2_env_t *env);
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* SANDESHA2_CREATE_SEQ_MSG_PROCESSOR_H */
+
Modified: webservices/sandesha/trunk/c/include/sandesha2/sandesha2_create_seq_res.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2/sandesha2_create_seq_res.h?rev=422605&r1=422604&r2=422605&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2/sandesha2_create_seq_res.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2/sandesha2_create_seq_res.h Sun Jul 16 19:37:25 2006
@@ -98,17 +98,17 @@
axis2_char_t *rm_ns_value,
axis2_char_t *addr_ns_value);
/************************** Start of function macros **************************/
-#define SANDESHA2_CREARE_SEQ_RES_SET_IDENTIFIER(create_seq_res, env, identifier)\
+#define SANDESHA2_CREATE_SEQ_RES_SET_IDENTIFIER(create_seq_res, env, identifier)\
((create_seq_res)->ops->set_identifier (create_seq_res, env, identifier))
-#define SANDESHA2_CREARE_SEQ_RES_GET_IDENTIFIER(create_seq_res, env) \
+#define SANDESHA2_CREATE_SEQ_RES_GET_IDENTIFIER(create_seq_res, env) \
((create_seq_res)->ops->get_identifier (create_seq_res, env))
-#define SANDESHA2_CREARE_SEQ_RES_SET_ACCEPT(create_seq_res, env, accept) \
+#define SANDESHA2_CREATE_SEQ_RES_SET_ACCEPT(create_seq_res, env, accept) \
((create_seq_res)->ops->set_accept (create_seq_res, env, accept))
-#define SANDESHA2_CREARE_SEQ_RES_GET_ACCEPT(create_seq_res, env) \
+#define SANDESHA2_CREATE_SEQ_RES_GET_ACCEPT(create_seq_res, env) \
((create_seq_res)->ops->get_accept (create_seq_res, env))
-#define SANDESHA2_CREARE_SEQ_RES_EXPIRES (create_seq_res, env, expires) \
+#define SANDESHA2_CREATE_SEQ_RES_EXPIRES (create_seq_res, env, expires) \
((create_seq_res)->ops->set_expires (create_seq_res, env, expires))
-#define SANDESHA2_CREARE_SEQ_RES_GET_EXPIRES(create_seq_res, env) \
+#define SANDESHA2_CREATE_SEQ_RES_GET_EXPIRES(create_seq_res, env) \
((create_seq_res)->ops->get_expires (create_seq_res, env))
/************************** End of function macros ****************************/
/** @} */
Modified: webservices/sandesha/trunk/c/include/sandesha2/sandesha2_utils.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2/sandesha2_utils.h?rev=422605&r1=422604&r2=422605&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2/sandesha2_utils.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2/sandesha2_utils.h Sun Jul 16 19:37:25 2006
@@ -32,6 +32,7 @@
#include <axis2_array_list.h>
#include <axis2_op.h>
#include <sandesha2/sandesha2_property_bean.h>
+#include <sandesha2/sandesha2_msg_ctx.h>
#ifdef __cplusplus
extern "C"
@@ -42,6 +43,10 @@
* @ingroup sandesha2_util
* @{
*/
+/* Array list types */
+#define SANDESHA2_ARRAY_LIST_STRING 0
+#define SANDESHA2_ARRAY_LIST_LONG 1
+
AXIS2_EXTERN long AXIS2_CALL
sandesha2_utils_get_current_time_in_millis(
@@ -86,7 +91,8 @@
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
sandesha2_utils_array_list_to_string(const axis2_env_t *env,
- axis2_array_list_t *list);
+ axis2_array_list_t *list,
+ int type);
AXIS2_EXTERN axis2_status_t AXIS2_CALL
sandesha2_utils_start_invoker_for_seq(const axis2_env_t *env,
@@ -111,6 +117,12 @@
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
sandesha2_utils_get_svr_side_incoming_seq_id(const axis2_env_t *env,
axis2_char_t *incoming_seq_id);
+
+AXIS2_EXTERN axis2_msg_ctx_t *AXIS2_CALL
+sandesha2_utils_create_new_related_msg_ctx(const axis2_env_t *env,
+ sandesha2_msg_ctx_t *ref_rm_msg,
+ axis2_op_t *op);
+
/** @} */
#ifdef __cplusplus
Modified: webservices/sandesha/trunk/c/src/msgprocessors/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/Makefile.am?rev=422605&r1=422604&r2=422605&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/Makefile.am (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/Makefile.am Sun Jul 16 19:37:25 2006
@@ -1,7 +1,9 @@
TESTS =
noinst_LTLIBRARIES = libsandesha2_msgprocessors.la
-libsandesha2_msgprocessors_la_SOURCES = app_msg_processor.c
+libsandesha2_msgprocessors_la_SOURCES = app_msg_processor.c\
+ create_seq_msg_processor.c\
+ ack_msg_processor.c
INCLUDES = -I$(top_builddir)/include \
@AXIS2INC@
Added: webservices/sandesha/trunk/c/src/msgprocessors/ack_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/ack_msg_processor.c?rev=422605&view=auto
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/ack_msg_processor.c (added)
+++ webservices/sandesha/trunk/c/src/msgprocessors/ack_msg_processor.c Sun Jul 16 19:37:25 2006
@@ -0,0 +1,417 @@
+/*
+ * 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_ack_msg_processor.h>
+#include <sandesha2_seq_property_mgr.h>
+#include <sandesha2_seq_property_bean.h>
+#include <sandesha2_storage_mgr.h>
+#include <sandesha2_fault_mgr.h>
+#include <sandesha2/sandesha2_constants.h>
+#include <sandesha2/sandesha2_utils.h>
+#include <sandesha2/sandesha2_msg_ctx.h>
+#include <axis2_msg_ctx.h>
+#include <axis2_string.h>
+#include <axis2_engine.h>
+#include <axiom_soap_const.h>
+#include <stdio.h>
+#include <sandesha2_storage_mgr.h>
+#include <axis2_msg_ctx.h>
+#include <axis2_conf_ctx.h>
+#include <axis2_core_utils.h>
+#include <sandesha2/sandesha2_seq_ack.h>
+#include <sandesha2/sandesha2_create_seq_res.h>
+#include <axis2_uuid_gen.h>
+#include <sandesha2_create_seq_bean.h>
+#include <sandesha2_create_seq_mgr.h>
+#include <axis2_endpoint_ref.h>
+#include <axis2_op_ctx.h>
+#include <sandesha2/sandesha2_spec_specific_consts.h>
+
+/**
+ * @brief Acknowledgement Message Processor struct impl
+ * Sandesha2 Acknowledgement Msg Processor
+ */
+typedef struct sandesha2_ack_msg_processor_impl
+ sandesha2_ack_msg_processor_impl_t;
+
+struct sandesha2_ack_msg_processor_impl
+{
+ sandesha2_msg_processor_t msg_processor;
+};
+
+#define SANDESHA2_INTF_TO_IMPL(msg_proc) \
+ ((sandesha2_ack_msg_processor_impl_t *)(msg_proc))
+
+/***************************** Function headers *******************************/
+axis2_status_t AXIS2_CALL
+sandesha2_ack_msg_processor_process_in_msg (
+ sandesha2_msg_processor_t *msg_processor,
+ const axis2_env_t *env,
+ sandesha2_msg_ctx_t *rm_msg_ctx);
+
+axis2_status_t AXIS2_CALL
+sandesha2_ack_msg_processor_process_out_msg(
+ sandesha2_msg_processor_t *msg_processor,
+ const axis2_env_t *env,
+ sandesha2_msg_ctx_t *rm_msg_ctx);
+
+sandesha2_sender_bean_t* AXIS2_CALL
+sandesha2_ack_msg_processor_get_retrans_entry(
+ sandesha2_msg_processor_t *msg_processor,
+ const axis2_env_t *env,
+ axis2_array_list_t *list,
+ long msg_no);
+
+long AXIS2_CALL
+sandesha2_ack_msg_processor_get_no_of_msgs_acked(
+ sandesha2_msg_processor_t *msg_processor,
+ const axis2_env_t *env,
+ axis2_array_list_t *list);
+
+axis2_status_t AXIS2_CALL
+sandesha2_ack_msg_processor_free (sandesha2_msg_processor_t *element,
+ const axis2_env_t *env);
+
+/***************************** End of function headers ************************/
+
+AXIS2_EXTERN sandesha2_msg_processor_t* AXIS2_CALL
+sandesha2_ack_msg_processor_create(const axis2_env_t *env)
+{
+ sandesha2_ack_msg_processor_impl_t *msg_proc_impl = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+
+ msg_proc_impl = (sandesha2_ack_msg_processor_impl_t *)AXIS2_MALLOC
+ (env->allocator,
+ sizeof(sandesha2_ack_msg_processor_impl_t));
+
+ if(NULL == msg_proc_impl)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ msg_proc_impl->msg_processor.ops = AXIS2_MALLOC(env->allocator,
+ sizeof(sandesha2_msg_processor_ops_t));
+ if(NULL == msg_proc_impl->msg_processor.ops)
+ {
+ sandesha2_ack_msg_processor_free((sandesha2_msg_processor_t*)
+ msg_proc_impl, env);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ msg_proc_impl->msg_processor.ops->process_in_msg =
+ sandesha2_ack_msg_processor_process_in_msg;
+ msg_proc_impl->msg_processor.ops->process_out_msg =
+ sandesha2_ack_msg_processor_process_out_msg;
+ msg_proc_impl->msg_processor.ops->free = sandesha2_ack_msg_processor_free;
+
+ return &(msg_proc_impl->msg_processor);
+}
+
+
+axis2_status_t AXIS2_CALL
+sandesha2_ack_msg_processor_free (sandesha2_msg_processor_t *msg_processor,
+ const axis2_env_t *env)
+{
+ sandesha2_ack_msg_processor_impl_t *msg_proc_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ msg_proc_impl = SANDESHA2_INTF_TO_IMPL(msg_processor);
+
+ if(NULL != msg_processor->ops)
+ AXIS2_FREE(env->allocator, msg_processor->ops);
+
+ AXIS2_FREE(env->allocator, SANDESHA2_INTF_TO_IMPL(msg_processor));
+ return AXIS2_SUCCESS;
+}
+
+
+axis2_status_t AXIS2_CALL
+sandesha2_ack_msg_processor_process_in_msg (
+ sandesha2_msg_processor_t *msg_processor,
+ const axis2_env_t *env,
+ sandesha2_msg_ctx_t *rm_msg_ctx)
+{
+ sandesha2_seq_ack_t *seq_ack = NULL;
+ axis2_msg_ctx_t *msg_ctx = NULL;
+ axis2_conf_ctx_t *conf_ctx = NULL;
+ sandesha2_storage_mgr_t *storage_mgr = NULL;
+ sandesha2_sender_mgr_t *retrans_mgr = NULL;
+ sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
+ axis2_array_list_t *ack_range_list = NULL;
+ axis2_array_list_t *nack_list = NULL;
+ axis2_char_t *out_seq_id = NULL;
+ sandesha2_fault_mgr_t *fault_mgr = NULL;
+ sandesha2_msg_ctx_t *fault_msg_ctx = NULL;
+ axis2_char_t *int_seq_id = NULL;
+ sandesha2_seq_property_bean_t *int_seq_bean = NULL;
+ axis2_char_t *internal_seq_id = NULL;
+ axis2_property_t *property = NULL;
+ sandesha2_sender_bean_t *input_bean = NULL;
+ axis2_array_list_t *retrans_list = NULL;
+ axis2_array_list_t *acked_list = NULL;
+ int i = 0;
+ long no_of_msgs_acked = 0;
+ sandesha2_seq_property_bean_t *no_of_msgs_acked_bean = NULL;
+ axis2_char_t str_long[32];
+ sandesha2_seq_property_bean_t *completed_bean = NULL;
+ axis2_char_t *str_list = NULL;
+ axis2_char_t *last_out_msg_no_str = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, AXIS2_FAILURE);
+
+ seq_ack = (sandesha2_seq_ack_t*)SANDESHA2_MSG_CTX_GET_MSG_PART(rm_msg_ctx,
+ env, SANDESHA2_MSG_PART_SEQ_ACKNOWLEDGEMENT);
+ if(NULL == seq_ack)
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] Sequence"
+ " acknowledgement part is null");
+ AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_REQD_MSG_PART_MISSING,
+ AXIS2_FAILURE);
+ return AXIS2_FAILURE;
+ }
+ msg_ctx = SANDESHA2_MSG_CTX_GET_MSG_CTX(rm_msg_ctx, env);
+ conf_ctx = AXIS2_MSG_CTX_GET_CONF_CTX(msg_ctx, env);
+
+ storage_mgr = sandesha2_utils_get_storage_mgr(env, conf_ctx,
+ AXIS2_CONF_CTX_GET_CONF(conf_ctx, env));
+ SANDESHA2_SEQ_ACK_SET_MUST_UNDERSTAND(seq_ack, env, AXIS2_FALSE);
+ SANDESHA2_MSG_CTX_ADD_SOAP_ENVELOPE(rm_msg_ctx, env);
+
+ retrans_mgr = SANDESHA2_STORAGE_MGR_GET_RETRANS_MGR(storage_mgr, env);
+ seq_prop_mgr = SANDESHA2_STORAGE_MGR_GET_SEQ_PROPERTY_MGR(storage_mgr, env);
+
+ ack_range_list = SANDESHA2_SEQ_ACK_GET_ACK_RANGE_LIST(seq_ack, env);
+ nack_list = SANDESHA2_SEQ_ACK_GET_NACK_LIST(seq_ack, env);
+ out_seq_id = SANDESHA2_IDENTIFIER_GET_IDENTIFIER(
+ SANDESHA2_SEQ_ACK_GET_IDENTIFIER(seq_ack, env), env);
+ if(NULL == out_seq_id || 0 == AXIS2_STRLEN(out_seq_id))
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] OutSequenceId is"
+ " null");
+ AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NULL_SEQ, AXIS2_FAILURE);
+ return AXIS2_FAILURE;
+ }
+ fault_mgr = sandesha2_fault_mgr_create(env);
+ fault_msg_ctx = SANDESHA2_FAULT_MGR_CHECK_FOR_UNKNOWN_SEQ(fault_mgr, env,
+ rm_msg_ctx, out_seq_id, storage_mgr);
+ if(NULL != fault_msg_ctx)
+ {
+ axis2_engine_t *engine = NULL;
+ engine = axis2_engine_create(env, conf_ctx);
+ AXIS2_ENGINE_SEND_FAULT(engine, env, SANDESHA2_MSG_CTX_GET_MSG_CTX(
+ fault_msg_ctx, env));
+ AXIS2_MSG_CTX_PAUSE(msg_ctx, env);
+ }
+ fault_msg_ctx = SANDESHA2_FAULT_MGR_CHECK_FOR_INVALID_ACK(fault_mgr, env,
+ rm_msg_ctx, storage_mgr);
+ if(NULL != fault_msg_ctx)
+ {
+ axis2_engine_t *engine = NULL;
+ engine = axis2_engine_create(env, conf_ctx);
+ AXIS2_ENGINE_SEND_FAULT(engine, env, SANDESHA2_MSG_CTX_GET_MSG_CTX(
+ fault_msg_ctx, env));
+ AXIS2_MSG_CTX_PAUSE(msg_ctx, env);
+ }
+ int_seq_id = sandesha2_utils_get_seq_property(env, out_seq_id,
+ SANDESHA2_SEQ_PROP_INTERNAL_SEQ_ID, storage_mgr);
+ sandesha2_seq_manager_update_last_activated_time(env, int_seq_id,
+ storage_mgr);
+ int_seq_bean = SANDESHA2_SEQ_PROPERTY_MGR_RETRIEVE(seq_prop_mgr, env,
+ out_seq_id, SANDESHA2_SEQ_PROP_INTERNAL_SEQ_ID);
+ if(NULL == int_seq_bean || NULL == SANDESHA2_SEQ_PROPERTY_BEAN_GET_VALUE(
+ int_seq_bean, env))
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] TempSequenceId "
+ "is not set correctly");
+ return AXIS2_FAILURE;
+ }
+ internal_seq_id = SANDESHA2_SEQ_PROPERTY_BEAN_GET_VALUE(int_seq_bean, env);
+ property = axis2_property_create(env);
+ AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_REQUEST);
+ AXIS2_PROPERTY_SET_VALUE(property, env, AXIS2_STRDUP(SANDESHA2_VALUE_TRUE,
+ env));
+ AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, SANDESHA2_ACK_PROCSSED, property,
+ AXIS2_FALSE);
+
+ input_bean = sandesha2_sender_bean_create(env);
+ SANDESHA2_SENDER_BEAN_SET_SEND(input_bean, env, AXIS2_TRUE);
+ SANDESHA2_SENDER_BEAN_SET_RESEND(input_bean, env, AXIS2_TRUE);
+ retrans_list = SANDESHA2_SENDER_MGR_FIND_BY_SENDER_BEAN(retrans_mgr, env,
+ input_bean);
+
+ for(i = 0; i < AXIS2_ARRAY_LIST_SIZE(ack_range_list, env); i++)
+ {
+ sandesha2_ack_range_t *ack_range = NULL;
+ long lower = -1;
+ long upper = -1;
+ int j = 0;
+
+ ack_range = AXIS2_ARRAY_LIST_GET(ack_range_list, env, i);
+ lower = SANDESHA2_ACK_RANGE_GET_LOWER_VALUE(ack_range, env);
+ upper = SANDESHA2_ACK_RANGE_GET_UPPER_VALUE(ack_range, env);
+ for(j = lower; j < upper; j++)
+ {
+ sandesha2_sender_bean_t *retrans_bean = NULL;
+ long *add_no = NULL;
+
+ retrans_bean = sandesha2_ack_msg_processor_get_retrans_entry(
+ msg_processor, env, retrans_list, j);
+ if(NULL != retrans_bean)
+ {
+ SANDESHA2_SENDER_MGR_REMOVE(retrans_mgr, env,
+ SANDESHA2_SENDER_BEAN_GET_MSG_ID(retrans_bean, env));
+ SANDESHA2_STORAGE_MGR_REMOVE_MSG_CTX(storage_mgr, env,
+ SANDESHA2_SENDER_BEAN_GET_MSG_CONTEXT_REF_KEY(
+ retrans_bean, env));
+ }
+ add_no = AXIS2_MALLOC(env->allocator, sizeof(long));
+ *add_no = (long)j;
+ AXIS2_ARRAY_LIST_ADD(acked_list, env, add_no);
+ }
+ }
+ for(i = 0; i < AXIS2_ARRAY_LIST_SIZE(nack_list, env); i++)
+ {
+ sandesha2_nack_t *nack = NULL;
+ nack = AXIS2_ARRAY_LIST_GET(nack_list, env, i);
+ /* TODO processing nacks */
+ }
+ no_of_msgs_acked = sandesha2_ack_msg_processor_get_no_of_msgs_acked(
+ msg_processor, env, ack_range_list);
+ no_of_msgs_acked_bean = SANDESHA2_SEQ_PROPERTY_MGR_RETRIEVE(seq_prop_mgr,
+ env, out_seq_id,
+ SANDESHA2_SEQ_PROP_NO_OF_OUTGOING_MSGS_ACKED);
+ sprintf(str_long, "%ld", no_of_msgs_acked);
+ if(NULL == no_of_msgs_acked_bean)
+ {
+ no_of_msgs_acked_bean = sandesha2_seq_property_bean_create(env);
+ SANDESHA2_SEQ_PROPERTY_BEAN_SET_NAME(no_of_msgs_acked_bean, env,
+ SANDESHA2_SEQ_PROP_NO_OF_OUTGOING_MSGS_ACKED);
+ SANDESHA2_SEQ_PROPERTY_BEAN_SET_SEQ_ID(no_of_msgs_acked_bean, env,
+ out_seq_id);
+ SANDESHA2_SEQ_PROPERTY_BEAN_SET_VALUE(no_of_msgs_acked_bean, env,
+ str_long);
+ SANDESHA2_SEQ_PROPERY_MGR_INSERT(seq_prop_mgr, env,
+ no_of_msgs_acked_bean);
+ }
+ else
+ {
+ SANDESHA2_SEQ_PROPERTY_BEAN_SET_VALUE(no_of_msgs_acked_bean, env,
+ str_long);
+ SANDESHA2_SEQ_PROPERY_MGR_UPDATE(seq_prop_mgr, env,
+ no_of_msgs_acked_bean);
+ }
+ completed_bean = SANDESHA2_SEQ_PROPERTY_MGR_RETRIEVE(seq_prop_mgr,
+ env, int_seq_id,
+ SANDESHA2_SEQ_PROP_CLIENT_COMPLETED_MESSAGES);
+ if(NULL == completed_bean)
+ {
+ completed_bean = sandesha2_seq_property_bean_create(env);
+ SANDESHA2_SEQ_PROPERTY_BEAN_SET_SEQ_ID(completed_bean, env, int_seq_id);
+ SANDESHA2_SEQ_PROPERTY_BEAN_SET_NAME(completed_bean, env,
+ SANDESHA2_SEQ_PROP_CLIENT_COMPLETED_MESSAGES);
+ SANDESHA2_SEQ_PROPERY_MGR_INSERT(seq_prop_mgr, env, completed_bean);
+ }
+ str_list = sandesha2_utils_array_list_to_string(env, acked_list,
+ SANDESHA2_ARRAY_LIST_LONG);
+ SANDESHA2_SEQ_PROPERTY_BEAN_SET_VALUE(completed_bean, env, str_list);
+ SANDESHA2_SEQ_PROPERY_MGR_UPDATE(seq_prop_mgr, env, completed_bean);
+
+ last_out_msg_no_str = sandesha2_utils_get_seq_property(env, int_seq_id,
+ SANDESHA2_SEQ_PROP_LAST_OUT_MESSAGE_NO, storage_mgr);
+ if(NULL != last_out_msg_no_str)
+ {
+ long highest_out_msg_no = 0;
+ highest_out_msg_no = atol(last_out_msg_no_str);
+ if(highest_out_msg_no > 0)
+ {
+ axis2_bool_t completed = AXIS2_FALSE;
+ completed = sandesha2_ack_mgr_verify_seq_completion(env,
+ ack_range_list, highest_out_msg_no);
+ if(AXIS2_TRUE == completed)
+ sandesha2_terminate_mgr_add_terminate_seq_msg(env, rm_msg_ctx,
+ out_seq_id, int_seq_id, storage_mgr);
+ }
+ }
+ SANDESHA2_MSG_CTX_PAUSE(rm_msg_ctx, env);
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+sandesha2_ack_msg_processor_process_out_msg(
+ sandesha2_msg_processor_t *msg_processor,
+ const axis2_env_t *env,
+ sandesha2_msg_ctx_t *rm_msg_ctx)
+{
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, AXIS2_FAILURE);
+
+ return AXIS2_SUCCESS;
+}
+
+
+sandesha2_sender_bean_t* AXIS2_CALL
+sandesha2_ack_msg_processor_get_retrans_entry(
+ sandesha2_msg_processor_t *msg_processor,
+ const axis2_env_t *env,
+ axis2_array_list_t *list,
+ long msg_no)
+{
+ int i = 0;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ AXIS2_PARAM_CHECK(env->error, list, NULL);
+
+ for(i = 0; i < AXIS2_ARRAY_LIST_SIZE(list, env); i++)
+ {
+ sandesha2_sender_bean_t *bean = NULL;
+ bean = AXIS2_ARRAY_LIST_GET(list, env, i);
+ if(SANDESHA2_SENDER_BEAN_GET_MSG_NO(bean, env) == msg_no)
+ return bean;
+ }
+ return NULL;
+}
+
+long AXIS2_CALL
+sandesha2_ack_msg_processor_get_no_of_msgs_acked(
+ sandesha2_msg_processor_t *msg_processor,
+ const axis2_env_t *env,
+ axis2_array_list_t *list)
+{
+ long no_of_msgs = 0;
+ int i = 0;
+
+ AXIS2_ENV_CHECK(env, -1);
+ AXIS2_PARAM_CHECK(env->error, list, -1);
+
+ for(i = 0; i < AXIS2_ARRAY_LIST_SIZE(list, env); i++)
+ {
+ sandesha2_ack_range_t *ack_range = NULL;
+ long upper = 0;
+ long lower = 0;
+ long diff = 0;
+
+ ack_range = AXIS2_ARRAY_LIST_GET(list, env, i);
+ lower = SANDESHA2_ACK_RANGE_GET_LOWER_VALUE(ack_range, env);
+ upper = SANDESHA2_ACK_RANGE_GET_UPPER_VALUE(ack_range, env);
+
+ diff = upper - lower;
+ if(diff > 0)
+ no_of_msgs += diff;
+ }
+ return no_of_msgs;
+}
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=422605&r1=422604&r2=422605&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c Sun Jul 16 19:37:25 2006
@@ -49,8 +49,8 @@
sandesha2_msg_processor_t msg_processor;
};
-#define SANDESHA2_INTF_TO_IMPL(identifier) \
- ((sandesha2_app_msg_processor_impl_t *)(identifier))
+#define SANDESHA2_INTF_TO_IMPL(msg_proc) \
+ ((sandesha2_app_msg_processor_impl_t *)(msg_proc))
/***************************** Function headers *******************************/
axis2_status_t AXIS2_CALL
@@ -121,12 +121,10 @@
/***************************** End of function headers ************************/
AXIS2_EXTERN sandesha2_msg_processor_t* AXIS2_CALL
-sandesha2_app_msg_processor_create(const axis2_env_t *env,
- sandesha2_msg_ctx_t *rm_msg_ctx)
+sandesha2_app_msg_processor_create(const axis2_env_t *env)
{
sandesha2_app_msg_processor_impl_t *msg_proc_impl = NULL;
AXIS2_ENV_CHECK(env, NULL);
- AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, NULL);
msg_proc_impl = (sandesha2_app_msg_processor_impl_t *)AXIS2_MALLOC
(env->allocator,
@@ -456,7 +454,7 @@
axis2_char_t *str_seq_list = NULL;
AXIS2_ARRAY_LIST_ADD(incoming_seq_list, env, str_seq_id);
str_seq_list = sandesha2_utils_array_list_to_string(env,
- incoming_seq_list);
+ incoming_seq_list, SANDESHA2_ARRAY_LIST_STRING);
/* saving the property. */
SANDESHA2_SEQ_PROPERTY_BEAN_SET_VALUE(incoming_seq_list_bean,
env, str_seq_list);
Added: webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c?rev=422605&view=auto
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c (added)
+++ webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c Sun Jul 16 19:37:25 2006
@@ -0,0 +1,377 @@
+/*
+ * 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_create_seq_msg_processor.h>
+#include <sandesha2_seq_property_mgr.h>
+#include <sandesha2_seq_property_bean.h>
+#include <sandesha2_storage_mgr.h>
+#include <sandesha2_fault_mgr.h>
+#include <sandesha2/sandesha2_constants.h>
+#include <sandesha2/sandesha2_utils.h>
+#include <sandesha2/sandesha2_msg_ctx.h>
+#include <axis2_msg_ctx.h>
+#include <axis2_string.h>
+#include <axis2_engine.h>
+#include <axiom_soap_const.h>
+#include <stdio.h>
+#include <sandesha2_storage_mgr.h>
+#include <axis2_msg_ctx.h>
+#include <sandesha2/sandesha2_create_seq.h>
+#include <axis2_conf_ctx.h>
+#include <axis2_core_utils.h>
+#include <sandesha2/sandesha2_create_seq_res.h>
+#include <sandesha2/sandesha2_seq_offer.h>
+#include <sandesha2/sandesha2_accept.h>
+#include <sandesha2/sandesha2_address.h>
+#include <sandesha2/sandesha2_acks_to.h>
+#include <sandesha2/sandesha2_create_seq_res.h>
+#include <axis2_uuid_gen.h>
+#include <sandesha2_create_seq_bean.h>
+#include <sandesha2_create_seq_mgr.h>
+#include <axis2_endpoint_ref.h>
+#include <axis2_op_ctx.h>
+#include <sandesha2/sandesha2_spec_specific_consts.h>
+
+/**
+ * @brief Create Sequence Message Processor struct impl
+ * Sandesha2 Create Sequence Msg Processor
+ */
+typedef struct sandesha2_create_seq_msg_processor_impl
+ sandesha2_create_seq_msg_processor_impl_t;
+
+struct sandesha2_create_seq_msg_processor_impl
+{
+ sandesha2_msg_processor_t msg_processor;
+};
+
+#define SANDESHA2_INTF_TO_IMPL(msg_proc) \
+ ((sandesha2_create_seq_msg_processor_impl_t *)(msg_proc))
+
+/***************************** Function headers *******************************/
+axis2_status_t AXIS2_CALL
+sandesha2_create_seq_msg_processor_process_in_msg (
+ sandesha2_msg_processor_t *msg_processor,
+ const axis2_env_t *env,
+ sandesha2_msg_ctx_t *rm_msg_ctx);
+
+axis2_status_t AXIS2_CALL
+sandesha2_create_seq_msg_processor_process_out_msg(
+ sandesha2_msg_processor_t *msg_processor,
+ const axis2_env_t *env,
+ sandesha2_msg_ctx_t *rm_msg_ctx);
+
+axis2_bool_t AXIS2_CALL
+sandesha2_create_seq_msg_processor_offer_accepted(
+ sandesha2_msg_processor_t *msg_processor,
+ const axis2_env_t *env,
+ axis2_char_t *seq_id,
+ sandesha2_msg_ctx_t *rm_msg_ctx,
+ sandesha2_storage_mgr_t *storage_mgr);
+
+axis2_status_t AXIS2_CALL
+sandesha2_create_seq_msg_processor_free (sandesha2_msg_processor_t *element,
+ const axis2_env_t *env);
+
+/***************************** End of function headers ************************/
+
+AXIS2_EXTERN sandesha2_msg_processor_t* AXIS2_CALL
+sandesha2_create_seq_msg_processor_create(const axis2_env_t *env)
+{
+ sandesha2_create_seq_msg_processor_impl_t *msg_proc_impl = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+
+ msg_proc_impl = (sandesha2_create_seq_msg_processor_impl_t *)AXIS2_MALLOC
+ (env->allocator,
+ sizeof(sandesha2_create_seq_msg_processor_impl_t));
+
+ if(NULL == msg_proc_impl)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ msg_proc_impl->msg_processor.ops = AXIS2_MALLOC(env->allocator,
+ sizeof(sandesha2_msg_processor_ops_t));
+ if(NULL == msg_proc_impl->msg_processor.ops)
+ {
+ sandesha2_create_seq_msg_processor_free((sandesha2_msg_processor_t*)
+ msg_proc_impl, env);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ msg_proc_impl->msg_processor.ops->process_in_msg =
+ sandesha2_create_seq_msg_processor_process_in_msg;
+ msg_proc_impl->msg_processor.ops->process_out_msg =
+ sandesha2_create_seq_msg_processor_process_out_msg;
+ msg_proc_impl->msg_processor.ops->free = sandesha2_create_seq_msg_processor_free;
+
+ return &(msg_proc_impl->msg_processor);
+}
+
+
+axis2_status_t AXIS2_CALL
+sandesha2_create_seq_msg_processor_free (sandesha2_msg_processor_t *msg_processor,
+ const axis2_env_t *env)
+{
+ sandesha2_create_seq_msg_processor_impl_t *msg_proc_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ msg_proc_impl = SANDESHA2_INTF_TO_IMPL(msg_processor);
+
+ if(NULL != msg_processor->ops)
+ AXIS2_FREE(env->allocator, msg_processor->ops);
+
+ AXIS2_FREE(env->allocator, SANDESHA2_INTF_TO_IMPL(msg_processor));
+ return AXIS2_SUCCESS;
+}
+
+
+axis2_status_t AXIS2_CALL
+sandesha2_create_seq_msg_processor_process_in_msg (
+ sandesha2_msg_processor_t *msg_processor,
+ const axis2_env_t *env,
+ sandesha2_msg_ctx_t *rm_msg_ctx)
+{
+ axis2_msg_ctx_t *msg_ctx = NULL;
+ sandesha2_create_seq_t *create_seq_part = NULL;
+ axis2_conf_ctx_t *conf_ctx = NULL;
+ sandesha2_storage_mgr_t *storage_mgr = NULL;
+ sandesha2_fault_mgr_t *fault_mgr = NULL;
+ sandesha2_msg_ctx_t *fault_rm_msg_ctx = NULL;
+ axis2_msg_ctx_t *out_msg_ctx = NULL;
+ sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
+ axis2_property_t *property = NULL;
+ axis2_char_t *new_seq_id = NULL;
+ sandesha2_msg_ctx_t *create_seq_res_msg = NULL;
+ sandesha2_create_seq_res_t *create_seq_res_part = NULL;
+ sandesha2_seq_offer_t *seq_offer = NULL;
+ axis2_endpoint_ref_t *acks_to = NULL;
+ sandesha2_seq_property_bean_t *acks_to_bean = NULL;
+ sandesha2_seq_property_bean_t *to_bean = NULL;
+ axis2_engine_t *engine = NULL;
+ axis2_char_t *addr_ns_uri = NULL;
+ axis2_char_t *anon_uri = NULL;
+ axis2_endpoint_ref_t *to_epr = NULL;
+ axis2_ctx_t *ctx = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, AXIS2_FAILURE);
+
+ msg_ctx = SANDESHA2_MSG_CTX_GET_MSG_CTX(rm_msg_ctx, env);
+ create_seq_part = (sandesha2_create_seq_t*)SANDESHA2_MSG_CTX_GET_MSG_PART(
+ rm_msg_ctx, env, SANDESHA2_MSG_PART_CREATE_SEQ);
+ if(NULL == create_seq_part)
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2]create_seq_part"
+ " is NULL");
+ AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_REQD_MSG_PART_MISSING,
+ AXIS2_FAILURE);
+ return AXIS2_FAILURE;
+ }
+ conf_ctx = AXIS2_MSG_CTX_GET_CONF_CTX(msg_ctx, env);
+ storage_mgr = sandesha2_utils_get_storage_mgr(env, conf_ctx,
+ AXIS2_CONF_CTX_GET_CONF(conf_ctx, env));
+
+ fault_mgr = sandesha2_fault_mgr_create(env);
+ fault_rm_msg_ctx = SANDESHA2_FAULT_MGR_CHECK_FOR_CREATE_SEQ_REFUSED(
+ fault_mgr, env, msg_ctx, storage_mgr);
+ if(NULL != fault_rm_msg_ctx)
+ {
+ axis2_engine_t *engine = NULL;
+
+ engine = axis2_engine_create(env, conf_ctx);
+ AXIS2_ENGINE_SEND_FAULT(engine, env, SANDESHA2_MSG_CTX_GET_MSG_CTX(
+ fault_rm_msg_ctx, env));
+ AXIS2_MSG_CTX_PAUSE(msg_ctx, env);
+ return AXIS2_SUCCESS;
+ }
+ out_msg_ctx = axis2_core_utils_create_out_msg_ctx(env, msg_ctx);
+ seq_prop_mgr = SANDESHA2_STORAGE_MGR_GET_SEQ_PROPERTY_BEAN_MGR(storage_mgr,
+ env);
+ new_seq_id = sadesha2_seq_manager_setup_new_seq(env, rm_msg_ctx,
+ storage_mgr);
+ create_seq_res_msg = sandesha2_msg_creator_create_create_seq_res_msg(env,
+ rm_msg_ctx, out_msg_ctx, new_seq_id, storage_mgr);
+ AXIS2_MSG_CTX_SET_FLOW(out_msg_ctx, env, AXIS2_OUT_FLOW);
+
+ property = axis2_property_create(env);
+ AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_REQUEST);
+ AXIS2_PROPERTY_SET_VALUE(property, env, AXIS2_STRDUP(SANDESHA2_VALUE_TRUE,
+ env));
+ AXIS2_MSG_CTX_SET_PROPERTY(out_msg_ctx, env,
+ SANDESHA2_APPLICATION_PROCESSING_DONE, property,
+ AXIS2_FALSE);
+
+ create_seq_res_part = (sandesha2_create_seq_res_t*)
+ SANDESHA2_MSG_CTX_GET_MSG_PART(create_seq_res_msg,
+ env, SANDESHA2_MSG_PART_CREATE_SEQ_RESPONSE);
+ seq_offer = SANDESHA2_CREATE_SEQ_GET_SEQ_OFFER(create_seq_part,
+ env);
+
+ if(NULL != seq_offer)
+ {
+ sandesha2_accept_t *accept = NULL;
+ axis2_char_t *offer_seq_id = NULL;
+ axis2_bool_t offer_accepted = AXIS2_FALSE;
+
+
+ accept = SANDESHA2_CREATE_SEQ_RES_GET_ACCEPT(create_seq_res_part, env);
+ if(NULL == accept)
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2]Accept part "
+ "has not genereated for a message with offer");
+ AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_REQD_MSG_PART_MISSING,
+ AXIS2_FAILURE);
+ return AXIS2_FAILURE;
+ }
+ offer_seq_id = SANDESHA2_IDENTIFIER_GET_IDENTIFIER(
+ SANDESHA2_SEQ_OFFER_GET_IDENTIFIER(seq_offer, env), env);
+ offer_accepted = sandesha2_create_seq_msg_processor_offer_accepted(
+ msg_processor, env, offer_seq_id, rm_msg_ctx,
+ storage_mgr);
+ if(AXIS2_TRUE == offer_accepted)
+ {
+ sandesha2_create_seq_bean_t *create_seq_bean = NULL;
+ axis2_char_t *int_seq_id = NULL;
+ sandesha2_create_seq_mgr_t *create_seq_mgr = NULL;
+ sandesha2_seq_property_bean_t *out_seq_bean = NULL;
+
+ create_seq_bean = sandesha2_create_seq_bean_create(env);
+ SANDESHA2_CREATE_SEQ_BEAN_SET_SEQ_ID(create_seq_bean, env,
+ offer_seq_id);
+ int_seq_id = sandesha2_utils_get_outgoing_internal_seq_id(env,
+ new_seq_id);
+ SANDESHA2_CREATE_SEQ_BEAN_SET_INTERNAL_SEQ_ID(create_seq_bean, env,
+ int_seq_id);
+ SANDESHA2_CREATE_SEQ_BEAN_SET_CREATE_SEQ_MSG_ID(create_seq_bean, env,
+ axis2_uuid_gen(env));
+ create_seq_mgr = SANDESHA2_STORAGE_MGR_GET_CREATE_SEQ_MGR(
+ storage_mgr, env);
+ SANDESHA2_CREATE_SEQ_MGR_INSERT(create_seq_mgr, env, create_seq_bean);
+
+ out_seq_bean = sandesha2_seq_property_bean_create(env);
+ SANDESHA2_SEQ_PROPERTY_BEAN_SET_NAME(out_seq_bean, env,
+ SANDESHA2_SEQ_PROP_OUT_SEQ_ID);
+ SANDESHA2_SEQ_PROPERTY_BEAN_SET_SEQ_ID(out_seq_bean, env,
+ offer_seq_id);
+ SANDESHA2_SEQ_PROPERTY_BEAN_SET_VALUE(out_seq_bean, env,
+ int_seq_id);
+ SANDESHA2_SEQ_PROPERTY_BEAN_MANAGER_INSERT(seq_prop_mgr, env,
+ out_seq_bean);
+ }
+ else
+ {
+ SANDESHA2_CREATE_SEQ_SET_ACCEPT(create_seq_res_part, env, NULL);
+ SANDESHA2_MSG_CTX_ADD_SOAP_ENVELOPE(create_seq_res_msg, env);
+ }
+ }
+ acks_to = SANDESHA2_ADDRESS_GET_EPR(SANDESHA2_ACKS_TO_GET_ADDRESS(
+ SANDESHA2_CREATE_SEQ_GET_ACKS_TO(create_seq_part, env),
+ env), env);
+ if(NULL == acks_to || NULL == AXIS2_ENDPOINT_REF_GET_ADDRESS(acks_to,
+ env))
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2]Acks to is null"
+ " in create_seq message");
+ AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_INVALID_EPR,
+ AXIS2_FAILURE);
+ return AXIS2_FAILURE;
+ }
+ acks_to_bean = sandesha2_seq_property_bean_create_with_data(env,
+ new_seq_id, SANDESHA2_SEQ_PROP_ACKS_TO_EPR,
+ AXIS2_ENDPOINT_REF_GET_ADDRESS(acks_to, env));
+ SANDESHA2_SEQ_PROPERTY_BEAN_MGR_INSERT(seq_prop_mgr, env, acks_to_bean);
+ AXIS2_MSG_CTX_SET_RESPONSE_WRITTEN(out_msg_ctx, env, AXIS2_TRUE);
+ sandesha2_seq_mgr_update_last_activated_time(env, new_seq_id,
+ storage_mgr);
+ engine = axis2_engine_create(env, conf_ctx);
+ AXIS2_ENGINE_SEND(engine, env, out_msg_ctx);
+ to_bean = SANDESHA2_SEQ_PROPERTY_MGR_RETRIEVE(seq_prop_mgr, env,
+ new_seq_id, SANDESHA2_SEQ_PROP_TO_EPR);
+ if(NULL == to_bean)
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2]wsa:To is not set");
+ return AXIS2_FAILURE;
+ }
+ to_epr = axis2_endpoint_ref_create(env,
+ SANDESHA2_SEQ_PROPERTY_BEAN_GET_VALUE(to_bean, env));
+ addr_ns_uri = sandesha2_utils_get_seq_property(env, new_seq_id,
+ SANDESHA2_SEQ_PROP_ADDRESSING_NAMESPACE_VALUE,
+ storage_mgr);
+ anon_uri = sandesha2_spec_specific_consts_get_anon_uri(env, addr_ns_uri);
+
+ ctx = AXIS2_OP_CTX_GET_BASE(AXIS2_MSG_CTX_GET_OP_CTX(msg_ctx, env), env);
+ property = axis2_property_create(env);
+ AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_REQUEST);
+ if(0 == AXIS2_STRCMP(anon_uri, AXIS2_ENDPOINT_REF_GET_ADDRESS(to_epr,
+ env)))
+ AXIS2_PROPERTY_SET_VALUE(property, env, "TRUE");
+ else
+ AXIS2_PROPERTY_SET_VALUE(property, env, "FALSE");
+ AXIS2_CTX_SET_PROPERTY(ctx, env, AXIS2_RESPONSE_WRITTEN, property,
+ AXIS2_FALSE);
+
+ SANDESHA2_MSG_CTX_PAUSE(rm_msg_ctx, env);
+ return AXIS2_SUCCESS;
+
+}
+
+axis2_status_t AXIS2_CALL
+sandesha2_create_seq_msg_processor_process_out_msg(
+ sandesha2_msg_processor_t *msg_processor,
+ const axis2_env_t *env,
+ sandesha2_msg_ctx_t *rm_msg_ctx)
+{
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, AXIS2_FAILURE);
+
+ /* TODO
+ * adding the SANDESHA_LISTENER
+ */
+ return AXIS2_SUCCESS;
+}
+
+
+axis2_bool_t AXIS2_CALL
+sandesha2_create_seq_msg_processor_offer_accepted(
+ sandesha2_msg_processor_t *msg_processor,
+ const axis2_env_t *env,
+ axis2_char_t *seq_id,
+ sandesha2_msg_ctx_t *rm_msg_ctx,
+ sandesha2_storage_mgr_t *storage_mgr)
+{
+ sandesha2_create_seq_mgr_t *create_seq_mgr = NULL;
+ sandesha2_create_seq_bean_t *find_bean = NULL;
+ axis2_array_list_t *list = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+ AXIS2_PARAM_CHECK(env->error, seq_id, AXIS2_FALSE);
+ AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, AXIS2_FALSE);
+ AXIS2_PARAM_CHECK(env->error, storage_mgr, AXIS2_FALSE);
+
+ create_seq_mgr = SANDESHA2_STORAGE_MGR_GET_CREATE_SEQ_MGR(storage_mgr, env);
+ find_bean = sandesha2_create_seq_bean_create_with_data(env, NULL, NULL,
+ seq_id);
+ list = SANDESHA2_CREATE_SEQ_MGR_FIND(create_seq_mgr, env, find_bean);
+ /* Single char offerings are not accepted */
+ if(1 >= AXIS2_STRLEN(seq_id))
+ return AXIS2_FALSE;
+
+ if(NULL != list && 0 < AXIS2_ARRAY_LIST_SIZE(list, env))
+ return AXIS2_FALSE;
+
+ return AXIS2_TRUE;
+}
Modified: webservices/sandesha/trunk/c/src/util/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/Makefile.am?rev=422605&r1=422604&r2=422605&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/Makefile.am (original)
+++ webservices/sandesha/trunk/c/src/util/Makefile.am Sun Jul 16 19:37:25 2006
@@ -5,7 +5,7 @@
utils.c \
spec_specific_consts.c\
fault_data.c\
- fault_manager.c\
+ fault_mgr.c\
ack_mgr.c
INCLUDES = -I$(top_builddir)/include \
Added: 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=422605&view=auto
==============================================================================
--- webservices/sandesha/trunk/c/src/util/property_bean.c (added)
+++ webservices/sandesha/trunk/c/src/util/property_bean.c Sun Jul 16 19:37:25 2006
@@ -0,0 +1,491 @@
+/*
+ * 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_property_bean.h>
+#include <sandesha2/sandesha2_constants.h>
+#include <stdio.h>
+#include <axis2_string.h>
+
+
+/**
+ * @brief Property Bean struct impl
+ * Sandesha2 Property Bean
+ */
+typedef struct sandesha2_property_bean_impl sandesha2_property_bean_impl_t;
+
+struct sandesha2_property_bean_impl
+{
+ sandesha2_property_bean_t bean;
+ long inactive_timeout_interval;
+ long ack_interval;
+ long retrans_interval;
+ axis2_bool_t is_exp_backoff;
+ axis2_char_t *in_mem_storage_manager;
+ axis2_char_t *permanent_storage_manager;
+ axis2_bool_t is_in_order;
+ axis2_array_list_t *msg_types_to_drop;
+ int max_retrans_count;
+};
+
+#define SANDESHA2_INTF_TO_IMPL(bean) \
+ ((sandesha2_property_bean_impl_t *)(bean))
+
+/***************************** Function headers *******************************/
+long AXIS2_CALL
+sandesha2_property_bean_get_inactive_timeout_interval
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_inactive_timeout_interval
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, long interval);
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_inactive_timeout_interval_with_units
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, long interval,
+ axis2_char_t *units);
+
+long AXIS2_CALL
+sandesha2_property_bean_get_ack_interval
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_ack_interval
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, long interval);
+
+long AXIS2_CALL
+sandesha2_property_bean_get_retrans_interval
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_retrans_interval
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, long interval);
+
+axis2_bool_t AXIS2_CALL
+sandesha2_property_bean_is_exp_backoff
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_exp_backoff
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, axis2_bool_t exp_backoff);
+
+axis2_char_t* AXIS2_CALL
+sandesha2_property_bean_get_in_mem_storage_manager
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_in_mem_storage_manager
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, axis2_char_t *manager);
+
+axis2_char_t* AXIS2_CALL
+sandesha2_property_bean_get_permanent_storage_manager
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_permanent_storage_manager
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, axis2_char_t *manager);
+
+axis2_bool_t AXIS2_CALL
+sandesha2_property_bean_is_in_order
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_in_order
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, axis2_bool_t in_order);
+
+axis2_array_list_t* AXIS2_CALL
+sandesha2_property_bean_get_msg_types_to_drop
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_msg_types_to_drop
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, axis2_array_list_t *msg_types);
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_add_msg_type_to_drop
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, int msg_type);
+
+int AXIS2_CALL
+sandesha2_property_bean_get_max_retrans_count
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_max_retrans_count
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, int count);
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_free(sandesha2_property_bean_t *bean,
+ const axis2_env_t *env);
+
+/***************************** End of function headers ************************/
+
+AXIS2_EXTERN sandesha2_property_bean_t* AXIS2_CALL
+sandesha2_property_bean_create(const axis2_env_t *env)
+{
+ sandesha2_property_bean_impl_t *property_bean_impl = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+
+ property_bean_impl = (sandesha2_property_bean_impl_t *)AXIS2_MALLOC
+ (env->allocator, sizeof(sandesha2_property_bean_impl_t));
+
+ if(NULL == property_bean_impl)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ property_bean_impl->inactive_timeout_interval = 0;
+ property_bean_impl->ack_interval = 0;
+ property_bean_impl->retrans_interval = 0;
+ property_bean_impl->is_exp_backoff = 0;
+ property_bean_impl->in_mem_storage_manager = NULL;
+ property_bean_impl->permanent_storage_manager= NULL;
+ property_bean_impl->is_in_order = AXIS2_FALSE;
+ property_bean_impl->msg_types_to_drop = NULL;
+ property_bean_impl->max_retrans_count = 0;
+
+ property_bean_impl->bean.ops = AXIS2_MALLOC(env->allocator,
+ sizeof(sandesha2_property_bean_ops_t));
+ if(NULL == property_bean_impl->bean.ops)
+ {
+ sandesha2_property_bean_free((sandesha2_property_bean_t*)
+ property_bean_impl, env);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ property_bean_impl->bean.ops->get_inactive_timeout_interval =
+ sandesha2_property_bean_get_inactive_timeout_interval;
+ property_bean_impl->bean.ops->set_inactive_timeout_interval =
+ sandesha2_property_bean_set_inactive_timeout_interval;
+ property_bean_impl->bean.ops->set_inactive_timeout_interval_with_units =
+ sandesha2_property_bean_set_inactive_timeout_interval_with_units;
+ property_bean_impl->bean.ops->get_ack_interval =
+ sandesha2_property_bean_get_ack_interval;
+ property_bean_impl->bean.ops->set_ack_interval =
+ sandesha2_property_bean_set_ack_interval;
+ property_bean_impl->bean.ops->get_retrans_interval =
+ sandesha2_property_bean_get_retrans_interval;
+ property_bean_impl->bean.ops->set_retrans_interval =
+ sandesha2_property_bean_set_retrans_interval;
+ property_bean_impl->bean.ops->is_exp_backoff =
+ sandesha2_property_bean_is_exp_backoff;
+ property_bean_impl->bean.ops->set_exp_backoff =
+ sandesha2_property_bean_set_exp_backoff;
+ property_bean_impl->bean.ops->get_in_mem_storage_manager =
+ sandesha2_property_bean_get_in_mem_storage_manager;
+ property_bean_impl->bean.ops->set_in_mem_storage_manager =
+ sandesha2_property_bean_set_in_mem_storage_manager;
+ property_bean_impl->bean.ops->get_permanent_storage_manager =
+ sandesha2_property_bean_get_permanent_storage_manager;
+ property_bean_impl->bean.ops->set_permanent_storage_manager =
+ sandesha2_property_bean_set_permanent_storage_manager;
+ property_bean_impl->bean.ops->is_in_order =
+ sandesha2_property_bean_is_in_order;
+ property_bean_impl->bean.ops->set_in_order =
+ sandesha2_property_bean_set_in_order;
+ property_bean_impl->bean.ops->get_msg_types_to_drop =
+ sandesha2_property_bean_get_msg_types_to_drop;
+ property_bean_impl->bean.ops->set_msg_types_to_drop =
+ sandesha2_property_bean_set_msg_types_to_drop;
+ property_bean_impl->bean.ops->add_msg_type_to_drop =
+ sandesha2_property_bean_add_msg_type_to_drop;
+ property_bean_impl->bean.ops->get_max_retrans_count =
+ sandesha2_property_bean_get_max_retrans_count;
+ property_bean_impl->bean.ops->free = sandesha2_property_bean_free;
+
+ return &(property_bean_impl->bean);
+}
+
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_free(sandesha2_property_bean_t *bean, const axis2_env_t *env)
+{
+ sandesha2_property_bean_impl_t *property_bean_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ property_bean_impl = SANDESHA2_INTF_TO_IMPL(bean);
+
+ if(NULL != property_bean_impl->msg_types_to_drop)
+ {
+ int count = AXIS2_ARRAY_LIST_SIZE(property_bean_impl->msg_types_to_drop,
+ env);
+ int i = 0;
+ for(i = 0; i < count; i++)
+ {
+ int *msg_type = AXIS2_ARRAY_LIST_GET(
+ property_bean_impl->msg_types_to_drop, env, i);
+ if(NULL != msg_type)
+ AXIS2_FREE(env->allocator, msg_type);
+ }
+ AXIS2_ARRAY_LIST_FREE(property_bean_impl->msg_types_to_drop, env);
+ }
+ if(NULL != property_bean_impl->in_mem_storage_manager)
+ {
+ AXIS2_FREE(env->allocator, property_bean_impl->in_mem_storage_manager);
+ property_bean_impl->in_mem_storage_manager = NULL;
+ }
+ if(NULL != property_bean_impl->permanent_storage_manager)
+ {
+ AXIS2_FREE(env->allocator, property_bean_impl->permanent_storage_manager);
+ property_bean_impl->permanent_storage_manager = NULL;
+ }
+ if(NULL != bean->ops)
+ {
+ AXIS2_FREE(env->allocator, bean->ops);
+ bean->ops = NULL;
+ }
+ AXIS2_FREE(env->allocator, SANDESHA2_INTF_TO_IMPL(bean));
+ return AXIS2_SUCCESS;
+}
+
+long AXIS2_CALL
+sandesha2_property_bean_get_inactive_timeout_interval
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, -1);
+ return SANDESHA2_INTF_TO_IMPL(bean)->inactive_timeout_interval;
+}
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_inactive_timeout_interval
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, long interval)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ SANDESHA2_INTF_TO_IMPL(bean)->inactive_timeout_interval = interval;
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_inactive_timeout_interval_with_units
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, long interval,
+ axis2_char_t *units)
+{
+ long multiplier = -1;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, units, AXIS2_FAILURE);
+
+ if(0 == AXIS2_STRCMP(units, "seconds"))
+ multiplier = 1000;
+ else if(0 == AXIS2_STRCMP(units, "minutes"))
+ multiplier = 60*1000;
+ else if(0 == AXIS2_STRCMP(units, "hours"))
+ multiplier = 60*60*1000;
+ else if(0 == AXIS2_STRCMP(units, "days"))
+ multiplier = 24*60*60*1000;
+ else
+ return AXIS2_FAILURE;
+
+ return sandesha2_property_bean_set_inactive_timeout_interval(bean, env,
+ multiplier*interval);
+}
+
+long AXIS2_CALL
+sandesha2_property_bean_get_ack_interval
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, -1);
+ return SANDESHA2_INTF_TO_IMPL(bean)->ack_interval;
+}
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_ack_interval
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, long interval)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ SANDESHA2_INTF_TO_IMPL(bean)->ack_interval = interval;
+ return AXIS2_SUCCESS;
+}
+
+long AXIS2_CALL
+sandesha2_property_bean_get_retrans_interval
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, -1);
+ return SANDESHA2_INTF_TO_IMPL(bean)->retrans_interval;
+}
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_retrans_interval
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, long interval)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ SANDESHA2_INTF_TO_IMPL(bean)->retrans_interval = interval;
+ return AXIS2_SUCCESS;
+}
+
+axis2_bool_t AXIS2_CALL
+sandesha2_property_bean_is_exp_backoff
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env)
+
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+ return SANDESHA2_INTF_TO_IMPL(bean)->is_exp_backoff;
+}
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_exp_backoff
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, axis2_bool_t exp_backoff)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ SANDESHA2_INTF_TO_IMPL(bean)->is_exp_backoff = exp_backoff;
+ return AXIS2_SUCCESS;
+}
+
+axis2_char_t* AXIS2_CALL
+sandesha2_property_bean_get_in_mem_storage_manager
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+ return SANDESHA2_INTF_TO_IMPL(bean)->in_mem_storage_manager;
+}
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_in_mem_storage_manager
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, axis2_char_t *manager)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, manager, AXIS2_FAILURE);
+ SANDESHA2_INTF_TO_IMPL(bean)->in_mem_storage_manager = AXIS2_STRDUP(manager,
+ env);
+ return AXIS2_SUCCESS;
+}
+
+axis2_char_t* AXIS2_CALL
+sandesha2_property_bean_get_permanent_storage_manager
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+ return SANDESHA2_INTF_TO_IMPL(bean)->permanent_storage_manager;
+}
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_permanent_storage_manager
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, axis2_char_t *manager)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, manager, AXIS2_FAILURE);
+ SANDESHA2_INTF_TO_IMPL(bean)->permanent_storage_manager = AXIS2_STRDUP(
+ manager, env);
+ return AXIS2_SUCCESS;
+}
+
+axis2_bool_t AXIS2_CALL
+sandesha2_property_bean_is_in_order
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+ return SANDESHA2_INTF_TO_IMPL(bean)->is_in_order;
+}
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_in_order
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, axis2_bool_t in_order)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ SANDESHA2_INTF_TO_IMPL(bean)->is_in_order = in_order;
+ return AXIS2_SUCCESS;
+}
+
+axis2_array_list_t* AXIS2_CALL
+sandesha2_property_bean_get_msg_types_to_drop
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+ return SANDESHA2_INTF_TO_IMPL(bean)->msg_types_to_drop;
+}
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_msg_types_to_drop
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, axis2_array_list_t *msg_types)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, msg_types, AXIS2_FAILURE);
+
+ SANDESHA2_INTF_TO_IMPL(bean)->msg_types_to_drop = msg_types;
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_add_msg_type_to_drop
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, int msg_type)
+{
+ int *_msg_type = NULL;
+ sandesha2_property_bean_impl_t *property_bean_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ property_bean_impl = SANDESHA2_INTF_TO_IMPL(bean);
+ if(NULL == property_bean_impl->msg_types_to_drop)
+ return AXIS2_FAILURE;
+ _msg_type = AXIS2_MALLOC(env->allocator, sizeof(int));
+ AXIS2_ARRAY_LIST_ADD(property_bean_impl->msg_types_to_drop, env, _msg_type);
+ return AXIS2_SUCCESS;
+}
+
+int AXIS2_CALL
+sandesha2_property_bean_get_max_retrans_count
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env)
+{
+ AXIS2_ENV_CHECK(env, -1);
+ return SANDESHA2_INTF_TO_IMPL(bean)->max_retrans_count;
+}
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_max_retrans_count
+ (sandesha2_property_bean_t *bean,
+ const axis2_env_t *env, int count)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ SANDESHA2_INTF_TO_IMPL(bean)->max_retrans_count = count;
+ return AXIS2_SUCCESS;
+}
Modified: webservices/sandesha/trunk/c/src/util/utils.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/utils.c?rev=422605&r1=422604&r2=422605&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/utils.c (original)
+++ webservices/sandesha/trunk/c/src/util/utils.c Sun Jul 16 19:37:25 2006
@@ -26,6 +26,13 @@
#include <axis2_conf.h>
#include <axis2_property.h>
#include <axiom_soap_body.h>
+#include <axis2_options.h>
+#include <axis2_msg_ctx.h>
+#include <axis2_transport_out_desc.h>
+#include <axis2_transport_in_desc.h>
+#include <axis2_qname.h>
+#include <axis2_http_transport.h>
+#include <axis2_addr.h>
AXIS2_EXTERN axis2_status_t AXIS2_CALL
sandesha2_utils_remove_soap_body_part(const axis2_env_t *env,
@@ -226,7 +233,7 @@
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
sandesha2_utils_array_list_to_string(const axis2_env_t *env,
- axis2_array_list_t *list)
+ axis2_array_list_t *list, int type)
{
axis2_char_t *list_string = NULL;
int i = 0;
@@ -237,8 +244,19 @@
list_string = AXIS2_STRDUP("[", env);
for(i = 0; i < AXIS2_ARRY_LIST_SIZE(list, env); i++)
{
- axis2_char_t *element = AXIS2_ARRAY_LIST_GET(list, env, i);
- list_string = axis2_strcat(env, list_string, ",", element, NULL);
+
+ if(SANDESHA2_ARRAY_LIST_STRING == type)
+ {
+ axis2_char_t *element = AXIS2_ARRAY_LIST_GET(list, env, i);
+ list_string = axis2_strcat(env, list_string, ",", element, NULL);
+ }
+ else if(SANDESHA2_ARRAY_LIST_LONG == type)
+ {
+ long *element = AXIS2_ARRAY_LIST_GET(list, env, i);
+ axis2_char_t value[32];
+ sprintf(value, "%ld", *element);
+ list_string = axis2_strcat(env, list_string, ",", value, NULL);
+ }
}
list_string = axis2_strcat(env, list_string, "]", NULL);
@@ -383,4 +401,183 @@
}
return (sandesha2_property_bean_t*)AXIS2_PARAM_GET_VALUE(param, env);
+}
+
+AXIS2_EXTERN axis2_msg_ctx_t *AXIS2_CALL
+sandesha2_utils_create_new_related_msg_ctx(const axis2_env_t *env,
+ sandesha2_msg_ctx_t *ref_rm_msg,
+ axis2_op_t *op)
+{
+ axis2_msg_ctx_t *ref_msg = NULL;
+ axis2_msg_ctx_t *new_msg = NULL;
+ axis2_conf_ctx_t *conf_ctx = NULL;
+ axis2_conf_t *conf = NULL;
+ axis2_transport_out_desc_t *out_desc = NULL;
+ axis2_transport_in_desc_t *in_desc = NULL;
+ axis2_options_t *options = NULL;
+ axis2_svc_t *svc = NULL;
+ axis2_op_ctx_t *op_ctx = NULL;
+ axiom_soap_envelope_t *soap_env = NULL;
+ axis2_property_t *property = NULL;
+ axis2_char_t *addr_ver = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ AXIS2_PARAM_CHECK(env->error, ref_rm_msg, NULL);
+ AXIS2_PARAM_CHECK(env->error, op, NULL);
+
+ ref_msg = SANDESHA2_MSG_CTX_GET_MSG_CTX(ref_rm_msg, env);
+ conf_ctx = AXIS2_MSG_CTX_GET_CONF_CTX(ref_msg, env);
+ conf = AXIS2_CONF_CTX_GET_CONF(conf_ctx, env);
+
+ out_desc = AXIS2_MSG_CTX_GET_TRANSPORT_OUT_DESC(ref_msg, env);
+ in_desc = AXIS2_MSG_CTX_GET_TRANSPORT_IN_DESC(ref_msg, env);
+
+ new_msg = axis2_msg_ctx_create(env, conf_ctx, in_desc, out_desc);
+
+ options = axis2_options_create(env);
+ AXIS2_MSG_CTX_SET_OPTIONS(new_msg, env, options);
+
+ if(NULL != AXIS2_MSG_CTX_GET_SVC_GRP(ref_msg, env))
+ {
+ AXIS2_MSG_CTX_SET_SVC_GRP(new_msg, env,
+ AXIS2_MSG_CTX_GET_SVC_GRP(ref_msg, env));
+ if(NULL != AXIS2_MSG_CTX_GET_SVC_GRP_CTX(ref_msg, env))
+ {
+ AXIS2_MSG_CTX_SET_SVC_GRP_CTX(new_msg, env,
+ AXIS2_MSG_CTX_GET_SVC_GRP_CTX(ref_msg, env));
+ AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(new_msg, env,
+ AXIS2_MSG_CTX_GET_SVC_GRP_CTX_ID(ref_msg, env));
+ }
+ else
+ {
+ axis2_svc_grp_ctx_t *svc_grp_ctx = NULL;
+ svc_grp_ctx = axis2_svc_grp_ctx_create(env,
+ AXIS2_MSG_CTX_GET_SVC_GRP(ref_msg, env), conf_ctx);
+ AXIS2_MSG_CTX_SET_SVC_GRP_CTX(new_msg, env, svc_grp_ctx);
+ }
+ }
+ else
+ {
+ axis2_svc_grp_t *svc_grp = NULL;
+ axis2_svc_grp_ctx_t *svc_grp_ctx = NULL;
+
+ svc_grp = axis2_svc_grp_create_with_conf(env, conf);
+ svc_grp_ctx = axis2_svc_grp_ctx_create(env, svc_grp, conf_ctx);
+ AXIS2_MSG_CTX_SET_SVC_GRP(new_msg, env, svc_grp);
+ AXIS2_MSG_CTX_SET_SVC_GRP_CTX(new_msg, env, svc_grp_ctx);
+ }
+ if(NULL != AXIS2_MSG_CTX_GET_SVC(ref_msg, env))
+ {
+ AXIS2_MSG_CTX_SET_SVC(new_msg, env, AXIS2_MSG_CTX_GET_SVC(ref_msg, env));
+ if(NULL != AXIS2_MSG_CTX_GET_SVC_CTX(ref_msg, env))
+ {
+ AXIS2_MSG_CTX_SET_SVC_CTX(new_msg, env,
+ AXIS2_MSG_CTX_GET_SVC_CTX(ref_msg, env));
+ AXIS2_MSG_CTX_SET_SVC_CTX_ID(new_msg, env,
+ AXIS2_MSG_CTX_GET_SVC_CTX_ID(ref_msg, env));
+ }
+ else
+ {
+ axis2_svc_ctx_t *svc_ctx = NULL;
+ svc_ctx = axis2_svc_ctx_create(env,
+ AXIS2_MSG_CTX_GET_SVC(ref_msg, env),
+ AXIS2_MSG_CTX_GET_SVC_GRP_CTX(new_msg, env));
+ AXIS2_MSG_CTX_SET_SVC_CTX(new_msg, env, svc_ctx);
+ }
+ }
+ else
+ {
+ axis2_svc_t *axis_svc = NULL;
+ axis2_qname_t *svc_qname = NULL;
+ axis2_svc_grp_t *svc_grp = NULL;
+ axis2_svc_ctx_t *svc_ctx = NULL;
+ axis2_svc_grp_ctx_t *svc_grp_ctx = NULL;
+
+ svc_qname = axis2_qname_create(env, "AnonymousRMService", NULL, NULL);
+ axis_svc = axis2_svc_create_with_qname(env, svc_qname);
+
+ svc_grp = AXIS2_MSG_CTX_GET_SVC_GRP(new_msg, env);
+ AXIS2_SVC_SET_PARENT(axis_svc, env, AXIS2_MSG_CTX_GET_SVC_GRP(new_msg,
+ env));
+ AXIS2_SVC_GRP_ADD_SVC(svc_grp, env, axis_svc);
+ svc_grp_ctx = AXIS2_MSG_CTX_GET_SVC_GRP_CTX(new_msg, env);
+ svc_ctx = axis2_svc_ctx_create(env, axis_svc, svc_grp_ctx);
+ }
+ AXIS2_MSG_CTX_SET_OP(new_msg, env, op);
+ svc = AXIS2_MSG_CTX_GET_SVC(new_msg, env);
+
+ if(NULL != svc && NULL != op)
+ {
+ AXIS2_SVC_ADD_OP(svc, env, op);
+ AXIS2_OP_SET_PARENT(op, env, svc);
+ }
+
+ op_ctx = axis2_op_ctx_create(env, op, AXIS2_MSG_CTX_GET_SVC_CTX(new_msg,
+ env));
+ AXIS2_MSG_CTX_SET_OP_CTX(new_msg, env, op_ctx);
+ AXIS2_OP_CTX_ADD_MSG_CTX(op_ctx, env, new_msg);
+
+ soap_env = axiom_soap_envelope_create_default_soap_envelope(env,
+ sandesha2_utils_get_soap_version(env,
+ AXIS2_MSG_CTX_GET_SOAP_ENVELOPE(ref_msg, env)));
+ AXIS2_MSG_CTX_SET_SOAP_ENVELOPE(new_msg, env, soap_env);
+
+ property = AXIS2_MSG_CTX_GET_PROPERTY(ref_msg, env, AXIS2_TRANSPORT_URL,
+ AXIS2_FALSE);
+ if(NULL != property && NULL != AXIS2_PROPERTY_GET_VALUE(property, env))
+ {
+ axis2_char_t *val = AXIS2_PROPERTY_GET_VALUE(property, env);
+ property = axis2_property_create(env);
+ AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_APPLICATION);
+ AXIS2_PROPERTY_SET_VALUE(property, env, AXIS2_STRDUP(val, env));
+ AXIS2_CTX_SET_PROPERTY(new_msg, env, AXIS2_TRANSPORT_URL, property,
+ AXIS2_FALSE);
+ }
+ property = AXIS2_MSG_CTX_GET_PROPERTY(ref_msg, env, AXIS2_WSA_VERSION,
+ AXIS2_FALSE);
+ if(NULL == property)
+ {
+ axis2_msg_ctx_t *req_msg = NULL;
+ axis2_op_ctx_t *op_ctx = AXIS2_MSG_CTX_GET_OP_CTX(ref_msg, env);
+
+ req_msg = AXIS2_OP_CTX_GET_MSG_CTX(op_ctx, env,
+ AXIS2_WSDL_MESSAGE_LABEL_IN_VALUE);
+ if(NULL != req_msg)
+ {
+ property = AXIS2_MSG_CTX_GET_PROPERTY(ref_msg, env,
+ AXIS2_TRANSPORT_URL, AXIS2_FALSE);
+ if(NULL != property)
+ addr_ver = AXIS2_PROPERTY_GET_VALUE(property, env);
+ }
+ }
+ else
+ {
+ addr_ver = AXIS2_PROPERTY_GET_VALUE(property, env);
+ }
+ property = axis2_property_create(env);
+ AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_APPLICATION);
+ AXIS2_PROPERTY_SET_VALUE(property, env, AXIS2_STRDUP(addr_ver, env));
+ AXIS2_CTX_SET_PROPERTY(new_msg, env, AXIS2_WSA_VERSION, property,
+ AXIS2_FALSE);
+
+ property = AXIS2_MSG_CTX_GET_PROPERTY(ref_msg, env, AXIS2_TRANSPORT_OUT,
+ AXIS2_FALSE);
+ AXIS2_MSG_CTX_SET_PROPERTY(new_msg, env, AXIS2_TRANSPORT_OUT, property,
+ AXIS2_FALSE);
+ property = AXIS2_MSG_CTX_GET_PROPERTY(ref_msg, env,
+ AXIS2_TRANSPORT_IN, AXIS2_FALSE);
+ AXIS2_MSG_CTX_SET_PROPERTY(new_msg, env, AXIS2_TRANSPORT_IN,
+ property, AXIS2_FALSE);
+ property = AXIS2_MSG_CTX_GET_PROPERTY(ref_msg, env,
+ AXIS2_HTTP_OUT_TRANSPORT_INFO, AXIS2_FALSE);
+ AXIS2_MSG_CTX_SET_PROPERTY(new_msg, env, AXIS2_HTTP_OUT_TRANSPORT_INFO,
+ property, AXIS2_FALSE);
+ property = AXIS2_MSG_CTX_GET_PROPERTY(ref_msg, env,
+ AXIS2_TRANSPORT_HEADERS, AXIS2_FALSE);
+ AXIS2_MSG_CTX_SET_PROPERTY(new_msg, env, AXIS2_TRANSPORT_HEADERS,
+ property, AXIS2_FALSE);
+ AXIS2_MSG_CTX_SET_EXECUTION_CHAIN(new_msg, env,
+ AXIS2_MSG_CTX_GET_EXECUTION_CHAIN(ref_msg, env));
+
+ return new_msg;
}
Modified: webservices/sandesha/trunk/c/src/workers/in_order_invoker.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/workers/in_order_invoker.c?rev=422605&r1=422604&r2=422605&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/in_order_invoker.c (original)
+++ webservices/sandesha/trunk/c/src/workers/in_order_invoker.c Sun Jul 16 19:37:25 2006
@@ -375,7 +375,8 @@
* removing current element
*/
i--;
- str_list = sandesha2_utils_array_list_to_string(env, all_seq_list);
+ str_list = sandesha2_utils_array_list_to_string(env, all_seq_list,
+ SANDESHA2_ARRAY_LIST_STRING);
SANDESHA2_SEQ_PROPERTY_BEAN_SET_VALUE(all_seq_bean, env,
str_list);
SANDESHA2_SEQ_PROPERTY_MGR_UPDATE(seq_prop_mgr, env,
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org