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 da...@apache.org on 2008/02/07 05:24:10 UTC
svn commit: r619258 - in /webservices/sandesha/trunk/c: ./ include/
src/msgprocessors/ src/polling/ src/util/ src/workers/ xdocs/docs/
Author: damitha
Date: Wed Feb 6 20:24:08 2008
New Revision: 619258
URL: http://svn.apache.org/viewvc?rev=619258&view=rev
Log:
rm_echo_single_1_1 sample was failing now and then. Fixed it by changes to the polling manager.
Modified:
webservices/sandesha/trunk/c/INSTALL
webservices/sandesha/trunk/c/include/sandesha2_constants.h
webservices/sandesha/trunk/c/include/sandesha2_polling_mgr.h
webservices/sandesha/trunk/c/include/sandesha2_utils.h
webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c
webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c
webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_res_msg_processor.c
webservices/sandesha/trunk/c/src/polling/polling_mgr.c
webservices/sandesha/trunk/c/src/util/msg_retrans_adjuster.c
webservices/sandesha/trunk/c/src/util/property_bean.c
webservices/sandesha/trunk/c/src/util/property_mgr.c
webservices/sandesha/trunk/c/src/util/sandesha2_utils.c
webservices/sandesha/trunk/c/src/workers/sender_worker.c
webservices/sandesha/trunk/c/xdocs/docs/installationguide.html
webservices/sandesha/trunk/c/xdocs/docs/sandesha2c_manual.html
Modified: webservices/sandesha/trunk/c/INSTALL
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/INSTALL?rev=619258&r1=619257&r2=619258&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/INSTALL (original)
+++ webservices/sandesha/trunk/c/INSTALL Wed Feb 6 20:24:08 2008
@@ -39,7 +39,6 @@
+ - services (Contain sample service)
|
+ - include ( header files)
- + - bin (database scripts)
+ - bin/samples ( sample executables)
+ - lib (some libs to run Sandesha2/C clients)
Modified: webservices/sandesha/trunk/c/include/sandesha2_constants.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_constants.h?rev=619258&r1=619257&r2=619258&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_constants.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_constants.h Wed Feb 6 20:24:08 2008
@@ -430,6 +430,8 @@
#define SANDESHA2_CLIENT_SLEEP_TIME 4 /* 32 16 */
#define SANDESHA2_TERMINATE_DELAY 4 /* In seconds */
+
+ #define SANDESHA2_POLLING_WAIT_TIME 2 /* In seconds */
#define SANDESHA2_TEMP_SEQ_ID "uuid:tempID"
Modified: webservices/sandesha/trunk/c/include/sandesha2_polling_mgr.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_polling_mgr.h?rev=619258&r1=619257&r2=619258&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_polling_mgr.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_polling_mgr.h Wed Feb 6 20:24:08 2008
@@ -31,64 +31,27 @@
#include <axutil_string.h>
#include <axutil_utils.h>
#include <axis2_conf_ctx.h>
+#include <sandesha2_storage_mgr.h>
#ifdef __cplusplus
extern "C"
{
#endif
-typedef struct sandesha2_polling_mgr_t sandesha2_polling_mgr_t;
+struct sandesha2_seq_property_mgr;
+struct sandesha2_sender_mgr;
+struct sandesha2_next_msg_mgr;
-AXIS2_EXTERN sandesha2_polling_mgr_t * AXIS2_CALL
-sandesha2_polling_mgr_create(
- const axutil_env_t *env);
-
-/**
- * Frees the polling_mgr given as a void pointer. This method would cast the
- * void parameter to an polling_mgr pointer and then call free method.
- * @param polling_mgr pointer to polling_mgr as a void pointer
- * @param env pointer to environment struct
- * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
- */
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
-sandesha2_polling_mgr_free_void_arg(
- void *polling_mgr,
- const axutil_env_t *env);
-
-axis2_status_t AXIS2_CALL
-sandesha2_polling_mgr_free(
- sandesha2_polling_mgr_t *polling_mgr,
- const axutil_env_t *env);
-
-axis2_status_t AXIS2_CALL
-sandesha2_polling_mgr_stop_polling (
- sandesha2_polling_mgr_t *polling_mgr,
- const axutil_env_t *env);
-
axis2_status_t AXIS2_CALL
sandesha2_polling_mgr_start (
- sandesha2_polling_mgr_t *polling_mgr,
- const axutil_env_t *env,
- axis2_conf_ctx_t *conf_ctx,
- const axis2_char_t *internal_seq_id);
-
-void AXIS2_CALL
-sandesha2_polling_mgr_set_poll(
- sandesha2_polling_mgr_t *polling_mgr,
const axutil_env_t *env,
- axis2_bool_t poll);
-
-axis2_bool_t AXIS2_CALL
-sandesha2_polling_mgr_is_poll(
- sandesha2_polling_mgr_t *polling_mgr,
- const axutil_env_t *env);
+ sandesha2_storage_mgr_t *storage_mgr,
+ struct sandesha2_seq_property_mgr *seq_prop_mgr,
+ struct sandesha2_sender_mgr *sender_mgr,
+ struct sandesha2_next_msg_mgr *next_msg_mgr,
+ axis2_conf_ctx_t *conf_ctx,
+ axis2_char_t *internal_seq_id);
-void AXIS2_CALL
-sandesha2_polling_mgr_schedule_polling_request(
- sandesha2_polling_mgr_t *polling_mgr,
- const axutil_env_t *env,
- const axis2_char_t *internal_seq_id);
-
/** @} */
#ifdef __cplusplus
}
Modified: webservices/sandesha/trunk/c/include/sandesha2_utils.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_utils.h?rev=619258&r1=619257&r2=619258&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_utils.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_utils.h Wed Feb 6 20:24:08 2008
@@ -117,12 +117,6 @@
axis2_char_t *seq_id,
const axis2_bool_t persistent);
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
-sandesha2_utils_start_polling_mgr(
- const axutil_env_t *env,
- axis2_conf_ctx_t *conf_ctx,
- const axis2_char_t *internal_seq_id);
-
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
sandesha2_utils_get_outgoing_internal_seq_id(
const axutil_env_t *env,
@@ -240,11 +234,6 @@
AXIS2_EXTERN axis2_status_t AXIS2_CALL
sandesha2_utils_stop_sender(
- const axutil_env_t *env,
- axis2_conf_ctx_t *conf_ctx);
-
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
-sandesha2_utils_stop_polling_mgr(
const axutil_env_t *env,
axis2_conf_ctx_t *conf_ctx);
Modified: webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c?rev=619258&r1=619257&r2=619258&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c Wed Feb 6 20:24:08 2008
@@ -436,12 +436,13 @@
sandesha2_next_msg_bean_set_ref_msg_key(next_bean, env,
new_msg_store_key);
sandesha2_next_msg_bean_set_polling_mode(next_bean, env, polling_mode);
+ sandesha2_next_msg_mgr_insert(next_msg_mgr, env, next_bean);
/* If polling_mode is true, starting the polling manager */
if(polling_mode)
{
- sandesha2_utils_start_polling_mgr(env, conf_ctx, internal_seq_id);
+ sandesha2_polling_mgr_start(env, storage_mgr, seq_prop_mgr,
+ sender_mgr, next_msg_mgr, conf_ctx, internal_seq_id);
}
- sandesha2_next_msg_mgr_insert(next_msg_mgr, env, next_bean);
spec_ver_bean = sandesha2_seq_property_bean_create_with_data(env,
offered_seq_id, SANDESHA2_SEQ_PROP_RM_SPEC_VERSION, rm_spec_ver);
Modified: webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c?rev=619258&r1=619257&r2=619258&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c Wed Feb 6 20:24:08 2008
@@ -590,6 +590,7 @@
terminated = sandesha2_utils_get_seq_property(env, int_seq_id,
SANDESHA2_SEQ_PROP_TERMINATE_ADDED, seq_prop_mgr);
old_op = axis2_msg_ctx_get_op(msg_ctx, env);
+ axis2_op_set_msg_exchange_pattern(old_op, env, AXIS2_MEP_URI_OUT_IN);
qname = axutil_qname_create(env, "temp", NULL, NULL);
out_in_op = axis2_op_create_with_qname(env, qname);
@@ -700,9 +701,9 @@
AXIS2_FREE(env->allocator, out_seq_id);
sandesha2_seq_property_bean_set_value(term_added, env, AXIS2_VALUE_TRUE);
sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, term_added);
- sandesha2_terminate_mgr_terminate_sending_side(env, conf_ctx, int_seq_id,
+ /*sandesha2_terminate_mgr_terminate_sending_side(env, conf_ctx, int_seq_id,
axis2_msg_ctx_get_server_side(msg_ctx, env), storage_mgr, seq_prop_mgr,
- create_seq_mgr, sender_mgr);
+ create_seq_mgr, sender_mgr);*/
if(seq_prop_mgr)
sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
if(create_seq_mgr)
Modified: webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_res_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_res_msg_processor.c?rev=619258&r1=619257&r2=619258&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_res_msg_processor.c (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_res_msg_processor.c Wed Feb 6 20:24:08 2008
@@ -166,6 +166,7 @@
/* We need to pass here internal seq id isn't it?:damitha
int internal_seq_id = sandesha2_utils_get_seq_property(env, seq_id,
SANDESHA2_SEQ_PROP_INTERNAL_SEQ_ID, storage_mgr);*/
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "dam_came2");
sandesha2_terminate_mgr_terminate_sending_side(env, conf_ctx, seq_id,
AXIS2_FALSE, storage_mgr, seq_prop_mgr, create_seq_mgr, sender_mgr);
if(seq_prop_mgr)
Modified: webservices/sandesha/trunk/c/src/polling/polling_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/polling/polling_mgr.c?rev=619258&r1=619257&r2=619258&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/polling/polling_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/polling/polling_mgr.c Wed Feb 6 20:24:08 2008
@@ -38,435 +38,145 @@
#include <platforms/axutil_platform_auto_sense.h>
#include <axutil_types.h>
-
-/**
- * @brief Polling Manager struct impl
- * Sandesha2 Polling Manager
- */
-typedef struct sandesha2_polling_mgr_args sandesha2_polling_mgr_args_t;
-
-struct sandesha2_polling_mgr_t
-{
- axis2_conf_ctx_t *conf_ctx;
- /**
- * By adding an entry to this, the polling_mgr will be asked to do a polling
- * request on this sequence.
- */
- axutil_array_list_t *scheduled_polling_reqs;
- axis2_bool_t poll;
- axutil_thread_mutex_t *mutex;
-};
-
-struct sandesha2_polling_mgr_args
-{
- sandesha2_polling_mgr_t *impl;
- axutil_env_t *env;
- sandesha2_storage_mgr_t *storage_mgr;
-};
-
-static axis2_status_t AXIS2_CALL
-sandesha2_polling_mgr_run (
- sandesha2_polling_mgr_t *polling_mgr,
- const axutil_env_t *env,
- sandesha2_storage_mgr_t *storage_mgr);
-
-/**
- * Thread worker function.
- */
-static void * AXIS2_THREAD_FUNC
-sandesha2_polling_mgr_worker_func(
- axutil_thread_t *thd,
- void *data);
-
-AXIS2_EXTERN sandesha2_polling_mgr_t* AXIS2_CALL
-sandesha2_polling_mgr_create(
- const axutil_env_t *env)
-{
- sandesha2_polling_mgr_t *polling_mgr = NULL;
-
- polling_mgr = (sandesha2_polling_mgr_t *)AXIS2_MALLOC
- (env->allocator,
- sizeof(sandesha2_polling_mgr_t));
-
- if(!polling_mgr)
- {
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
- polling_mgr->scheduled_polling_reqs = NULL;
- polling_mgr->poll = AXIS2_FALSE;
- polling_mgr->mutex = axutil_thread_mutex_create(env->allocator,
- AXIS2_THREAD_MUTEX_DEFAULT);
-
- return polling_mgr;
-}
-
-axis2_status_t AXIS2_CALL
-sandesha2_polling_mgr_free_void_arg(
- void *polling_mgr,
- const axutil_env_t *env)
-{
- sandesha2_polling_mgr_t *polling_mgr_l = NULL;
-
- polling_mgr_l = (sandesha2_polling_mgr_t *) polling_mgr;
- return sandesha2_polling_mgr_free(polling_mgr_l, env);
-}
-
-axis2_status_t AXIS2_CALL
-sandesha2_polling_mgr_free(
- sandesha2_polling_mgr_t *polling_mgr,
- const axutil_env_t *env)
-{
- /* Do not free this */
- polling_mgr->conf_ctx = NULL;
-
- if(polling_mgr->mutex)
- {
- axutil_thread_mutex_destroy(polling_mgr->mutex);
- polling_mgr->mutex = NULL;
- }
- if(polling_mgr->scheduled_polling_reqs)
- {
- axutil_array_list_free(polling_mgr->scheduled_polling_reqs, env);
- polling_mgr->scheduled_polling_reqs = NULL;
- }
- AXIS2_FREE(env->allocator, polling_mgr);
- return AXIS2_SUCCESS;
-}
-
-axis2_status_t AXIS2_CALL
-sandesha2_polling_mgr_stop_polling (
- sandesha2_polling_mgr_t *polling_mgr,
- const axutil_env_t *env)
-{
- sandesha2_polling_mgr_set_poll(polling_mgr, env, AXIS2_FALSE);
- return AXIS2_SUCCESS;
-}
-
axis2_status_t AXIS2_CALL
sandesha2_polling_mgr_start (
- sandesha2_polling_mgr_t *polling_mgr,
- const axutil_env_t *env,
+ const axutil_env_t *env,
+ sandesha2_storage_mgr_t *storage_mgr,
+ sandesha2_seq_property_mgr_t *seq_prop_mgr,
+ sandesha2_sender_mgr_t *sender_mgr,
+ sandesha2_next_msg_mgr_t *next_msg_mgr,
axis2_conf_ctx_t *conf_ctx,
- const axis2_char_t *internal_seq_id)
+ axis2_char_t *internal_seq_id)
{
- sandesha2_storage_mgr_t *storage_mgr = NULL;
- axis2_char_t *dbname = NULL;
+ sandesha2_next_msg_bean_t *next_msg_bean = NULL;
+ sandesha2_msg_ctx_t *ref_rm_msg_ctx = NULL;
+ sandesha2_msg_ctx_t *make_conn_rm_msg_ctx = NULL;
+ sandesha2_sender_bean_t *make_conn_sender_bean = NULL;
+ axis2_char_t *make_conn_seq_id = NULL;
+ axis2_char_t *ref_msg_key = NULL;
+ axis2_char_t *seq_prop_key = NULL;
+ axis2_char_t *reply_to = NULL;
+ axis2_char_t *wsrm_anon_reply_to_uri = NULL;
+ axis2_char_t *make_conn_msg_store_key = NULL;
+ axis2_char_t *msg_id = NULL;
+ axis2_msg_ctx_t *ref_msg_ctx = NULL;
+ axis2_msg_ctx_t *make_conn_msg_ctx = NULL;
+ axis2_endpoint_ref_t *to = NULL;
+ axutil_property_t *property = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+ sandesha2_next_msg_bean_t *find_bean = NULL;
+
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
"[sandesha2]Entry:sandesha2_polling_mgr_start");
- AXIS2_PARAM_CHECK(env->error, conf_ctx, AXIS2_FAILURE);
-
- axutil_thread_mutex_lock(polling_mgr->mutex);
- polling_mgr->conf_ctx = conf_ctx;
- polling_mgr->scheduled_polling_reqs = axutil_array_list_create(env,
- AXIS2_ARRAY_LIST_DEFAULT_CAPACITY);
- if(!polling_mgr->conf_ctx)
+ find_bean = sandesha2_next_msg_bean_create(env);
+ if(find_bean)
{
- axutil_thread_mutex_unlock(polling_mgr->mutex);
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "conf_ctx is NULL");
+ sandesha2_next_msg_bean_set_polling_mode(find_bean, env,
+ AXIS2_TRUE);
+ sandesha2_next_msg_bean_set_internal_seq_id(find_bean, env,
+ internal_seq_id);
+ next_msg_bean = sandesha2_next_msg_mgr_find_unique(next_msg_mgr,
+ env, find_bean);
+ }
+ /* If no valid entry is found, try again later */
+ if(!next_msg_bean)
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+ "[sandesha2]No valid MakeConnection entry is found.");
return AXIS2_FAILURE;
}
- dbname = sandesha2_util_get_dbname(env, conf_ctx);
- storage_mgr = sandesha2_utils_get_storage_mgr(env, dbname);
- sandesha2_polling_mgr_set_poll(polling_mgr, env, AXIS2_TRUE);
- sandesha2_polling_mgr_schedule_polling_request(polling_mgr, env,
- internal_seq_id);
- sandesha2_polling_mgr_run(polling_mgr, env, storage_mgr);
- axutil_thread_mutex_unlock(polling_mgr->mutex);
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Exit:sandesha2_polling_mgr_start");
- return AXIS2_SUCCESS;
-}
-
-static axis2_status_t AXIS2_CALL
-sandesha2_polling_mgr_run (
- sandesha2_polling_mgr_t *polling_mgr,
- const axutil_env_t *env,
- sandesha2_storage_mgr_t *storage_mgr)
-{
- axutil_thread_t *worker_thread = NULL;
- sandesha2_polling_mgr_args_t *args = NULL;
-
- args = AXIS2_MALLOC(env->allocator, sizeof(
- sandesha2_polling_mgr_args_t));
- args->impl = polling_mgr;
- args->env = (axutil_env_t*)env;
- args->storage_mgr = storage_mgr;
- worker_thread = axutil_thread_pool_get_thread(env->thread_pool,
- sandesha2_polling_mgr_worker_func, (void*)args);
- if(!worker_thread)
+ make_conn_seq_id = sandesha2_next_msg_bean_get_seq_id(next_msg_bean, env);
+ /* Create a MakeConnection message */
+ ref_msg_key = sandesha2_next_msg_bean_get_ref_msg_key(next_msg_bean, env);
+ seq_prop_key = make_conn_seq_id;
+ reply_to = sandesha2_utils_get_seq_property(env, seq_prop_key,
+ SANDESHA2_SEQ_PROP_REPLY_TO_EPR, seq_prop_mgr);
+ if(sandesha2_utils_is_wsrm_anon_reply_to(env, reply_to))
+ wsrm_anon_reply_to_uri = reply_to;
+ ref_msg_ctx = sandesha2_storage_mgr_retrieve_msg_ctx(storage_mgr, env,
+ ref_msg_key, conf_ctx, AXIS2_FALSE);
+ if(ref_msg_ctx)
+ ref_rm_msg_ctx = sandesha2_msg_init_init_msg(env, ref_msg_ctx);
+ make_conn_rm_msg_ctx =
+ sandesha2_msg_creator_create_make_connection_msg(env,
+ ref_rm_msg_ctx, make_conn_seq_id, wsrm_anon_reply_to_uri, seq_prop_mgr);
+ if(reply_to)
+ AXIS2_FREE(env->allocator, reply_to);
+ if(!make_conn_rm_msg_ctx)
{
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Thread creation failed" \
- " sandesha2_polling_mgr_run");
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory");
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return AXIS2_FAILURE;
}
- axutil_thread_pool_thread_detach(env->thread_pool, worker_thread);
-
- return AXIS2_SUCCESS;
-}
-
-/**
- * Thread worker function.
- */
-static void * AXIS2_THREAD_FUNC
-sandesha2_polling_mgr_worker_func(
- axutil_thread_t *thd,
- void *data)
-{
- axis2_char_t *dbname = NULL;
- sandesha2_polling_mgr_args_t *args = (sandesha2_polling_mgr_args_t*)data;
- axutil_env_t *env = args->env;
- sandesha2_polling_mgr_t *polling_mgr = args->impl;
- sandesha2_storage_mgr_t *storage_mgr = args->storage_mgr;
- sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
- sandesha2_sender_mgr_t *sender_mgr = NULL;
- sandesha2_next_msg_mgr_t *next_msg_mgr = NULL;
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Entry:sandesha2_polling_mgr_worker_func");
-
- dbname = sandesha2_util_get_dbname(env, polling_mgr->conf_ctx);
- seq_prop_mgr = sandesha2_permanent_seq_property_mgr_create(env, dbname);
- sender_mgr = sandesha2_permanent_sender_mgr_create(env, dbname);
- next_msg_mgr = sandesha2_permanent_next_msg_mgr_create(env, dbname);
-
- while(polling_mgr->poll)
+ sandesha2_msg_ctx_set_property(make_conn_rm_msg_ctx, env,
+ AXIS2_TRANSPORT_IN, NULL);
+ /* Storing the MakeConnection message */
+ make_conn_msg_store_key = axutil_uuid_gen(env);
+ property = axutil_property_create_with_args(env, 0, 0, 0, seq_prop_key);
+ sandesha2_msg_ctx_set_property(make_conn_rm_msg_ctx, env,
+ SANDESHA2_MSG_CTX_PROP_SEQUENCE_PROPERTY_KEY, property);
+ make_conn_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(make_conn_rm_msg_ctx,
+ env);
+ sandesha2_storage_mgr_store_msg_ctx(storage_mgr, env,
+ make_conn_msg_store_key, make_conn_msg_ctx);
+ /* Adde an entry for the MakeConnection message to the sender(with,
+ * send=true, resend=false)
+ */
+ make_conn_sender_bean = sandesha2_sender_bean_create(env);
+ if(make_conn_sender_bean)
{
- sandesha2_next_msg_bean_t *next_msg_bean = NULL;
- sandesha2_msg_ctx_t *ref_rm_msg_ctx = NULL;
- sandesha2_msg_ctx_t *make_conn_rm_msg_ctx = NULL;
- sandesha2_sender_bean_t *make_conn_sender_bean = NULL;
- int size = 0;
- axis2_char_t *seq_id = NULL;
- axis2_char_t *make_conn_seq_id = NULL;
- axis2_char_t *ref_msg_key = NULL;
- axis2_char_t *seq_prop_key = NULL;
- axis2_char_t *reply_to = NULL;
- axis2_char_t *wsrm_anon_reply_to_uri = NULL;
- axis2_char_t *make_conn_msg_store_key = NULL;
- axis2_char_t *msg_id = NULL;
- axis2_msg_ctx_t *ref_msg_ctx = NULL;
- axis2_msg_ctx_t *make_conn_msg_ctx = NULL;
- axis2_endpoint_ref_t *to = NULL;
- axutil_property_t *property = NULL;
- axutil_qname_t *qname = NULL;
- axutil_param_t *wait_time_param = NULL;
- int wait_time = 0;
- axis2_conf_t *conf = NULL;
- axis2_module_desc_t *module_desc = NULL;
- axis2_status_t status = AXIS2_FAILURE;
-
- conf = axis2_conf_ctx_get_conf(polling_mgr->conf_ctx, env);
- qname = axutil_qname_create(env, "sandesha2", NULL, NULL);
- module_desc = axis2_conf_get_module(conf, env, qname);
- wait_time_param = axis2_module_desc_get_param(module_desc, env,
- SANDESHA2_POLLING_WAIT);
- if(wait_time_param)
- {
- wait_time = AXIS2_ATOI(axutil_param_get_value(wait_time_param, env));
- }
- if(qname)
- axutil_qname_free(qname, env);
- AXIS2_SLEEP(wait_time);
- /* Getting the sequences to be polled. if schedule contains any requests,
- * do the earliest one. else pick one randomly.
- */
- if(polling_mgr->scheduled_polling_reqs)
- size = axutil_array_list_size(polling_mgr->scheduled_polling_reqs,
- env);
- if(size > 0)
- {
- seq_id = axutil_array_list_get(polling_mgr->scheduled_polling_reqs,
- env, 0);
- /*axutil_array_list_remove(polling_mgr->scheduled_polling_reqs, env, 0);*/
- }
- if(!seq_id)
- {
- sandesha2_next_msg_bean_t *find_bean =
- sandesha2_next_msg_bean_create(env);
- int size = 0;
- if(find_bean)
- {
- axutil_array_list_t *results = NULL;
- sandesha2_next_msg_bean_set_polling_mode(find_bean, env,
- AXIS2_TRUE);
- results = sandesha2_next_msg_mgr_find(next_msg_mgr, env,
- find_bean);
- if(results)
- size = axutil_array_list_size(results, env);
- if(size > 0)
- {
- unsigned int rand_var =
- axutil_rand_get_seed_value_based_on_time(env);
- int item = axutil_rand_with_range(&rand_var, 0, size);
- item--;
- next_msg_bean = (sandesha2_next_msg_bean_t *)
- axutil_array_list_get(results, env, item);
- }
-
- }
- }
- else
- {
- sandesha2_next_msg_bean_t *find_bean =
- sandesha2_next_msg_bean_create(env);
- if(find_bean)
- {
- sandesha2_next_msg_bean_set_polling_mode(find_bean, env,
- AXIS2_TRUE);
- sandesha2_next_msg_bean_set_internal_seq_id(find_bean, env, seq_id);
- next_msg_bean = sandesha2_next_msg_mgr_find_unique(next_msg_mgr,
- env, find_bean);
- }
- }
- /* If no valid entry is found, try again later */
- if(!next_msg_bean)
- {
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
- "No valid MakeConnection entry is found.");
- continue;
- }
- make_conn_seq_id = sandesha2_next_msg_bean_get_seq_id(next_msg_bean, env);
- /* Create a MakeConnection message */
- ref_msg_key = sandesha2_next_msg_bean_get_ref_msg_key(next_msg_bean, env);
- seq_prop_key = make_conn_seq_id;
- reply_to = sandesha2_utils_get_seq_property(env, seq_prop_key,
- SANDESHA2_SEQ_PROP_REPLY_TO_EPR, seq_prop_mgr);
- if(sandesha2_utils_is_wsrm_anon_reply_to(env, reply_to))
- wsrm_anon_reply_to_uri = reply_to;
- ref_msg_ctx = sandesha2_storage_mgr_retrieve_msg_ctx(storage_mgr, env,
- ref_msg_key, polling_mgr->conf_ctx, AXIS2_FALSE);
- if(ref_msg_ctx)
- ref_rm_msg_ctx = sandesha2_msg_init_init_msg(env, ref_msg_ctx);
- make_conn_rm_msg_ctx =
- sandesha2_msg_creator_create_make_connection_msg(env,
- ref_rm_msg_ctx, make_conn_seq_id, wsrm_anon_reply_to_uri, seq_prop_mgr);
- if(reply_to)
- AXIS2_FREE(env->allocator, reply_to);
- if(!make_conn_rm_msg_ctx)
- {
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory");
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- if(seq_prop_mgr)
- sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
- if(sender_mgr)
- sandesha2_sender_mgr_free(sender_mgr, env);
- if(next_msg_mgr)
- sandesha2_next_msg_mgr_free(next_msg_mgr, env);
- return NULL;
- }
- sandesha2_msg_ctx_set_property(make_conn_rm_msg_ctx, env,
- AXIS2_TRANSPORT_IN, NULL);
- /* Storing the MakeConnection message */
- make_conn_msg_store_key = axutil_uuid_gen(env);
- property = axutil_property_create_with_args(env, 0, 0, 0, seq_prop_key);
- sandesha2_msg_ctx_set_property(make_conn_rm_msg_ctx, env,
- SANDESHA2_MSG_CTX_PROP_SEQUENCE_PROPERTY_KEY, property);
- make_conn_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(make_conn_rm_msg_ctx,
- env);
- sandesha2_storage_mgr_store_msg_ctx(storage_mgr, env,
- make_conn_msg_store_key, make_conn_msg_ctx);
- /* Adde an entry for the MakeConnection message to the sender(with,
- * send=true, resend=false)
- */
- make_conn_sender_bean = sandesha2_sender_bean_create(env);
- if(make_conn_sender_bean)
- {
- long millisecs = 0;
- millisecs = sandesha2_utils_get_current_time_in_millis(env);
- sandesha2_sender_bean_set_time_to_send(make_conn_sender_bean, env,
- millisecs);
- sandesha2_sender_bean_set_msg_ctx_ref_key(make_conn_sender_bean, env,
- make_conn_msg_store_key);
- msg_id = sandesha2_msg_ctx_get_msg_id(make_conn_rm_msg_ctx, env);
- sandesha2_sender_bean_set_msg_id(make_conn_sender_bean, env, msg_id);
- sandesha2_sender_bean_set_msg_type(make_conn_sender_bean, env,
- SANDESHA2_MSG_TYPE_MAKE_CONNECTION_MSG);
- sandesha2_sender_bean_set_resend(make_conn_sender_bean, env, AXIS2_FALSE);
- sandesha2_sender_bean_set_send(make_conn_sender_bean, env, AXIS2_TRUE);
- /*sandesha2_sender_bean_set_seq_id(make_conn_sender_bean, env, seq_id);*/
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]seq_id:%s", seq_id);
- sandesha2_sender_bean_set_internal_seq_id(make_conn_sender_bean,
- env, seq_id);
- to = sandesha2_msg_ctx_get_to(make_conn_rm_msg_ctx, env);
- if(to)
- {
- axis2_char_t *address = (axis2_char_t *)
- axis2_endpoint_ref_get_address(
- (const axis2_endpoint_ref_t *) to, env);
- sandesha2_sender_bean_set_to_address(make_conn_sender_bean, env,
- address);
- }
- }
- /* This message should not be sent untils it is qualified. i.e. Till
- * it is sent through the sandesha2_transport_sender
- */
- property = axutil_property_create_with_args(env, 0, 0, 0,
- AXIS2_VALUE_FALSE);
- sandesha2_msg_ctx_set_property(make_conn_rm_msg_ctx, env,
- SANDESHA2_QUALIFIED_FOR_SENDING, property);
- if(sender_mgr)
- {
- sandesha2_sender_mgr_insert(sender_mgr, env,
- make_conn_sender_bean);
- }
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]Sending the make "\
- "connection message for the sequence with internal sequence id %s",
- seq_id);
- status = sandesha2_utils_execute_and_store(env, make_conn_rm_msg_ctx,
+ long millisecs = 0;
+ millisecs = sandesha2_utils_get_current_time_in_millis(env);
+ sandesha2_sender_bean_set_time_to_send(make_conn_sender_bean, env,
+ millisecs);
+ sandesha2_sender_bean_set_msg_ctx_ref_key(make_conn_sender_bean, env,
make_conn_msg_store_key);
- if(!status)
- {
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "[sandesha2]make_connection sending failed");
- if(seq_prop_mgr)
- sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
- if(sender_mgr)
- sandesha2_sender_mgr_free(sender_mgr, env);
- if(next_msg_mgr)
- sandesha2_next_msg_mgr_free(next_msg_mgr, env);
- return NULL;
+ msg_id = sandesha2_msg_ctx_get_msg_id(make_conn_rm_msg_ctx, env);
+ sandesha2_sender_bean_set_msg_id(make_conn_sender_bean, env, msg_id);
+ sandesha2_sender_bean_set_msg_type(make_conn_sender_bean, env,
+ SANDESHA2_MSG_TYPE_MAKE_CONNECTION_MSG);
+ sandesha2_sender_bean_set_resend(make_conn_sender_bean, env, AXIS2_TRUE);
+ sandesha2_sender_bean_set_send(make_conn_sender_bean, env, AXIS2_TRUE);
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+ "[sandesha2]internal_seq_id:%s", internal_seq_id);
+ sandesha2_sender_bean_set_internal_seq_id(make_conn_sender_bean,
+ env, internal_seq_id);
+ to = sandesha2_msg_ctx_get_to(make_conn_rm_msg_ctx, env);
+ if(to)
+ {
+ axis2_char_t *address = (axis2_char_t *)
+ axis2_endpoint_ref_get_address(
+ (const axis2_endpoint_ref_t *) to, env);
+ sandesha2_sender_bean_set_to_address(make_conn_sender_bean, env,
+ address);
}
}
- if(seq_prop_mgr)
- sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
+ /* This message should not be sent untils it is qualified. i.e. Till
+ * it is sent through the sandesha2_transport_sender
+ */
+ property = axutil_property_create_with_args(env, 0, 0, 0,
+ AXIS2_VALUE_FALSE);
+ sandesha2_msg_ctx_set_property(make_conn_rm_msg_ctx, env,
+ SANDESHA2_QUALIFIED_FOR_SENDING, property);
if(sender_mgr)
- sandesha2_sender_mgr_free(sender_mgr, env);
- if(next_msg_mgr)
- sandesha2_next_msg_mgr_free(next_msg_mgr, env);
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[sandesha2]Exit:sandesha2_polling_mgr_worker_func");
- return NULL;
-}
-
-void AXIS2_CALL
-sandesha2_polling_mgr_set_poll(
- sandesha2_polling_mgr_t *polling_mgr,
- const axutil_env_t *env,
- axis2_bool_t poll)
-{
- polling_mgr->poll = poll;
-}
-
-axis2_bool_t AXIS2_CALL
-sandesha2_polling_mgr_is_poll(
- sandesha2_polling_mgr_t *polling_mgr,
- const axutil_env_t *env)
-{
- return polling_mgr->poll;
-}
-
-void AXIS2_CALL
-sandesha2_polling_mgr_schedule_polling_request(
- sandesha2_polling_mgr_t *polling_mgr,
- const axutil_env_t *env,
- const axis2_char_t *internal_seq_id)
-{
- if(!axutil_array_list_contains(polling_mgr->scheduled_polling_reqs, env,
- (axis2_char_t *)internal_seq_id))
{
- axutil_array_list_add(polling_mgr->scheduled_polling_reqs, env,
- internal_seq_id);
+ sandesha2_sender_mgr_insert(sender_mgr, env,
+ make_conn_sender_bean);
}
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]Sending the make "\
+ "connection message for the sequence with internal sequence id %s",
+ internal_seq_id);
+ status = sandesha2_utils_execute_and_store(env, make_conn_rm_msg_ctx,
+ make_conn_msg_store_key);
+ if(!status)
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+ "[sandesha2]make_connection sending failed");
+ return AXIS2_FAILURE;
+ }
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
+ "[sandesha2]Exit:sandesha2_polling_mgr_start");
+ return AXIS2_SUCCESS;
}
Modified: webservices/sandesha/trunk/c/src/util/msg_retrans_adjuster.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/msg_retrans_adjuster.c?rev=619258&r1=619257&r2=619258&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/msg_retrans_adjuster.c (original)
+++ webservices/sandesha/trunk/c/src/util/msg_retrans_adjuster.c Wed Feb 6 20:24:08 2008
@@ -26,7 +26,6 @@
#include <sandesha2_create_seq_mgr.h>
#include <sandesha2_sender_mgr.h>
-/******************************************************************************/
sandesha2_sender_bean_t * AXIS2_CALL
sandesha2_msg_retrans_adjuster_adjust_next_retrans_time(
const axutil_env_t *env,
@@ -50,8 +49,11 @@
sandesha2_create_seq_mgr_t *create_seq_mgr,
sandesha2_sender_mgr_t *sender_mgr);
-/******************************************************************************/
-
+static sandesha2_sender_bean_t * AXIS2_CALL
+sandesha2_msg_retrans_adjuster_adjust_polling(
+ const axutil_env_t *env,
+ sandesha2_sender_bean_t *sender_bean,
+ sandesha2_property_bean_t *property_bean);
AXIS2_EXTERN axis2_bool_t AXIS2_CALL
sandesha2_msg_retrans_adjuster_adjust_retrans(
@@ -71,6 +73,7 @@
sandesha2_property_bean_t *property_bean = NULL;
int max_attempts = -1;
int sent_count = -1;
+ int msg_type = -1;
axis2_bool_t timeout_seq = AXIS2_FALSE;
axis2_bool_t seq_timed_out = AXIS2_FALSE;
axis2_bool_t continue_sending = AXIS2_TRUE;
@@ -102,12 +105,21 @@
axis2_conf_ctx_get_conf(conf_ctx, env));
sent_count = sandesha2_sender_bean_get_sent_count(sender_bean, env) + 1;
sandesha2_sender_bean_set_sent_count(sender_bean, env, sent_count);
- sandesha2_msg_retrans_adjuster_adjust_next_retrans_time(env, sender_bean,
- property_bean);
- max_attempts = sandesha2_property_bean_get_max_retrans_count(property_bean,
- env);
- if(max_attempts > 0 && sent_count > max_attempts)
- timeout_seq = AXIS2_TRUE;
+ msg_type = sandesha2_msg_ctx_get_msg_type(rm_msg_ctx, env);
+ if(msg_type == SANDESHA2_MSG_TYPE_MAKE_CONNECTION_MSG)
+ {
+ sandesha2_msg_retrans_adjuster_adjust_polling(env, sender_bean,
+ property_bean);
+ }
+ else
+ {
+ sandesha2_msg_retrans_adjuster_adjust_next_retrans_time(env, sender_bean,
+ property_bean);
+ max_attempts = sandesha2_property_bean_get_max_retrans_count(property_bean,
+ env);
+ if(max_attempts > 0 && sent_count > max_attempts)
+ timeout_seq = AXIS2_TRUE;
+ }
if(rm_msg_ctx)
seq_timed_out = sandesha2_seq_mgr_has_seq_timedout(env, int_seq_id,
rm_msg_ctx, seq_prop_mgr, conf_ctx);
@@ -132,6 +144,29 @@
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
"[sandesha2]Exit:sandesha2_msg_retrans_adjuster_adjust_retrans");
return continue_sending;
+}
+
+static sandesha2_sender_bean_t * AXIS2_CALL
+sandesha2_msg_retrans_adjuster_adjust_polling(
+ const axutil_env_t *env,
+ sandesha2_sender_bean_t *sender_bean,
+ sandesha2_property_bean_t *property_bean)
+{
+ long interval = -1;
+ long time_now = -1;
+ long new_time_to_send = 0;
+
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
+ "[sandesha2]Entry:sandesha2_msg_retrans_adjuster_adjust_polling");
+ AXIS2_PARAM_CHECK(env->error, sender_bean, NULL);
+ AXIS2_PARAM_CHECK(env->error, property_bean, NULL);
+ interval = sandesha2_property_bean_get_polling_wait_time(property_bean, env);
+ time_now = sandesha2_utils_get_current_time_in_millis(env);
+ new_time_to_send = time_now + interval;
+ sandesha2_sender_bean_set_time_to_send(sender_bean, env, new_time_to_send);
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
+ "[sandesha2]Exit:sandesha2_msg_retrans_adjuster_adjust_polling");
+ return sender_bean;
}
sandesha2_sender_bean_t * AXIS2_CALL
Modified: webservices/sandesha/trunk/c/src/util/property_bean.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/property_bean.c?rev=619258&r1=619257&r2=619258&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/property_bean.c (original)
+++ webservices/sandesha/trunk/c/src/util/property_bean.c Wed Feb 6 20:24:08 2008
@@ -34,6 +34,7 @@
axutil_array_list_t *msg_types_to_drop;
int max_retrans_count;
int terminate_delay;
+ int polling_wait_time;
axis2_char_t *db_path;
};
@@ -60,6 +61,7 @@
bean->msg_types_to_drop = NULL;
bean->max_retrans_count = 0;
bean->terminate_delay = 0;
+ bean->polling_wait_time = 0;
bean->db_path = NULL;
return bean;
@@ -306,6 +308,23 @@
return AXIS2_SUCCESS;
}
+int AXIS2_CALL
+sandesha2_property_bean_get_polling_wait_time (
+ sandesha2_property_bean_t *bean,
+ const axutil_env_t *env)
+{
+ return bean->polling_wait_time;
+}
+
+axis2_status_t AXIS2_CALL
+sandesha2_property_bean_set_polling_wait_time(
+ sandesha2_property_bean_t *bean,
+ const axutil_env_t *env,
+ int wait_time)
+{
+ bean->polling_wait_time = wait_time;
+ return AXIS2_SUCCESS;
+}
axis2_char_t *AXIS2_CALL
sandesha2_property_bean_get_db_path(
Modified: webservices/sandesha/trunk/c/src/util/property_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/property_mgr.c?rev=619258&r1=619257&r2=619258&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/property_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/property_mgr.c Wed Feb 6 20:24:08 2008
@@ -96,6 +96,8 @@
SANDESHA2_DEF_VAL_MSG_TYPES_TO_DROP, property_bean);
sandesha2_property_bean_set_terminate_delay(property_bean, env,
SANDESHA2_TERMINATE_DELAY);
+ sandesha2_property_bean_set_polling_wait_time(property_bean, env,
+ SANDESHA2_POLLING_WAIT_TIME);
return property_bean;
}
@@ -219,6 +221,24 @@
if(0 < terminate_delay)
sandesha2_property_bean_set_terminate_delay(property_bean, env,
terminate_delay);
+ if(str)
+ AXIS2_FREE(env->allocator, str);
+ }
+ param = axis2_module_desc_get_param(module_desc, env,
+ SANDESHA2_POLLING_WAIT);
+ if(param)
+ {
+ int polling_wait_time = -1;
+ axis2_char_t *polling_wait_time_str = axutil_param_get_value(param, env);
+ axis2_char_t *str = sandesha2_utils_trim_string(env,
+ polling_wait_time_str);
+ if(str)
+ polling_wait_time = atoi(str);
+ else
+ polling_wait_time = SANDESHA2_POLLING_WAIT_TIME;
+ if(0 < polling_wait_time)
+ sandesha2_property_bean_set_polling_wait_time(property_bean, env,
+ polling_wait_time);
if(str)
AXIS2_FREE(env->allocator, str);
}
Modified: webservices/sandesha/trunk/c/src/util/sandesha2_utils.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/sandesha2_utils.c?rev=619258&r1=619257&r2=619258&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/sandesha2_utils.c (original)
+++ webservices/sandesha/trunk/c/src/util/sandesha2_utils.c Wed Feb 6 20:24:08 2008
@@ -26,7 +26,6 @@
#include <sandesha2_ack_requested.h>
#include <sandesha2_close_seq.h>
#include <sandesha2_close_seq_res.h>
-#include <sandesha2_polling_mgr.h>
#include <sandesha2_permanent_storage_mgr.h>
#include <axutil_string.h>
#include <axis2_conf.h>
@@ -389,44 +388,6 @@
persistent);
}
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
-sandesha2_utils_start_polling_mgr(
- const axutil_env_t *env,
- axis2_conf_ctx_t *conf_ctx,
- const axis2_char_t *internal_seq_id)
-{
- sandesha2_polling_mgr_t *polling_mgr = NULL;
- axutil_property_t *property = NULL;
- axis2_status_t status = AXIS2_FAILURE;
-
- AXIS2_PARAM_CHECK(env->error, conf_ctx, AXIS2_FAILURE);
-
- axutil_allocator_switch_to_global_pool(env->allocator);
- property = axis2_ctx_get_property(axis2_conf_ctx_get_base(conf_ctx, env),
- env, SANDESHA2_POLLING_MGR);
- if(property)
- polling_mgr = axutil_property_get_value(property, env);
-
- /* Assumes that if someone has set the polling_mgr, he must have already
- * started it
- */
- if(!polling_mgr)
- {
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
- "[sandesha2]Starting the polling manager");
- polling_mgr = sandesha2_polling_mgr_create(env);
- property = axutil_property_create_with_args(env, 0, AXIS2_FALSE,
- (void *)sandesha2_polling_mgr_free_void_arg, polling_mgr);
- axis2_ctx_set_property(axis2_conf_ctx_get_base(conf_ctx, env),
- env, SANDESHA2_POLLING_MGR, property);
- }
- status = sandesha2_polling_mgr_start(polling_mgr, env, conf_ctx,
- internal_seq_id);
- axutil_allocator_switch_to_local_pool(env->allocator);
- return status;
-}
-
-
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
sandesha2_utils_get_outgoing_internal_seq_id(
const axutil_env_t *env,
@@ -912,28 +873,6 @@
return AXIS2_SUCCESS;
}
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
-sandesha2_utils_stop_polling_mgr(
- const axutil_env_t *env,
- axis2_conf_ctx_t *conf_ctx)
-{
- sandesha2_polling_mgr_t *polling_mgr = NULL;
- axutil_property_t *property = NULL;
-
- AXIS2_PARAM_CHECK(env->error, conf_ctx, AXIS2_FAILURE);
-
- property = axis2_ctx_get_property(axis2_conf_ctx_get_base(conf_ctx, env),
- env, SANDESHA2_POLLING_MGR);
- if(property)
- polling_mgr = axutil_property_get_value(property, env);
-
- if(polling_mgr)
- {
- sandesha2_polling_mgr_stop_polling(polling_mgr, env);
- }
- return AXIS2_SUCCESS;
-}
-
/**
* Used to convert a message number list (a comma seperated list of message
* numbers) into a set of Acknowledgement Ranges. This breaks the list, sort
Modified: webservices/sandesha/trunk/c/src/workers/sender_worker.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/workers/sender_worker.c?rev=619258&r1=619257&r2=619258&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/sender_worker.c (original)
+++ webservices/sandesha/trunk/c/src/workers/sender_worker.c Wed Feb 6 20:24:08 2008
@@ -359,8 +359,14 @@
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
"[sandesha2]message of msg_type:%d successfully sent", msg_type);
if(AXIS2_FALSE == axis2_msg_ctx_get_server_side(msg_ctx, env))
+ {
sandesha2_sender_worker_check_for_sync_res(env, msg_ctx,
storage_mgr, msg_type);
+ if(msg_type == SANDESHA2_MSG_TYPE_MAKE_CONNECTION_MSG)
+ {
+ axis2_msg_ctx_set_response_soap_envelope(msg_ctx, env, NULL);
+ }
+ }
}
if(SANDESHA2_MSG_TYPE_TERMINATE_SEQ == msg_type)
{
Modified: webservices/sandesha/trunk/c/xdocs/docs/installationguide.html
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/xdocs/docs/installationguide.html?rev=619258&r1=619257&r2=619258&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/xdocs/docs/installationguide.html (original)
+++ webservices/sandesha/trunk/c/xdocs/docs/installationguide.html Wed Feb 6 20:24:08 2008
@@ -44,33 +44,43 @@
<h2>1. Installing and Running on Linux</h2>
<p>This can be done using binary or source distributions. (<a
-href="http://ws.apache.org/sandesha/sandesha2/c/download.cgi">Download</a> the two
-distributions)</p>
-
+href="http://ws.apache.org/sandesha/sandesha2/c/download.cgi">Download</a>
+the two distributions)</p>
<a id="linux_source"></a>
<h3>1.1. Installing Sandesha2/C Source Release on Linux</h3>
-<p>This version of Sandesha2/C depends on Axis2/C 1.1.0 <a href="http://ws.apache.org/axis2/c/download.cgi">Download Axis2/C</a> from and
-install. </p>
+<p>This version of Sandesha2/C depends on Axis2/C 1.3.0 <a
+href="http://ws.apache.org/axis2/c/download.cgi">Download Axis2/C</a> from
+and install.</p>
<ol>
- <li> Download Sandesha2 source distribution</li>
- <li> Extract the source distribution and go to extracted directory</li>
- <li> Run configure with AXIS2 include path.
- <pre>./configure --prefix=<axis2c_deploy_path> --enable-static=no --with-axis2=<axis2c_deploy_path></pre>
- </li>
- <li>Run make and make install</li>
+ <li>Download Sandesha2 source distribution</li>
+ <li>Extract the source distribution and go to extracted directory</li>
+ <li>Run configure with AXIS2 include path.
+ <pre>./configure --prefix=<axis2c_deploy_path> --enable-static=no --with-axis2=<axis2c_deploy_path></pre>
+ </li>
+ <li>Run make and make install</li>
</ol>
-
-This will install the Sandesha2/C as a module in Axis2/C in <axis2c_deploy_path>/modules folder. The module
-folder contains the Sandesha2/C libraries and the module.xml file.
+This will install the Sandesha2/C as a module in Axis2/C in
+<axis2c_deploy_path>/modules folder. The module folder contains the
+Sandesha2/C libraries and the module.xml file. <a id="linux_binary">It will
+also install the libsandesha2_client.so into <axis2c_deploy_path>lib
+folder. Sandesha2 include files are copied into
+<axis2c_deploy_path>include folder.</a>
+
+<p>To install the samples go into samples folder and do</p>
+<p> ./configure --prefix=<axis2c_deploy_path>
+--with-axis2=<axis2c_include_path></p>
-<a id="linux_binary"></a>
+<p>make</p>
+
+<p>make install</p>
<h3>1.2. Installing Sandesha2/C Binary Release on Linux</h3>
-<p>Sandesha2/C binary distribution for Linux has the following folder structure. </p>
+<p>Sandesha2/C binary distribution for Linux has the following folder
+structure.</p>
<pre>
Sandesha2
|
@@ -84,50 +94,47 @@
+ - services (Contain sample service)
|
+ - include ( header files)
- + - bin (database scripts)
+ - bin/samples ( sample executables)
-</pre>
-<p>
- To deploy Sandesha2/C in Axis2/C running environment copy the modules/sandesha2 into <axis2c_deploy_path>/modules folder.
- Do the necessary changes to the <axis2c_deploy_path>/axis2.xml to run Sandesha2/C(Refer to the sample config/axis2.xml
- for help).
-</p>
+ + - lib (libsandesha2_client.so)</pre>
+
+<p>To deploy Sandesha2/C in Axis2/C running environment copy the
+modules/sandesha2 into <axis2c_deploy_path>/modules folder. Also copy
+the libsandesha2_client.so into <axis2c_deploy_path>/lib folder. Do the
+necessary changes to the <axis2c_deploy_path>/axis2.xml to run
+Sandesha2/C(Refer to the sample config/axis2.xml for help). To run samples
+copy the server sample services/RMSampleService into
+<axis2c_deploy_path>/services folder and start the server. Then you can
+run the client samples in bin/samples/sandesha2. To see the messages passing
+through the wire use a Tcp Monitor.</p>
<a id="win"></a>
<h2>2. Installing and Running on Microsoft Windows</h2>
<p>This too can be done using binary or source distributions. (<a
-href="http://ws.apache.org/sandesha/sandesha2/c/download.cgi">Download</a> the two
-distributions.)</p>
-
+href="http://ws.apache.org/sandesha/sandesha2/c/download.cgi">Download</a>
+the two distributions.)</p>
<a id="win_source"></a>
<h3>2.1. Installing Sandesha2/C Source Release on Windows</h3>
<ol>
- <li> You need to have unziped Axis2/C 1.1.0 release binary to some folder.</li>
- <li> Sandesha2/C can be used with one of following two database systems.
- <ul>
- <li>sqlite</li>
- <li>MySQL</li>
- </ul>
- So install one of above database systems on your machine.
- </li>
- <li> On your cmd.exe cd to <sandesha2 src>\build\win32 <br/>
- Edit configure.in file with your binary locations. <br/>
- To select MySQL have your configure.in entry WITH_MYSQL = 1. <br/>
- To Select Sqlite have your configure.in entry WITH_SQLITE = 1.
- </li>
- <li> To set necessary environment variables on command line run vcvars32.bat file. </li>
- <li> Run nmake dist command on command line. This will build the Sandesha2/C binary and samples to a directory sandesha2 in <sandesha2 src>\build\sandesha2. </li>
+ <li>You need to have unzipped Axis2/C 1.3.0 release binary to some
+ folder.</li>
+ <li>On your cmd.exe cd to <sandesha2 src>\build\win32 <br />
+ Edit configure.in file with your binary locations. <br />
+ </li>
+ <li>To set necessary environment variables on command line run vcvars32.bat
+ file.</li>
+ <li>Run nmake dist command on command line. This will build the Sandesha2/C
+ binary and samples to a directory sandesha2 in <sandesha2
+ src>\build\sandesha2.</li>
</ol>
-
<a id="bin_binaries"></a>
<h3>2. 2. Installing Sandesha2/C Binary Release on Windows</h3>
-<p>Sandesha2/C binary distribution will have following directory structure. </p>
-<pre>
- Sandesha2
+<p>Sandesha2/C binary distribution will have following directory
+structure.</p>
+<pre> Sandesha2
|
+ - Sandesha2 (sandesha2 module dll and module.xml file)
|
@@ -138,58 +145,38 @@
+ - source files of samples in folders
|
+ - include ( header files)
-
+ + - lib (sandesha2_client.dll)
</pre>
- <ol>
- <li> Copy Sandesha2 directory ( containing sandesha2 dll and module.xml ) to <AXIS2C_HOME>\modules directory.</li>
- <li> Copy RMSampleService directory in samples\bin directory to <AXIS2C_HOME>\services directory </li>
- <li> Copy axis2.xml file in Sandesha2 directory to <AXIS2C_HOME> </li>
- </ol>
- <p>
- Now you should be able to run the samples.
- </p>
+<ol>
+ <li>Copy Sandesha2 directory ( containing sandesha2 dll and module.xml ) to
+ <AXIS2C_HOME>\modules directory.</li>
+ <li>Copy RMSampleService directory in samples\bin directory to
+ <AXIS2C_HOME>\services directory</li>
+ <li>Copy axis2.xml file in Sandesha2 directory to <AXIS2C_HOME></li>
+</ol>
+
+<p>Now you should be able to run the samples.</p>
<h3>Notes</h3>
<ol>
-<li>
- Sandesha2/C has two main storage mechanisms call in-memory and persistent. The persistent storage could use
- either sqlite or MySQL as it's database manager. <br/>
- By default sandesha2 use the persistent storage with sqlite as the database. <br/>
- It is assumed that sqlite3.h in /usr/include include directory. If you have different include path for
- sqlite3.h then add the configure option --with-sqlite=<sqlite include file path> to the configure options
- above. If is assumed that libsqlite3.so is in the /usr/lib folder <br/>
- To run samples in persistent/sqlite mode copy sandesha2c/config/sqlite_schema.sh/.bat to a directory where you
- will create your sqlite database file and execute it to create the database schema. sqlite3 is an embedded
- database which need no configuration. If you use Axis2/C Apache2 module instead of simple_axis2_server make
- sure that Apache2 user can access the sqlite database files sandesha2_svr_db and sandesha2_client_db. <br/>
-
- if you want to use the in-memory storage instead, change the entry in the sandesha2_constants.h
- file. <br/>
-<pre>#define SANDESHA2_DEFAULT_STORAGE_MGR "persistent"
-as
-#define SANDESHA2_DEFAULT_STORAGE_MGR "inmemory". </pre>
-
- <p>Or you can change the following entry in the module.xml file.</p>
- <p>
- <p><parameter name="StorageManager" locked="false">inmemory<parameter></p>
- <p><parameter name="StorageManager" locked="false">persistent<parameter></p>
- </p>
-
- <p>
- If you want to use persistent storage with MySQL then add the option --with-mysql=<MySQL include file path>
- to the configure options above. It is assumed that libmysqlclient.so is in /usr/lib folder. It is recommended
- to use MySQL database for any serious use. It is not included as as the default database because of licensing issues.
- To run samples in persistent/mysql mode run sandesha2c/config/mysql_schema.sh and sandesha2c/config/init_mysql.sh
- to create the database schema. The database parameters for MySQL should be included in module.xml. The defaults for server, user and password are localhost, g,g.
- </p>
-</li>
-<li>
- Sandesha2/C module is installed into <axis2c_deploy_path>/modules/sandesha2c directory. The installed module contain
- libsandesha2.so, module.xml. The sample clients are installed into <axis2c_deploy_path>/bin/samples
- directory. Sample services are installed into <axis2c_deploy_path>/services directory.
-
-</li>
+ <li>Sandesha2 internally uses an Sqlite3 embedded database. You need to
+ provide where to create this database in
+ <p>module.xml file as following.</p>
+ <p><parameter name="sandesha2_db"
+ locked="false"><path>/sandesha2_db</parameter></p>
+ <p>If you use Axis2/C Apache2 module instead of simple_axis2_server make
+ sure that Apache2 user can access the above database file.</p>
+ <p>If you do not provide the above database parameter, be aware that
+ Sandesha2/C will create the database file named sandesha2_db in the
+ current folder.</p>
+ <p></p>
+ </li>
+ <li>Sandesha2/C module is installed into
+ <axis2c_deploy_path>/modules/sandesha2c directory. The installed
+ module contain libsandesha2.so, module.xml. The sample clients are
+ installed into <axis2c_deploy_path>/bin/samples directory. Sample
+ services are installed into <axis2c_deploy_path>/services
+ directory.</li>
</ol>
-
</body>
</html>
Modified: webservices/sandesha/trunk/c/xdocs/docs/sandesha2c_manual.html
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/xdocs/docs/sandesha2c_manual.html?rev=619258&r1=619257&r2=619258&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/xdocs/docs/sandesha2c_manual.html (original)
+++ webservices/sandesha/trunk/c/xdocs/docs/sandesha2c_manual.html Wed Feb 6 20:24:08 2008
@@ -9,114 +9,51 @@
<body>
<h1>Engaging Sandesha2/C Module</h1>
-<p>
- Install sandesha2 module into <axis2 deploy folder>/modules folder. Add the RMPhase
- information into axis2.xml as following. Search for 'RMPhase' in the
- following xml block to identify the RM specific entries.
-</p>
-<pre>
- <!-- ================================================= -->
+
+<p>Install sandesha2 module into <axis2 deploy folder>/modules folder.
+Add the RMPhase information into axis2.xml as following. Search for 'RMPhase'
+in the following xml block to identify the RM specific entries.</p>
+<pre> <!-- ================================================= -->
<!-- Phases -->
<!-- ================================================= -->
<phaseOrder type="inflow">
- <!-- System pre defined phases -->
- <phase name="TransportIn"/>
+ <!-- System pre defined phases -->
+ <phase name="Transport"/>
<phase name="PreDispatch"/>
- <phase name="Dispatch">
- <handler name="AddressingBasedDispatcher"
- class="axis2_engine">
- <order phase="Dispatch"/>
- </handler>
- <handler name="RequestURIBasedDispatcher"
- class="axis2_engine">
- <order phase="Dispatch"/>
- </handler>
- <handler name="SOAPActionBasedDispatcher"
- class="axis2_engine">
- <order phase="Dispatch"/>
- </handler>
- <handler name="SOAPMessageBodyBasedDispatcher"
- class="axis2_engine">
- <order phase="Dispatch"/>
- </handler>
- </phase>
- <phase name="PostDispatch">
- <handler name="DispatchPostConditionsEvaluator"
- class="axis2_engine">
- <order phase="PostDispatch"/>
- </handler>
- <handler name="InstanceDispatcher"
- class="axis2_engine">
- <order phase="PostDispatch"/>
- </handler>
- <handler name="SOAPProcessingModelChecker"
- class="axis2_engine">
- <order phase="PostDispatch"/>
- </handler>
- </phase>
- <!-- System pre defined phases -->
- <!-- After Postdispatch phase module author or or service author can add any phase he want -->
+ <phase name="Dispatch"/>
+ <phase name="PostDispatch"/>
+ <!-- End system pre defined phases -->
+ <!-- After PostDispatch phase, module or service author can add any phase as required -->
+ <!-- User defined phases could be added here -->
<!--phase name="userphase1"/-->
<phase name="RMPhase"/>
</phaseOrder>
<phaseOrder type="outflow">
- <!-- user can add his own phases to this area -->
- <phase name="RMPhase"/>
+ <!-- User defined phases could be added here -->
+ <phase name="RMPhase"/>
+ <!--phase name="RMPhase"/-->
<!--phase name="userphase1"/-->
<!--system predefined phase-->
- <!--these phase will run irrespective of the service-->
- <!--phase name="PolicyDetermination"/-->
- <!--phase name="MessageOut"/-->
+ <phase name="MessageOut"/>
</phaseOrder>
<phaseOrder type="INfaultflow">
- <!-- user can add his own phases to this area -->
+ <!-- User defined phases could be added here -->
<!--phase name="userphase1"/-->
- <phase name="RMPhase"/>
+ <phase name="RMPhase"/>
</phaseOrder>
<phaseOrder type="Outfaultflow">
- <!-- user can add his own phases to this area -->
+ <!-- User defined phases could be added here -->
<phase name="RMPhase"/>
- <phase name="MessageOut"/>
<!--phase name="userphase1"/-->
- <!--phase name="PolicyDetermination"/-->
+ <phase name="MessageOut"/>
</phaseOrder>
+
</pre>
-<p>
-In the services xml file for the service which require RM enabled
-add the entry
- <module ref="sandesha2"/>
-If you need all services in the engine RM enabled add the above entry into
-axis2.xml.
-</p>
-<p>
-You can use samples in the samples folder for testing.
-</p>
-<h2>Known Issues</h2>
+<p>In the services xml file for the service which require RM enabled add the
+entry <module ref="sandesha2"/> If you need all services in the engine
+RM enabled add the above entry into axis2.xml.</p>
-Please keep in mind the following when using Sandesha2/C with Axis2/C.
-<ol>
-<li>Comment the line no:295 in src/core/transport/http/receiver/http_svr_thread.c
- <pre>axutil_free_thread_env(thread_env);</pre>
-</li>
-
-<li>Comment the line no:299 in src/core/transport/http/receiver/http_svr_thread.c
- <pre>axutil_thread_pool_exit_thread(env->thread_pool, thd);</pre>
-</li>
-<li>Comment the following block starting form line no:259 src/core/transport/http/sender/http_sender.c
-<pre>
- property = axutil_property_create(env);
- axutil_property_set_scope(property, env, AXIS2_SCOPE_REQUEST);
- axutil_property_set_free_func(property, env, axis2_http_client_free_void_arg);
- axutil_property_set_value(property, env, sender->client);
- axis2_msg_ctx_set_property(msg_ctx, env, AXIS2_HTTP_CLIENT, property);
-</pre>
-</li>
-<li>If for some reason RM sequences seems not executing properly the reason could
- be the database is corrupted for some reason. Try rerunning the the database
- scripts to clean the database.
-</li>
-</ol>
-Some of the above changes may lead to memory leaks in Axis2/C.
+<p>You can use samples in the samples folder for testing.</p>
</body>
</html>
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org