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 2007/12/07 05:40:35 UTC
svn commit: r601986 - in /webservices/sandesha/trunk/c: config/
src/msgprocessors/ src/storage/sqlite/ src/util/
Author: damitha
Date: Thu Dec 6 20:40:35 2007
New Revision: 601986
URL: http://svn.apache.org/viewvc?rev=601986&view=rev
Log:
there was a build break due to incomplete code commit.
Modified:
webservices/sandesha/trunk/c/config/module.xml
webservices/sandesha/trunk/c/src/msgprocessors/ack_msg_processor.c
webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
webservices/sandesha/trunk/c/src/storage/sqlite/permanent_bean_mgr.c
webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c
webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_bean_mgr.h
webservices/sandesha/trunk/c/src/util/sandesha2_utils.c
Modified: webservices/sandesha/trunk/c/config/module.xml
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/config/module.xml?rev=601986&r1=601985&r2=601986&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/config/module.xml (original)
+++ webservices/sandesha/trunk/c/config/module.xml Thu Dec 6 20:40:35 2007
@@ -74,8 +74,8 @@
<parameter name="db_password" locked="false">g</parameter>
<!-- General parameters -->
<parameter name="ExponentialBackoff" locked="false">AXIS2_FALSE</parameter>
- <parameter name="RetransmissionInterval" locked="false">1</parameter>
- <parameter name="AcknowledgementInterval" locked="false">1</parameter><!-- in seconds-->
+ <parameter name="RetransmissionInterval" locked="false">10</parameter>
+ <parameter name="AcknowledgementInterval" locked="false">10</parameter><!-- in seconds-->
<parameter name="InactivityTimeout" locked="false">10</parameter>
<parameter name="StorageManager" locked="false">persistent</parameter>
<parameter name="InvokeInOrder" locked="false">AXIS2_FALSE</parameter>
Modified: 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=601986&r1=601985&r2=601986&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/ack_msg_processor.c (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/ack_msg_processor.c Thu Dec 6 20:40:35 2007
@@ -322,6 +322,7 @@
}
str_list = sandesha2_utils_array_list_to_string(env, acked_list,
SANDESHA2_ARRAY_LIST_LONG);
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]acked_list:%s", str_list);
if(completed_bean)
{
sandesha2_seq_property_bean_set_value(completed_bean, env, str_list);
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=601986&r1=601985&r2=601986&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c Thu Dec 6 20:40:35 2007
@@ -926,7 +926,7 @@
}
if(!spec_ver)
spec_ver = sandesha2_spec_specific_consts_get_default_spec_version(env);
- AXIS2_LOG_INFO(env->log, "Spec version:%s", spec_ver);
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Spec version:%s", spec_ver);
if(1 == msg_number)
{
if(!out_seq_bean)
@@ -1131,9 +1131,12 @@
}
ack_rm_msg = sandesha2_ack_mgr_generate_ack_msg(env, rm_msg_ctx, seq_id,
storage_mgr);
- engine = axis2_engine_create(env, conf_ctx);
- msg_ctx = sandesha2_msg_ctx_get_msg_ctx(ack_rm_msg, env);
- sent = axis2_engine_send(engine, env, msg_ctx);
+ if(ack_rm_msg)
+ {
+ engine = axis2_engine_create(env, conf_ctx);
+ msg_ctx = sandesha2_msg_ctx_get_msg_ctx(ack_rm_msg, env);
+ sent = axis2_engine_send(engine, env, msg_ctx);
+ }
if(!sent)
{
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
@@ -1178,7 +1181,7 @@
axis2_op_ctx_t *temp_opctx = NULL;
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[Sandesha2] sandesha2_app_msg_processor_add_create_seq_msg");
+ "[Sandesha2]Entry:sandesha2_app_msg_processor_add_create_seq_msg");
AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, internal_seq_id, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, acks_to, AXIS2_FAILURE);
@@ -1281,7 +1284,7 @@
return AXIS2_FAILURE;
}
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
- "[Sandesha2] Exit:sandesha2_app_msg_processor_add_create_seq_msg");
+ "[Sandesha2]Exit:sandesha2_app_msg_processor_add_create_seq_msg");
return AXIS2_SUCCESS;
}
@@ -1337,6 +1340,7 @@
internal_seq_id, SANDESHA2_SEQ_PROP_REPLY_TO_EPR);
out_seq_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env,
internal_seq_id, SANDESHA2_SEQ_PROP_OUT_SEQ_ID);
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "dam_internal_seq_id:%s", internal_seq_id);
if (to_bean)
{
Modified: webservices/sandesha/trunk/c/src/storage/sqlite/permanent_bean_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/sqlite/permanent_bean_mgr.c?rev=601986&r1=601985&r2=601986&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/sqlite/permanent_bean_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/storage/sqlite/permanent_bean_mgr.c Thu Dec 6 20:40:35 2007
@@ -516,6 +516,8 @@
int rc = -1;
axis2_char_t sql_stmt_retrieve[512];
bean_mgr_impl = SANDESHA2_INTF_TO_IMPL(bean_mgr);
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
+ "[sandesha2]Entry:sandesha2_permanent_bean_mgr_retrieve_msg_store_bean");
axutil_thread_mutex_lock(bean_mgr_impl->mutex);
if(!bean_mgr_impl->dbconn)
bean_mgr_impl->dbconn = sandesha2_permanent_bean_mgr_get_dbconn(bean_mgr, env);
@@ -553,7 +555,113 @@
if(args)
AXIS2_FREE(env->allocator, args);
axutil_thread_mutex_unlock(bean_mgr_impl->mutex);
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
+ "[sandesha2]Exit:sandesha2_permanent_bean_mgr_retrieve_msg_store_bean");
return msg_store_bean;
+}
+
+axis2_bool_t AXIS2_CALL
+sandesha2_permanent_bean_mgr_update_msg_store_bean(
+ sandesha2_permanent_bean_mgr_t *bean_mgr,
+ const axutil_env_t *env,
+ axis2_char_t *key,
+ sandesha2_msg_store_bean_t *bean)
+{
+ axis2_char_t *sql_stmt_update = NULL;
+ axis2_char_t *error_msg = NULL;
+ int rc = -1;
+ int sql_size = -1;
+ axis2_char_t *msg_id = NULL;
+ axis2_char_t *stored_key = NULL;
+ axis2_char_t *soap_env_str = NULL;
+ int soap_version;
+ axis2_char_t *svc_grp = NULL;
+ axis2_char_t *svc = NULL;
+ axis2_char_t *op = NULL;
+ AXIS2_TRANSPORT_ENUMS transport_out = -1;
+ axis2_char_t *op_mep = NULL;
+ axis2_char_t *to_url = NULL;
+ axis2_char_t *reply_to = NULL;
+ axis2_char_t *transport_to = NULL;
+ axis2_char_t *execution_chain_str = NULL;
+ sandesha2_permanent_bean_mgr_impl_t *bean_mgr_impl = NULL;
+ int flow;
+ axis2_char_t *msg_recv_str = NULL;
+ axis2_bool_t svr_side = AXIS2_FALSE;
+ axis2_char_t *in_msg_store_key = NULL;
+ axis2_char_t *prop_str = NULL;
+ axis2_char_t *action = NULL;
+
+ bean_mgr_impl = SANDESHA2_INTF_TO_IMPL(bean_mgr);
+
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
+ "[sandesha2]Entry:sandesha2_permanent_bean_mgr_update_msg_store_bean");
+ msg_id = sandesha2_msg_store_bean_get_msg_id(bean, env);
+ stored_key = sandesha2_msg_store_bean_get_stored_key(bean, env);
+ soap_env_str = sandesha2_msg_store_bean_get_soap_envelope_str(bean, env);
+ soap_version = sandesha2_msg_store_bean_get_soap_version(bean, env);
+ transport_out = sandesha2_msg_store_bean_get_transport_out(bean, env);
+ op = sandesha2_msg_store_bean_get_op(bean, env);
+ svc = sandesha2_msg_store_bean_get_svc(bean, env);
+ svc_grp = sandesha2_msg_store_bean_get_svc_grp(bean, env);
+ op_mep = sandesha2_msg_store_bean_get_op_mep(bean, env);;
+ to_url = sandesha2_msg_store_bean_get_to_url(bean, env);
+ reply_to = sandesha2_msg_store_bean_get_reply_to(bean, env);
+ transport_to = sandesha2_msg_store_bean_get_transport_to(bean, env);
+ execution_chain_str = sandesha2_msg_store_bean_get_execution_chain_str(bean, env);
+ flow = sandesha2_msg_store_bean_get_flow(bean, env);
+ msg_recv_str = sandesha2_msg_store_bean_get_msg_recv_str(bean, env);
+ svr_side = sandesha2_msg_store_bean_is_svr_side(bean, env);
+ in_msg_store_key = sandesha2_msg_store_bean_get_in_msg_store_key(bean, env);
+ prop_str = sandesha2_msg_store_bean_get_persistent_property_str(bean, env);
+ action = sandesha2_msg_store_bean_get_action(bean, env);
+
+ sql_size = axutil_strlen(msg_id) + axutil_strlen(stored_key) +
+ axutil_strlen(soap_env_str) + sizeof(int) + sizeof(int) +
+ axutil_strlen(op) + axutil_strlen(svc) + axutil_strlen(svc_grp) +
+ axutil_strlen(op_mep) + axutil_strlen(to_url) + axutil_strlen(reply_to) +
+ axutil_strlen(transport_to) + axutil_strlen(execution_chain_str) + sizeof(int) +
+ axutil_strlen(msg_recv_str) + sizeof(int) + axutil_strlen(in_msg_store_key) +
+ axutil_strlen(prop_str) + axutil_strlen(action) + 512;
+
+ axutil_thread_mutex_lock(bean_mgr_impl->mutex);
+ if(!bean_mgr_impl->dbconn)
+ bean_mgr_impl->dbconn = sandesha2_permanent_bean_mgr_get_dbconn(bean_mgr, env);
+ if(!bean_mgr_impl->dbconn)
+ {
+ axutil_thread_mutex_unlock(bean_mgr_impl->mutex);
+ return AXIS2_FALSE;
+ }
+
+ sql_stmt_update = AXIS2_MALLOC(env->allocator, sql_size);
+ sprintf(sql_stmt_update, "update msg set msg_id='%s',"\
+ "soap_env_str='%s', soap_version=%d, transport_out='%d', op='%s',"\
+ "svc='%s', svc_grp='%s', op_mep='%s', to_url='%s',"\
+ "transport_to='%s', reply_to='%s', execution_chain_str='%s',"\
+ "flow=%d, msg_recv_str='%s', svr_side='%d', in_msg_store_key='%s',"\
+ "prop_str='%s', action='%s' where stored_key='%s'", msg_id,
+ soap_env_str, soap_version, transport_out, op, svc, svc_grp, op_mep,
+ to_url, transport_to, reply_to, execution_chain_str, flow,
+ msg_recv_str, svr_side, in_msg_store_key, prop_str, action, key);
+ rc = sqlite3_exec(bean_mgr_impl->dbconn, sql_stmt_update, 0, 0, &error_msg);
+ if(rc == SQLITE_BUSY)
+ rc = sandesha2_permanent_bean_mgr_busy_handler(env,
+ bean_mgr_impl->dbconn, sql_stmt_update, 0, 0, &error_msg, rc,
+ bean_mgr_impl->mutex);
+ if( rc != SQLITE_OK )
+ {
+ axutil_thread_mutex_unlock(bean_mgr_impl->mutex);
+ AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_SQL_ERROR, AXIS2_FAILURE);
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "sql error %s", error_msg);
+ AXIS2_FREE(env->allocator, sql_stmt_update);
+ sqlite3_free(error_msg);
+ return AXIS2_FALSE;
+ }
+ AXIS2_FREE(env->allocator, sql_stmt_update);
+ axutil_thread_mutex_unlock(bean_mgr_impl->mutex);
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
+ "[sandesha2]Exit:sandesha2_permanent_bean_mgr_update_msg_store_bean");
+ return AXIS2_TRUE;
}
axis2_bool_t AXIS2_CALL
Modified: webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c?rev=601986&r1=601985&r2=601986&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/storage/sqlite/permanent_storage_mgr.c Thu Dec 6 20:40:35 2007
@@ -214,11 +214,10 @@
const axutil_env_t *env,
axis2_msg_ctx_t *msg_ctx);
-axis2_status_t AXIS2_CALL
+static axis2_status_t AXIS2_CALL
sandesha2_permanent_storage_mgr_create_db(
- const axutil_env_t *env,
- axis2_conf_ctx_t *conf_ctx);
-
+ sandesha2_storage_mgr_t *storage_mgr,
+ const axutil_env_t *env);
static const sandesha2_storage_mgr_ops_t storage_mgr_ops =
{
@@ -267,11 +266,12 @@
axutil_allocator_switch_to_global_pool(env->allocator);
storage_mgr_impl->msg_ctx_map = axutil_hash_make(env);
axutil_allocator_switch_to_local_pool(env->allocator);
- if(!sandesha2_permanent_storage_mgr_create_db(env, conf_ctx))
- return NULL;
conf = axis2_conf_ctx_get_conf((const axis2_conf_ctx_t *) conf_ctx, env);
storage_mgr_impl->bean_mgr = sandesha2_permanent_bean_mgr_create(env,
&(storage_mgr_impl->storage_mgr), conf_ctx, NULL);
+ if(!sandesha2_permanent_storage_mgr_create_db(
+ &(storage_mgr_impl->storage_mgr), env))
+ return NULL;
storage_mgr_impl->create_seq_mgr = sandesha2_permanent_create_seq_mgr_create(
env, &(storage_mgr_impl->storage_mgr), conf_ctx);
storage_mgr_impl->next_msg_mgr = sandesha2_permanent_next_msg_mgr_create(
@@ -469,8 +469,22 @@
axis2_char_t *key,
axis2_msg_ctx_t *msg_ctx)
{
- return sandesha2_permanent_storage_mgr_store_msg_ctx(storage_mgr, env, key,
+ sandesha2_msg_store_bean_t *msg_store_bean = NULL;
+ sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
+ storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
+
+ axutil_allocator_switch_to_global_pool(env->allocator);
+ axutil_hash_set(storage_mgr_impl->msg_ctx_map, key, AXIS2_HASH_KEY_STRING,
msg_ctx);
+ axutil_allocator_switch_to_local_pool(env->allocator);
+ axis2_msg_ctx_set_keep_alive(msg_ctx, env, AXIS2_TRUE);
+ msg_store_bean = sandesha2_permanent_storage_mgr_get_msg_store_bean(
+ storage_mgr, env, msg_ctx);
+ sandesha2_msg_store_bean_set_stored_key(msg_store_bean, env, key);
+ sandesha2_permanent_bean_mgr_update_msg_store_bean(storage_mgr_impl->bean_mgr,
+ env, key, msg_store_bean);
+ return AXIS2_SUCCESS;
+
}
axis2_status_t AXIS2_CALL
@@ -1153,16 +1167,13 @@
return storage_mgr_impl->mutex;
}
-axis2_status_t AXIS2_CALL
+static axis2_status_t AXIS2_CALL
sandesha2_permanent_storage_mgr_create_db(
- const axutil_env_t *env,
- axis2_conf_ctx_t *conf_ctx)
+ sandesha2_storage_mgr_t *storage_mgr,
+ const axutil_env_t *env)
{
- axis2_conf_t *conf = NULL;
- axis2_char_t *path = ".";
int rc = -1;
sqlite3 *dbconn = NULL;
- axis2_char_t *db_name = NULL;
axis2_char_t *sql_stmt1 = NULL;
axis2_char_t *sql_stmt2 = NULL;
axis2_char_t *sql_stmt3 = NULL;
@@ -1171,34 +1182,11 @@
axis2_char_t *sql_stmt6 = NULL;
axis2_char_t *sql_stmt7 = NULL;
axis2_char_t *error_msg = NULL;
+ sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
- conf = axis2_conf_ctx_get_conf(conf_ctx, env);
- {
- axis2_module_desc_t *module_desc = NULL;
- axutil_qname_t *qname = NULL;
- qname = axutil_qname_create(env, SANDESHA2_MODULE, NULL, NULL);
- module_desc = axis2_conf_get_module(conf, env, qname);
- if(module_desc)
- {
- axutil_param_t *db_param = NULL;
- db_param = axis2_module_desc_get_param(module_desc, env, SANDESHA2_DB);
- if(db_param)
- {
- path = (axis2_char_t *) axutil_param_get_value(db_param, env);
- }
- }
- axutil_qname_free(qname, env);
- }
- db_name = axutil_strcat(env, path, AXIS2_PATH_SEP_STR, "sandesha2_db", NULL);
- rc = sqlite3_open(db_name, &dbconn);
- if(rc != SQLITE_OK)
- {
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Can't open database: %s"
- " sqlite error: %s\n", path, sqlite3_errmsg(dbconn));
- sqlite3_close(dbconn);
- dbconn = NULL;
- return AXIS2_FAILURE;
- }
+ storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
+ dbconn = sandesha2_permanent_bean_mgr_get_dbconn(storage_mgr_impl->bean_mgr,
+ env);
sql_stmt1 = "create table if not exists create_seq("\
"create_seq_msg_id varchar(100) primary key, "\
"internal_seq_id varchar(200), seq_id varchar(200), "\
Modified: webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_bean_mgr.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_bean_mgr.h?rev=601986&r1=601985&r2=601986&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_bean_mgr.h (original)
+++ webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_bean_mgr.h Thu Dec 6 20:40:35 2007
@@ -143,6 +143,13 @@
axis2_char_t *key);
axis2_bool_t AXIS2_CALL
+sandesha2_permanent_bean_mgr_update_msg_store_bean(
+ sandesha2_permanent_bean_mgr_t *bean_mgr,
+ const axutil_env_t *env,
+ axis2_char_t *key,
+ sandesha2_msg_store_bean_t *bean);
+
+axis2_bool_t AXIS2_CALL
sandesha2_permanent_bean_mgr_insert_msg_store_bean(
sandesha2_permanent_bean_mgr_t *bean_mgr,
const axutil_env_t *env,
@@ -180,13 +187,19 @@
int
sandesha2_permanent_bean_mgr_busy_handler(
+ const axutil_env_t *env,
sqlite3* dbconn,
char *sql_stmt,
int (*callback_func)(void *, int, char **, char **),
- void *arg,
+ void *args,
char **error_msg,
int rc,
axutil_thread_mutex_t *mutex);
+
+sqlite3 *
+sandesha2_permanent_bean_mgr_get_dbconn(
+ sandesha2_permanent_bean_mgr_t *bean_mgr,
+ const axutil_env_t *env);
/** @} */
#ifdef __cplusplus
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=601986&r1=601985&r2=601986&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/sandesha2_utils.c (original)
+++ webservices/sandesha/trunk/c/src/util/sandesha2_utils.c Thu Dec 6 20:40:35 2007
@@ -405,27 +405,13 @@
const axis2_bool_t persistent)
{
sandesha2_sender_t *sender = NULL;
- axis2_status_t status = AXIS2_FAILURE;
AXIS2_PARAM_CHECK(env->error, conf_ctx, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, seq_id, AXIS2_FAILURE);
- /*property = axis2_ctx_get_property(axis2_conf_ctx_get_base(conf_ctx, env),
- env, SANDESHA2_SENDER);
- if(property)
- sender = axutil_property_get_value(property, env);*/
-
- if(!sender)
- {
- sender = sandesha2_sender_create(env);
- /*property = axutil_property_create_with_args(env, AXIS2_SCOPE_APPLICATION,
- AXIS2_FALSE, (void *)sandesha2_sender_free_void_arg, sender);
- axis2_ctx_set_property(axis2_conf_ctx_get_base(conf_ctx, env),
- env, SANDESHA2_SENDER, property);*/
- }
- status = sandesha2_sender_run_for_seq(sender, env, conf_ctx, seq_id,
+ sender = sandesha2_sender_create(env);
+ return sandesha2_sender_run_for_seq(sender, env, conf_ctx, seq_id,
persistent);
- return status;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org