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/17 11:58:23 UTC
svn commit: r604820 [4/5] - in /webservices/sandesha/trunk/c: config/
include/ samples/rm_ping_1_0/ src/client/ src/core/ src/handlers/
src/msgprocessors/ src/polling/ src/storage/ src/storage/common/
src/storage/inmemory/ src/storage/sqlite/ src/trans...
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=604820&r1=604819&r2=604820&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 Mon Dec 17 02:58:17 2007
@@ -16,19 +16,9 @@
#include <platforms/axutil_platform_auto_sense.h>
#include <sandesha2_storage_mgr.h>
-#include <sandesha2_create_seq_mgr.h>
#include <sandesha2_permanent_storage_mgr.h>
#include "sandesha2_permanent_bean_mgr.h"
#include <sandesha2_msg_store_bean.h>
-#include "sandesha2_permanent_create_seq_mgr.h"
-#include <sandesha2_invoker_mgr.h>
-#include "sandesha2_permanent_invoker_mgr.h"
-#include <sandesha2_next_msg_mgr.h>
-#include "sandesha2_permanent_next_msg_mgr.h"
-#include <sandesha2_sender_mgr.h>
-#include "sandesha2_permanent_sender_mgr.h"
-#include <sandesha2_seq_property_mgr.h>
-#include "sandesha2_permanent_seq_property_mgr.h"
#include <sandesha2_property_bean.h>
#include <sandesha2_constants.h>
#include <sandesha2_error.h>
@@ -60,17 +50,7 @@
typedef struct sandesha2_permanent_storage_mgr
{
sandesha2_storage_mgr_t storage_mgr;
- axis2_char_t *SANDESHA2_MSG_MAP_KEY;
- sandesha2_create_seq_mgr_t *create_seq_mgr;
- sandesha2_next_msg_mgr_t *next_msg_mgr;
- sandesha2_seq_property_mgr_t *seq_property_mgr;
- sandesha2_sender_mgr_t *sender_mgr;
- sandesha2_invoker_mgr_t *invoker_mgr;
- axis2_conf_ctx_t *conf_ctx;
- axis2_char_t *db_name;
sandesha2_permanent_bean_mgr_t *bean_mgr;
- axutil_hash_t *msg_ctx_map;
- axutil_thread_mutex_t *mutex;
} sandesha2_permanent_storage_mgr_t;
#define SANDESHA2_INTF_TO_IMPL(trans) \
@@ -86,42 +66,6 @@
sandesha2_storage_mgr_t *storage,
const axutil_env_t *envv);
-sandesha2_create_seq_mgr_t *AXIS2_CALL
-sandesha2_permanent_storage_mgr_get_create_seq_mgr(
- sandesha2_storage_mgr_t *storage,
- const axutil_env_t *env);
-
-sandesha2_next_msg_mgr_t *AXIS2_CALL
-sandesha2_permanent_storage_mgr_get_next_msg_mgr(
- sandesha2_storage_mgr_t *storage,
- const axutil_env_t *env);
-
-sandesha2_sender_mgr_t *AXIS2_CALL
-sandesha2_permanent_storage_mgr_get_retrans_mgr(
- sandesha2_storage_mgr_t *storage,
- const axutil_env_t *env);
-
-sandesha2_seq_property_mgr_t *AXIS2_CALL
-sandesha2_permanent_storage_mgr_get_seq_property_mgr(
- sandesha2_storage_mgr_t *storage,
- const axutil_env_t *env);
-
-sandesha2_invoker_mgr_t *AXIS2_CALL
-sandesha2_permanent_storage_mgr_get_storage_map_mgr(
- sandesha2_storage_mgr_t *storage,
- const axutil_env_t *env);
-
-axis2_status_t AXIS2_CALL
-sandesha2_permanent_storage_mgr_set_ctx(
- sandesha2_storage_mgr_t *storage,
- const axutil_env_t *env,
- axis2_conf_ctx_t *conf_ctx);
-
-axis2_conf_ctx_t *AXIS2_CALL
-sandesha2_permanent_storage_mgr_get_ctx(
- sandesha2_storage_mgr_t *storage,
- const axutil_env_t *env);
-
axis2_status_t AXIS2_CALL
sandesha2_permanent_storage_mgr_init(
sandesha2_storage_mgr_t *storage,
@@ -154,7 +98,8 @@
sandesha2_permanent_storage_mgr_remove_msg_ctx(
sandesha2_storage_mgr_t *storage,
const axutil_env_t *env,
- axis2_char_t *key);
+ axis2_char_t *key,
+ axis2_conf_ctx_t *conf_ctx);
axis2_status_t AXIS2_CALL
sandesha2_permanent_storage_mgr_init_storage(
@@ -214,24 +159,10 @@
const axutil_env_t *env,
axis2_msg_ctx_t *msg_ctx);
-/*axis2_status_t AXIS2_CALL
-sandesha2_permanent_storage_mgr_create_db(
- sandesha2_storage_mgr_t *storage_mgr,
- const axutil_env_t *env);*/
-
static const sandesha2_storage_mgr_ops_t storage_mgr_ops =
{
sandesha2_permanent_storage_mgr_free,
sandesha2_permanent_storage_mgr_free_void_arg,
- NULL,
- NULL,
- sandesha2_permanent_storage_mgr_get_create_seq_mgr,
- sandesha2_permanent_storage_mgr_get_next_msg_mgr,
- sandesha2_permanent_storage_mgr_get_retrans_mgr,
- sandesha2_permanent_storage_mgr_get_seq_property_mgr,
- sandesha2_permanent_storage_mgr_get_storage_map_mgr,
- sandesha2_permanent_storage_mgr_set_ctx,
- sandesha2_permanent_storage_mgr_get_ctx,
sandesha2_permanent_storage_mgr_init,
sandesha2_permanent_storage_mgr_retrieve_msg_ctx,
sandesha2_permanent_storage_mgr_store_msg_ctx,
@@ -248,42 +179,16 @@
AXIS2_EXTERN sandesha2_storage_mgr_t * AXIS2_CALL
sandesha2_permanent_storage_mgr_create(
const axutil_env_t *env,
- axis2_conf_ctx_t *conf_ctx)
+ axis2_char_t *dbname)
{
sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
- axis2_conf_t *conf = NULL;
- AXIS2_ENV_CHECK(env, NULL);
storage_mgr_impl = AXIS2_MALLOC(env->allocator,
sizeof(sandesha2_permanent_storage_mgr_t));
- storage_mgr_impl->SANDESHA2_MSG_MAP_KEY = axutil_strdup(env,
- "Sandesha2MessageMap");
- storage_mgr_impl->conf_ctx = conf_ctx;
storage_mgr_impl->bean_mgr = NULL;
- storage_mgr_impl->mutex = axutil_thread_mutex_create(env->allocator,
- AXIS2_THREAD_MUTEX_DEFAULT);
- 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);
- 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(
- env, &(storage_mgr_impl->storage_mgr), conf_ctx);
- storage_mgr_impl->seq_property_mgr =
- sandesha2_permanent_seq_property_mgr_create(env,
- &(storage_mgr_impl->storage_mgr), conf_ctx);
- storage_mgr_impl->sender_mgr = sandesha2_permanent_sender_mgr_create(env,
- &(storage_mgr_impl->storage_mgr), conf_ctx);
- storage_mgr_impl->invoker_mgr = sandesha2_permanent_invoker_mgr_create(env,
- &(storage_mgr_impl->storage_mgr), conf_ctx);
-
+ dbname, NULL);
storage_mgr_impl->storage_mgr.ops = &storage_mgr_ops;
return &(storage_mgr_impl->storage_mgr);
@@ -306,43 +211,6 @@
sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
- if(storage_mgr_impl->create_seq_mgr)
- {
- sandesha2_create_seq_mgr_free(storage_mgr_impl->create_seq_mgr, env);
- storage_mgr_impl->create_seq_mgr = NULL;
- }
- if(storage_mgr_impl->create_seq_mgr)
- {
- sandesha2_create_seq_mgr_free(storage_mgr_impl->create_seq_mgr, env);
- storage_mgr_impl->create_seq_mgr = NULL;
- }
- if(storage_mgr_impl->next_msg_mgr)
- {
- sandesha2_next_msg_mgr_free(storage_mgr_impl->next_msg_mgr, env);
- storage_mgr_impl->next_msg_mgr = NULL;
- }
- if(storage_mgr_impl->sender_mgr)
- {
- sandesha2_sender_mgr_free(storage_mgr_impl->sender_mgr, env);
- storage_mgr_impl->sender_mgr = NULL;
- }
- if(storage_mgr_impl->seq_property_mgr)
- {
- sandesha2_seq_property_mgr_free(storage_mgr_impl->seq_property_mgr,
- env);
- storage_mgr_impl->seq_property_mgr = NULL;
- }
- if(storage_mgr_impl->invoker_mgr)
- {
- sandesha2_invoker_mgr_free(storage_mgr_impl->invoker_mgr, env);
- storage_mgr_impl->invoker_mgr = NULL;
- }
- if(storage_mgr_impl->SANDESHA2_MSG_MAP_KEY)
- {
- AXIS2_FREE(env->allocator, storage_mgr_impl->SANDESHA2_MSG_MAP_KEY);
- storage_mgr_impl->SANDESHA2_MSG_MAP_KEY = NULL;
- }
-
if(storage_mgr_impl)
{
AXIS2_FREE(env->allocator, storage_mgr_impl);
@@ -351,90 +219,12 @@
return AXIS2_SUCCESS;
}
-sandesha2_create_seq_mgr_t *AXIS2_CALL
-sandesha2_permanent_storage_mgr_get_create_seq_mgr(
- sandesha2_storage_mgr_t *storage_mgr,
- const axutil_env_t *env)
-{
- sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
- storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
- return storage_mgr_impl->create_seq_mgr;
-}
-
-sandesha2_next_msg_mgr_t *AXIS2_CALL
-sandesha2_permanent_storage_mgr_get_next_msg_mgr(
- sandesha2_storage_mgr_t *storage_mgr,
- const axutil_env_t *env)
-{
- sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
- storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
- return storage_mgr_impl->next_msg_mgr;
-}
-
-sandesha2_sender_mgr_t *AXIS2_CALL
-sandesha2_permanent_storage_mgr_get_retrans_mgr(
- sandesha2_storage_mgr_t *storage_mgr,
- const axutil_env_t *env)
-{
- sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
- storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
- return storage_mgr_impl->sender_mgr;
-}
-
-sandesha2_seq_property_mgr_t *AXIS2_CALL
-sandesha2_permanent_storage_mgr_get_seq_property_mgr(
- sandesha2_storage_mgr_t *storage_mgr,
- const axutil_env_t *env)
-{
- sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
- storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
-
- return storage_mgr_impl->seq_property_mgr;
-}
-
-sandesha2_invoker_mgr_t *AXIS2_CALL
-sandesha2_permanent_storage_mgr_get_storage_map_mgr(
- sandesha2_storage_mgr_t *storage_mgr,
- const axutil_env_t *env)
-{
- sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
- storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
- return storage_mgr_impl->invoker_mgr;
-}
-
-axis2_status_t AXIS2_CALL
-sandesha2_permanent_storage_mgr_set_ctx(
- sandesha2_storage_mgr_t *storage_mgr,
- const axutil_env_t *env,
- axis2_conf_ctx_t *conf_ctx)
-{
- sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
- storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
- AXIS2_PARAM_CHECK(env->error, conf_ctx, AXIS2_FAILURE);
- storage_mgr_impl->conf_ctx = conf_ctx;
- return AXIS2_SUCCESS;
-}
-
-axis2_conf_ctx_t *AXIS2_CALL
-sandesha2_permanent_storage_mgr_get_ctx(
- sandesha2_storage_mgr_t *storage_mgr,
- const axutil_env_t *env)
-{
- sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
- storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
- return storage_mgr_impl->conf_ctx;
-}
-
axis2_status_t AXIS2_CALL
sandesha2_permanent_storage_mgr_init(
sandesha2_storage_mgr_t *storage_mgr,
const axutil_env_t *env,
axis2_conf_ctx_t *conf_ctx)
{
- AXIS2_ENV_CHECK(env, AXIS2_FALSE);
-
- sandesha2_permanent_storage_mgr_set_ctx(storage_mgr, env, conf_ctx);
-
return AXIS2_SUCCESS;
}
@@ -448,11 +238,19 @@
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);
+ {
+ axis2_conf_ctx_t *conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
+ axutil_property_t *property = NULL;
+ axis2_ctx_t *ctx = axis2_conf_ctx_get_base(conf_ctx, env);
+ axutil_hash_t *msg_ctx_map = NULL;
- 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);
+ property = axis2_ctx_get_property(ctx, env, SANDESHA2_MSG_CTX_MAP);
+ if(property)
+ {
+ msg_ctx_map = axutil_property_get_value(property, env);
+ axutil_hash_set(msg_ctx_map, key, AXIS2_HASH_KEY_STRING, msg_ctx);
+ }
+ }
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);
@@ -472,11 +270,22 @@
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);
+ {
+ axis2_conf_ctx_t *conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
+ axutil_property_t *property = NULL;
+ axis2_ctx_t *ctx = axis2_conf_ctx_get_base(conf_ctx, env);
+ axutil_hash_t *msg_ctx_map = NULL;
+
+ property = axis2_ctx_get_property(ctx, env, SANDESHA2_MSG_CTX_MAP);
+ if(property)
+ {
+ msg_ctx_map = axutil_property_get_value(property, env);
+ if(msg_ctx_map)
+ axutil_hash_set(msg_ctx_map, key, AXIS2_HASH_KEY_STRING,
+ msg_ctx);
+ }
+ }
- 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);
@@ -491,214 +300,38 @@
sandesha2_permanent_storage_mgr_remove_msg_ctx(
sandesha2_storage_mgr_t *storage_mgr,
const axutil_env_t *env,
- axis2_char_t *key)
+ axis2_char_t *key,
+ axis2_conf_ctx_t *conf_ctx)
{
- void *entry = 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);
- if(storage_mgr_impl->msg_ctx_map)
- entry = axutil_hash_get(storage_mgr_impl->msg_ctx_map, key,
- AXIS2_HASH_KEY_STRING);
- if(entry)
- {
- axis2_op_ctx_t *op_ctx =
- axis2_msg_ctx_get_op_ctx((axis2_msg_ctx_t *) entry, env);
- axis2_op_ctx_set_in_use(op_ctx, env, AXIS2_FALSE);
- axutil_hash_set(storage_mgr_impl->msg_ctx_map, key,
- AXIS2_HASH_KEY_STRING, NULL);
- }
- axutil_allocator_switch_to_local_pool(env->allocator);
- sandesha2_permanent_bean_mgr_remove_msg_store_bean(
- storage_mgr_impl->bean_mgr, env, key);
- return AXIS2_SUCCESS;
-}
-
-axis2_status_t AXIS2_CALL
-sandesha2_permanent_storage_mgr_init_storage(
- sandesha2_storage_mgr_t *storage_mgr,
- const axutil_env_t *env,
- axis2_module_desc_t *module_desc)
-{
- return AXIS2_SUCCESS;
-}
-
-axiom_soap_envelope_t *AXIS2_CALL
-sandesha2_permanent_storage_mgr_retrieve_soap_envelope(
- sandesha2_storage_mgr_t *storage_mgr,
- const axutil_env_t *env,
- axis2_char_t *key)
-{
- /* TODO No real value */
- return NULL;
-}
-
-axis2_status_t AXIS2_CALL
-sandesha2_permanent_storage_mgr_store_soap_envelope(
- sandesha2_storage_mgr_t *storage_mgr,
- const axutil_env_t *env,
- axiom_soap_envelope_t *soap_env,
- axis2_char_t *key)
-{
- /* TODO No real value */
- return AXIS2_SUCCESS;
-}
-
-static sandesha2_msg_store_bean_t *AXIS2_CALL
-sandesha2_permanent_storage_mgr_get_msg_store_bean (
- sandesha2_storage_mgr_t *storage_mgr,
- const axutil_env_t *env,
- axis2_msg_ctx_t *msg_ctx)
-{
- axiom_soap_envelope_t *envelope = NULL;
- axis2_char_t *soap_str = NULL;
- int soap_version = 0;
- axiom_xml_writer_t *xml_writer = NULL;
- axiom_output_t *om_output = NULL;
- axis2_transport_out_desc_t *transport_out_desc = NULL;
- axis2_svc_grp_t *svc_grp = NULL;
- axis2_char_t *transport_to = NULL;
- axis2_svc_t *svc = NULL;
- axis2_op_t *op = NULL;
- axis2_endpoint_ref_t *to = NULL;
- axis2_endpoint_ref_t *reply_to = NULL;
- axis2_char_t *address = NULL;
- axis2_char_t *action = NULL;
- axutil_property_t *property = NULL;
- axis2_options_t *options = NULL;
- axis2_char_t *prop_str = NULL;
- axis2_op_ctx_t *op_ctx = NULL;
- sandesha2_msg_store_bean_t *bean = NULL;
-
- envelope = axis2_msg_ctx_get_soap_envelope(msg_ctx, env);
- if (!envelope)
- {
- AXIS2_ERROR_SET(env->error,
- AXIS2_ERROR_NULL_SOAP_ENVELOPE_IN_MSG_CTX,
- AXIS2_FAILURE);
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s",
- AXIS2_ERROR_GET_MESSAGE(env->error));
- return AXIS2_FAILURE;
- }
- xml_writer = axiom_xml_writer_create_for_memory(env, NULL,
- AXIS2_TRUE, 0, AXIS2_XML_PARSER_TYPE_BUFFER);
- if (!xml_writer)
- {
- return AXIS2_FAILURE;
- }
- om_output = axiom_output_create(env, xml_writer);
- if (!om_output)
- {
- axiom_xml_writer_free(xml_writer, env);
- xml_writer = NULL;
- return AXIS2_FAILURE;
- }
- axiom_output_set_soap11(om_output, env, axis2_msg_ctx_get_is_soap_11(
- msg_ctx, env));
- axiom_soap_envelope_serialize(envelope, env, om_output, AXIS2_FALSE);
- soap_str = (axis2_char_t *)axiom_xml_writer_get_xml(xml_writer, env);
- if (axis2_msg_ctx_get_is_soap_11(msg_ctx, env))
- soap_version = SANDESHA2_SOAP_VERSION_1_1;
- else
- soap_version = SANDESHA2_SOAP_VERSION_1_2;
- bean = sandesha2_msg_store_bean_create(env);
- transport_out_desc = axis2_msg_ctx_get_transport_out_desc(msg_ctx, env);
- svc_grp = axis2_msg_ctx_get_svc_grp(msg_ctx, env);
- svc = axis2_msg_ctx_get_svc(msg_ctx, env);
- op = axis2_msg_ctx_get_op(msg_ctx, env);
- if(transport_out_desc)
- {
- AXIS2_TRANSPORT_ENUMS transport_out = axis2_transport_out_desc_get_enum(
- transport_out_desc, env);
- sandesha2_msg_store_bean_set_transport_out(bean, env, transport_out);
- }
- if(svc_grp)
- {
- axis2_char_t *svc_grp_name = (axis2_char_t *) axis2_svc_grp_get_name(
- svc_grp, env);
- sandesha2_msg_store_bean_set_svc_grp(bean, env, svc_grp_name);
- }
- if (svc)
- {
- axis2_char_t *svc_name = (axis2_char_t *) axis2_svc_get_name(svc, env);
- sandesha2_msg_store_bean_set_svc(bean, env, svc_name);
- }
- if(op)
- {
- axutil_qname_t *qname = (axutil_qname_t *) axis2_op_get_qname(op, env);
- axis2_char_t *mep = NULL;
- if(qname)
- {
- axis2_char_t *op_name = axutil_qname_to_string(qname, env);
- sandesha2_msg_store_bean_set_op(bean, env, op_name);
- }
- mep = (axis2_char_t *) axis2_op_get_msg_exchange_pattern(op, env);
- sandesha2_msg_store_bean_set_op_mep(bean, env, mep);
- }
- sandesha2_msg_store_bean_set_flow(bean, env, axis2_msg_ctx_get_flow(msg_ctx,
- env));
- sandesha2_msg_store_bean_set_svr_side(bean, env,
- axis2_msg_ctx_get_server_side(msg_ctx, env));
- sandesha2_msg_store_bean_set_soap_envelope_str(bean, env, soap_str);
- sandesha2_msg_store_bean_set_soap_version(bean, env, soap_version);
- sandesha2_msg_store_bean_set_msg_id(bean, env, (axis2_char_t *)
- axis2_msg_ctx_get_msg_id(msg_ctx, env));
- to = axis2_msg_ctx_get_to(msg_ctx, env);
- if(to)
- {
- address = (axis2_char_t *) axis2_endpoint_ref_get_address(to, env);
- sandesha2_msg_store_bean_set_to_url(bean, env, address);
- }
- reply_to = axis2_msg_ctx_get_reply_to(msg_ctx, env);
- if(reply_to)
+ storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
{
- address = (axis2_char_t *) axis2_endpoint_ref_get_address(reply_to, env);
- sandesha2_msg_store_bean_set_reply_to(bean, env, address);
- }
- transport_to = axis2_msg_ctx_get_transport_url(msg_ctx, env);
- if(transport_to)
- sandesha2_msg_store_bean_set_transport_to(bean, env, transport_to);
+ void *entry = NULL;
+ axutil_property_t *property = NULL;
+ axis2_ctx_t *ctx = axis2_conf_ctx_get_base(conf_ctx, env);
+ axutil_hash_t *msg_ctx_map = NULL;
- options = (axis2_options_t *) axis2_msg_ctx_get_options(msg_ctx, env);
- action = (axis2_char_t *) axis2_options_get_action(options, env);
- sandesha2_msg_store_bean_set_action(bean, env, action);
- prop_str = sandesha2_permanent_storage_mgr_get_property_string(env, msg_ctx);
- if (prop_str)
- sandesha2_msg_store_bean_set_persistent_property_str(bean, env,
- prop_str);
-
- /* setting the request message if this a response message.*/
- op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
- if(op_ctx)
- {
- axis2_msg_ctx_t *in_msg_ctx = NULL;
- in_msg_ctx = axis2_op_ctx_get_msg_ctx(op_ctx, env,
- AXIS2_WSDL_MESSAGE_LABEL_IN);
- if(in_msg_ctx)
+ property = axis2_ctx_get_property(ctx, env, SANDESHA2_MSG_CTX_MAP);
+ if(property)
{
- axis2_char_t *in_msg_store_key = NULL;
- axis2_bool_t insert = AXIS2_FALSE;
- property = axis2_msg_ctx_get_property(msg_ctx, env,
- SANDESHA2_IN_MESSAGE_STORAGE_KEY);
- if(property)
- in_msg_store_key = (axis2_char_t *) axutil_property_get_value(
- property, env);
- if(!in_msg_store_key)
+ msg_ctx_map = axutil_property_get_value(property, env);
+ if(msg_ctx_map)
+ entry = axutil_hash_get(msg_ctx_map, key, AXIS2_HASH_KEY_STRING);
+ if(entry)
{
- in_msg_store_key = (axis2_char_t *) axutil_uuid_gen(env);
- insert = AXIS2_TRUE;
+ axis2_op_ctx_t *op_ctx = NULL;
+ axutil_allocator_switch_to_global_pool(env->allocator);
+ op_ctx =
+ axis2_msg_ctx_get_op_ctx((axis2_msg_ctx_t *) entry, env);
+ axis2_op_ctx_set_in_use(op_ctx, env, AXIS2_FALSE);
+ axutil_allocator_switch_to_local_pool(env->allocator);
+ axutil_hash_set(msg_ctx_map, key, AXIS2_HASH_KEY_STRING, NULL);
}
- /*if(insert)
- sandesha2_permanent_storage_mgr_store_msg_ctx(storage_mgr, env,
- in_msg_store_key, in_msg_ctx);
- else
- sandesha2_permanent_storage_mgr_update_msg_ctx(storage_mgr, env,
- in_msg_store_key, in_msg_ctx);*/
- sandesha2_msg_store_bean_set_in_msg_store_key(bean, env,
- in_msg_store_key);
}
}
- return bean;
+ sandesha2_permanent_bean_mgr_remove_msg_store_bean(
+ storage_mgr_impl->bean_mgr, env, key);
+ return AXIS2_SUCCESS;
}
axis2_msg_ctx_t * AXIS2_CALL
@@ -737,8 +370,19 @@
storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
if(!persistent)
- msg_ctx = (axis2_msg_ctx_t *) axutil_hash_get(
- storage_mgr_impl->msg_ctx_map, key, AXIS2_HASH_KEY_STRING);
+ {
+ axutil_property_t *property = NULL;
+ axis2_ctx_t *ctx = axis2_conf_ctx_get_base(conf_ctx, env);
+ axutil_hash_t *msg_ctx_map = NULL;
+
+ property = axis2_ctx_get_property(ctx, env, SANDESHA2_MSG_CTX_MAP);
+ if(property)
+ {
+ msg_ctx_map = axutil_property_get_value(property, env);
+ msg_ctx = (axis2_msg_ctx_t *) axutil_hash_get(msg_ctx_map, key,
+ AXIS2_HASH_KEY_STRING);
+ }
+ }
if(msg_ctx)
return msg_ctx;
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]retrieved from database");
@@ -946,6 +590,193 @@
return msg_ctx;
}
+axis2_status_t AXIS2_CALL
+sandesha2_permanent_storage_mgr_init_storage(
+ sandesha2_storage_mgr_t *storage_mgr,
+ const axutil_env_t *env,
+ axis2_module_desc_t *module_desc)
+{
+ return AXIS2_SUCCESS;
+}
+
+axiom_soap_envelope_t *AXIS2_CALL
+sandesha2_permanent_storage_mgr_retrieve_soap_envelope(
+ sandesha2_storage_mgr_t *storage_mgr,
+ const axutil_env_t *env,
+ axis2_char_t *key)
+{
+ /* TODO No real value */
+ return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+sandesha2_permanent_storage_mgr_store_soap_envelope(
+ sandesha2_storage_mgr_t *storage_mgr,
+ const axutil_env_t *env,
+ axiom_soap_envelope_t *soap_env,
+ axis2_char_t *key)
+{
+ /* TODO No real value */
+ return AXIS2_SUCCESS;
+}
+
+static sandesha2_msg_store_bean_t *AXIS2_CALL
+sandesha2_permanent_storage_mgr_get_msg_store_bean (
+ sandesha2_storage_mgr_t *storage_mgr,
+ const axutil_env_t *env,
+ axis2_msg_ctx_t *msg_ctx)
+{
+ axiom_soap_envelope_t *envelope = NULL;
+ axis2_char_t *soap_str = NULL;
+ int soap_version = 0;
+ axiom_xml_writer_t *xml_writer = NULL;
+ axiom_output_t *om_output = NULL;
+ axis2_transport_out_desc_t *transport_out_desc = NULL;
+ axis2_svc_grp_t *svc_grp = NULL;
+ axis2_char_t *transport_to = NULL;
+ axis2_svc_t *svc = NULL;
+ axis2_op_t *op = NULL;
+ axis2_endpoint_ref_t *to = NULL;
+ axis2_endpoint_ref_t *reply_to = NULL;
+ axis2_char_t *address = NULL;
+ axis2_char_t *action = NULL;
+ axutil_property_t *property = NULL;
+ axis2_options_t *options = NULL;
+ axis2_char_t *prop_str = NULL;
+ axis2_op_ctx_t *op_ctx = NULL;
+ sandesha2_msg_store_bean_t *bean = NULL;
+
+ envelope = axis2_msg_ctx_get_soap_envelope(msg_ctx, env);
+ if (!envelope)
+ {
+ AXIS2_ERROR_SET(env->error,
+ AXIS2_ERROR_NULL_SOAP_ENVELOPE_IN_MSG_CTX,
+ AXIS2_FAILURE);
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s",
+ AXIS2_ERROR_GET_MESSAGE(env->error));
+ return AXIS2_FAILURE;
+ }
+ xml_writer = axiom_xml_writer_create_for_memory(env, NULL,
+ AXIS2_TRUE, 0, AXIS2_XML_PARSER_TYPE_BUFFER);
+ if (!xml_writer)
+ {
+ return AXIS2_FAILURE;
+ }
+ om_output = axiom_output_create(env, xml_writer);
+ if (!om_output)
+ {
+ axiom_xml_writer_free(xml_writer, env);
+ xml_writer = NULL;
+ return AXIS2_FAILURE;
+ }
+ axiom_output_set_soap11(om_output, env, axis2_msg_ctx_get_is_soap_11(
+ msg_ctx, env));
+ axiom_soap_envelope_serialize(envelope, env, om_output, AXIS2_FALSE);
+ soap_str = (axis2_char_t *)axiom_xml_writer_get_xml(xml_writer, env);
+ if (axis2_msg_ctx_get_is_soap_11(msg_ctx, env))
+ soap_version = SANDESHA2_SOAP_VERSION_1_1;
+ else
+ soap_version = SANDESHA2_SOAP_VERSION_1_2;
+ bean = sandesha2_msg_store_bean_create(env);
+ transport_out_desc = axis2_msg_ctx_get_transport_out_desc(msg_ctx, env);
+ svc_grp = axis2_msg_ctx_get_svc_grp(msg_ctx, env);
+ svc = axis2_msg_ctx_get_svc(msg_ctx, env);
+ op = axis2_msg_ctx_get_op(msg_ctx, env);
+ if(transport_out_desc)
+ {
+ AXIS2_TRANSPORT_ENUMS transport_out = axis2_transport_out_desc_get_enum(
+ transport_out_desc, env);
+ sandesha2_msg_store_bean_set_transport_out(bean, env, transport_out);
+ }
+ if(svc_grp)
+ {
+ axis2_char_t *svc_grp_name = (axis2_char_t *) axis2_svc_grp_get_name(
+ svc_grp, env);
+ sandesha2_msg_store_bean_set_svc_grp(bean, env, svc_grp_name);
+ }
+ if (svc)
+ {
+ axis2_char_t *svc_name = (axis2_char_t *) axis2_svc_get_name(svc, env);
+ sandesha2_msg_store_bean_set_svc(bean, env, svc_name);
+ }
+ if(op)
+ {
+ axutil_qname_t *qname = (axutil_qname_t *) axis2_op_get_qname(op, env);
+ axis2_char_t *mep = NULL;
+ if(qname)
+ {
+ axis2_char_t *op_name = axutil_qname_to_string(qname, env);
+ sandesha2_msg_store_bean_set_op(bean, env, op_name);
+ }
+ mep = (axis2_char_t *) axis2_op_get_msg_exchange_pattern(op, env);
+ sandesha2_msg_store_bean_set_op_mep(bean, env, mep);
+ }
+ sandesha2_msg_store_bean_set_flow(bean, env, axis2_msg_ctx_get_flow(msg_ctx,
+ env));
+ sandesha2_msg_store_bean_set_svr_side(bean, env,
+ axis2_msg_ctx_get_server_side(msg_ctx, env));
+ sandesha2_msg_store_bean_set_soap_envelope_str(bean, env, soap_str);
+ sandesha2_msg_store_bean_set_soap_version(bean, env, soap_version);
+ sandesha2_msg_store_bean_set_msg_id(bean, env, (axis2_char_t *)
+ axis2_msg_ctx_get_msg_id(msg_ctx, env));
+ to = axis2_msg_ctx_get_to(msg_ctx, env);
+ if(to)
+ {
+ address = (axis2_char_t *) axis2_endpoint_ref_get_address(to, env);
+ sandesha2_msg_store_bean_set_to_url(bean, env, address);
+ }
+ reply_to = axis2_msg_ctx_get_reply_to(msg_ctx, env);
+ if(reply_to)
+ {
+ address = (axis2_char_t *) axis2_endpoint_ref_get_address(reply_to, env);
+ sandesha2_msg_store_bean_set_reply_to(bean, env, address);
+ }
+ transport_to = axis2_msg_ctx_get_transport_url(msg_ctx, env);
+ if(transport_to)
+ sandesha2_msg_store_bean_set_transport_to(bean, env, transport_to);
+
+ options = (axis2_options_t *) axis2_msg_ctx_get_options(msg_ctx, env);
+ action = (axis2_char_t *) axis2_options_get_action(options, env);
+ sandesha2_msg_store_bean_set_action(bean, env, action);
+ prop_str = sandesha2_permanent_storage_mgr_get_property_string(env, msg_ctx);
+ if (prop_str)
+ sandesha2_msg_store_bean_set_persistent_property_str(bean, env,
+ prop_str);
+
+ /* setting the request message if this a response message.*/
+ op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
+ if(op_ctx)
+ {
+ axis2_msg_ctx_t *in_msg_ctx = NULL;
+ in_msg_ctx = axis2_op_ctx_get_msg_ctx(op_ctx, env,
+ AXIS2_WSDL_MESSAGE_LABEL_IN);
+ if(in_msg_ctx)
+ {
+ axis2_char_t *in_msg_store_key = NULL;
+ axis2_bool_t insert = AXIS2_FALSE;
+ property = axis2_msg_ctx_get_property(msg_ctx, env,
+ SANDESHA2_IN_MESSAGE_STORAGE_KEY);
+ if(property)
+ in_msg_store_key = (axis2_char_t *) axutil_property_get_value(
+ property, env);
+ if(!in_msg_store_key)
+ {
+ in_msg_store_key = (axis2_char_t *) axutil_uuid_gen(env);
+ insert = AXIS2_TRUE;
+ }
+ /*if(insert)
+ sandesha2_permanent_storage_mgr_store_msg_ctx(storage_mgr, env,
+ in_msg_store_key, in_msg_ctx);
+ else
+ sandesha2_permanent_storage_mgr_update_msg_ctx(storage_mgr, env,
+ in_msg_store_key, in_msg_ctx);*/
+ sandesha2_msg_store_bean_set_in_msg_store_key(bean, env,
+ in_msg_store_key);
+ }
+ }
+ return bean;
+}
+
static axis2_char_t *AXIS2_CALL
sandesha2_permanent_storage_mgr_get_property_string(
const axutil_env_t *env,
@@ -1157,22 +988,13 @@
storage_mgr_impl->bean_mgr, env, seq_id, msg_no);
}
-axutil_thread_mutex_t *
-sandesha2_permanent_storage_mgr_get_mutex(
- sandesha2_storage_mgr_t *storage_mgr,
- const axutil_env_t *env)
-{
- sandesha2_permanent_storage_mgr_t *storage_mgr_impl = NULL;
- storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
- return storage_mgr_impl->mutex;
-}
-
axis2_status_t AXIS2_CALL
sandesha2_permanent_storage_mgr_create_db(
- sandesha2_storage_mgr_t *storage_mgr,
- const axutil_env_t *env)
+ const axutil_env_t *env,
+ axis2_conf_ctx_t *conf_ctx)
{
int rc = -1;
+ axis2_char_t *dbname = NULL;
sqlite3 *dbconn = NULL;
axis2_char_t *sql_stmt1 = NULL;
axis2_char_t *sql_stmt2 = NULL;
@@ -1182,11 +1004,18 @@
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;
-
- storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
- dbconn = sandesha2_permanent_bean_mgr_get_dbconn(storage_mgr_impl->bean_mgr,
- env);
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
+ "[sandesha2]Entry:sandesha2_permanent_storage_mgr_create_db");
+ dbname = sandesha2_util_get_dbname(env, conf_ctx);
+ dbconn = sandesha2_permanent_bean_mgr_get_dbconn(env,
+ dbname);
+ #if !defined(WIN32)
+ {
+ axis2_char_t permission_str[256];
+ sprintf(permission_str, "chmod 777 %s", dbname);
+ system(permission_str);
+ }
+ #endif
sql_stmt1 = "create table create_seq("\
"create_seq_msg_id varchar(100) primary key, "\
"internal_seq_id varchar(200), seq_id varchar(200), "\
@@ -1227,7 +1056,7 @@
"SQL Error: %s", error_msg);
sqlite3_free(error_msg);
sqlite3_close(dbconn);
- /*return AXIS2_FAILURE;*/
+ return AXIS2_SUCCESS;
}
rc = sqlite3_exec(dbconn, sql_stmt2, NULL, 0, &error_msg);
if( rc != SQLITE_OK )
@@ -1294,6 +1123,8 @@
}
else
return AXIS2_FAILURE;
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
+ "[sandesha2]Exit:sandesha2_permanent_storage_mgr_create_db");
return AXIS2_SUCCESS;
}
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=604820&r1=604819&r2=604820&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 Mon Dec 17 02:58:17 2007
@@ -40,8 +40,6 @@
typedef struct sandesha2_bean_mgr_args sandesha2_bean_mgr_args_t;
typedef struct sandesha2_permanent_bean_mgr sandesha2_permanent_bean_mgr_t;
typedef struct sandesha2_permanent_bean_mgr_ops sandesha2_permanent_bean_mgr_ops_t;
-struct sandesha2_storage_mgr;
-struct axis2_conf_ctx;
struct sandesha2_response;
AXIS2_DECLARE_DATA struct sandesha2_permanent_bean_mgr_ops
@@ -68,8 +66,7 @@
AXIS2_EXTERN sandesha2_permanent_bean_mgr_t * AXIS2_CALL
sandesha2_permanent_bean_mgr_create(
const axutil_env_t *env,
- struct sandesha2_storage_mgr *storage_mgr,
- struct axis2_conf_ctx *conf_ctx,
+ axis2_char_t *dbname,
axis2_char_t *key);
void AXIS2_CALL
@@ -196,8 +193,8 @@
sqlite3 *
sandesha2_permanent_bean_mgr_get_dbconn(
- sandesha2_permanent_bean_mgr_t *bean_mgr,
- const axutil_env_t *env);
+ const axutil_env_t *env,
+ axis2_char_t *dbname);
/** @} */
#ifdef __cplusplus
Modified: webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_create_seq_mgr.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_create_seq_mgr.h?rev=604820&r1=604819&r2=604820&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_create_seq_mgr.h (original)
+++ webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_create_seq_mgr.h Mon Dec 17 02:58:17 2007
@@ -33,9 +33,6 @@
{
#endif
-struct sandesha2_storage_mgr;
-struct axis2_conf_ctx;
-
/** @defgroup sandesha2_permanent_create_seq_mgr Permanat Create Sequence Manager
* @ingroup sandesha2
* @{
@@ -44,8 +41,7 @@
AXIS2_EXTERN struct sandesha2_create_seq_mgr * AXIS2_CALL
sandesha2_permanent_create_seq_mgr_create(
const axutil_env_t *env,
- struct sandesha2_storage_mgr *storage_mgr,
- struct axis2_conf_ctx *ctx);
+ axis2_char_t *dbname);
/** @} */
#ifdef __cplusplus
Modified: webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_invoker_mgr.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_invoker_mgr.h?rev=604820&r1=604819&r2=604820&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_invoker_mgr.h (original)
+++ webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_invoker_mgr.h Mon Dec 17 02:58:17 2007
@@ -33,9 +33,6 @@
{
#endif
-struct sandesha2_storage_mgr;
-struct axis2_conf_ctx;
-
/** @defgroup sandesha2_permanent_invoker_mgr Permanat Invoker Manager
* @ingroup sandesha2
* @{
@@ -44,8 +41,7 @@
AXIS2_EXTERN struct sandesha2_invoker_mgr * AXIS2_CALL
sandesha2_permanent_invoker_mgr_create(
const axutil_env_t *env,
- struct sandesha2_storage_mgr *storage_mgr,
- struct axis2_conf_ctx *ctx);
+ axis2_char_t *dbname);
/** @} */
#ifdef __cplusplus
Modified: webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_next_msg_mgr.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_next_msg_mgr.h?rev=604820&r1=604819&r2=604820&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_next_msg_mgr.h (original)
+++ webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_next_msg_mgr.h Mon Dec 17 02:58:17 2007
@@ -33,19 +33,15 @@
{
#endif
-struct sandesha2_storage_mgr;
-struct axis2_conf_ctx;
-
/** @defgroup sandesha2_permanent_next_msg_mgr Permanat Next Message Manager
* @ingroup sandesha2
* @{
*/
-AXIS2_EXTERN struct sandesha2_next_msg_mgr * AXIS2_CALL
+struct sandesha2_next_msg_mgr * AXIS2_CALL
sandesha2_permanent_next_msg_mgr_create(
const axutil_env_t *env,
- struct sandesha2_storage_mgr *storage_mgr,
- struct axis2_conf_ctx *ctx);
+ axis2_char_t *dbname);
/** @} */
#ifdef __cplusplus
Modified: webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_sender_mgr.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_sender_mgr.h?rev=604820&r1=604819&r2=604820&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_sender_mgr.h (original)
+++ webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_sender_mgr.h Mon Dec 17 02:58:17 2007
@@ -33,9 +33,6 @@
{
#endif
-struct sandesha2_storage_mgr;
-struct axis2_conf_ctx;
-
/** @defgroup sandesha2_permanent_sender_mgr Permanat Sender Manager
* @ingroup sandesha2
* @{
@@ -44,8 +41,7 @@
AXIS2_EXTERN struct sandesha2_sender_mgr * AXIS2_CALL
sandesha2_permanent_sender_mgr_create(
const axutil_env_t *env,
- struct sandesha2_storage_mgr *storage_mgr,
- struct axis2_conf_ctx *ctx);
+ axis2_char_t *dbname);
/** @} */
#ifdef __cplusplus
Modified: webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_seq_property_mgr.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_seq_property_mgr.h?rev=604820&r1=604819&r2=604820&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_seq_property_mgr.h (original)
+++ webservices/sandesha/trunk/c/src/storage/sqlite/sandesha2_permanent_seq_property_mgr.h Mon Dec 17 02:58:17 2007
@@ -33,9 +33,6 @@
{
#endif
-struct sandesha2_storage_mgr;
-struct axis2_conf_ctx;
-
/** @defgroup sandesha2_permanent_seq_property_mgr Permanat Sequence Property
* Manager
* @ingroup sandesha2
@@ -45,8 +42,7 @@
AXIS2_EXTERN struct sandesha2_seq_property_mgr * AXIS2_CALL
sandesha2_permanent_seq_property_mgr_create(
const axutil_env_t *env,
- struct sandesha2_storage_mgr *storage_mgr,
- struct axis2_conf_ctx *ctx);
+ axis2_char_t *dbname);
/** @} */
#ifdef __cplusplus
Modified: webservices/sandesha/trunk/c/src/transport/sandesha2_transport_sender.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/transport/sandesha2_transport_sender.c?rev=604820&r1=604819&r2=604820&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/transport/sandesha2_transport_sender.c (original)
+++ webservices/sandesha/trunk/c/src/transport/sandesha2_transport_sender.c Mon Dec 17 02:58:17 2007
@@ -150,7 +150,7 @@
axis2_char_t *key = NULL;
axis2_conf_ctx_t *conf_ctx = NULL;
axis2_conf_t *conf = NULL;
- sandesha2_storage_mgr_t *storage_man = NULL;
+ sandesha2_storage_mgr_t *storage_mgr = NULL;
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
"[sandesha2]Entry:sandesha2_transport_sender_invoke");
@@ -177,12 +177,14 @@
key = axutil_property_get_value(property, env);
conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
conf = axis2_conf_ctx_get_conf(conf_ctx, env);
- storage_man = sandesha2_utils_get_storage_mgr(env, conf_ctx, conf);
+ storage_mgr = sandesha2_utils_get_storage_mgr(env, conf_ctx, conf);
property = axutil_property_create_with_args(env, 0, 0, 0, AXIS2_VALUE_TRUE);
axis2_msg_ctx_set_property(msg_ctx, env, SANDESHA2_QUALIFIED_FOR_SENDING,
property);
- sandesha2_storage_mgr_update_msg_ctx(storage_man, env, key, msg_ctx);
+ sandesha2_storage_mgr_update_msg_ctx(storage_mgr, env, key, msg_ctx);
+ if(storage_mgr)
+ sandesha2_storage_mgr_free(storage_mgr, env);
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
"[sandesha2]Exit:sandesha2_transport_sender_invoke");
return AXIS2_SUCCESS;
Modified: webservices/sandesha/trunk/c/src/util/ack_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/ack_mgr.c?rev=604820&r1=604819&r2=604820&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/ack_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/ack_mgr.c Mon Dec 17 02:58:17 2007
@@ -40,11 +40,10 @@
const axutil_env_t *env,
sandesha2_msg_ctx_t *ref_rm_msg,
axis2_char_t *seq_id,
- sandesha2_storage_mgr_t *storage_mgr)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
axis2_msg_ctx_t *ref_msg = NULL;
axis2_conf_ctx_t *conf_ctx = NULL;
- sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
sandesha2_seq_property_bean_t *acks_to_bean = NULL;
axis2_endpoint_ref_t *acks_to = NULL;
axis2_char_t *acks_to_str = NULL;
@@ -58,12 +57,10 @@
axis2_op_ctx_t *op_ctx = NULL;
AXIS2_PARAM_CHECK(env->error, seq_id, NULL);
- AXIS2_PARAM_CHECK(env->error, storage_mgr, NULL);
+ AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, NULL);
ref_msg = sandesha2_msg_ctx_get_msg_ctx(ref_rm_msg, env);
conf_ctx = axis2_msg_ctx_get_conf_ctx(ref_msg, env);
- seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(storage_mgr,
- env);
acks_to_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env,
seq_id, SANDESHA2_SEQ_PROP_ACKS_TO_EPR);
if(acks_to_bean)
@@ -118,11 +115,10 @@
axis2_msg_ctx_set_soap_envelope(ack_msg_ctx, env, soap_env);
axis2_msg_ctx_set_to(ack_msg_ctx, env, acks_to);
/* Adding the sequence acknowledgement part */
- sandesha2_msg_creator_add_ack_msg(env, ack_rm_msg, seq_id, storage_mgr);
+ sandesha2_msg_creator_add_ack_msg(env, ack_rm_msg, seq_id, seq_prop_mgr);
axis2_msg_ctx_set_property(ack_msg_ctx, env, AXIS2_TRANSPORT_IN, NULL);
addr_ns_uri = sandesha2_utils_get_seq_property(env, seq_id,
- SANDESHA2_SEQ_PROP_ADDRESSING_NAMESPACE_VALUE,
- storage_mgr);
+ SANDESHA2_SEQ_PROP_ADDRESSING_NAMESPACE_VALUE, seq_prop_mgr);
if(addr_ns_uri)
{
property = axis2_msg_ctx_get_property(ack_msg_ctx, env, AXIS2_WSA_VERSION);
@@ -284,11 +280,11 @@
sandesha2_ack_mgr_piggyback_acks_if_present(
const axutil_env_t *env,
sandesha2_msg_ctx_t *rm_msg_ctx,
- sandesha2_storage_mgr_t *storage_mgr)
+ sandesha2_storage_mgr_t *storage_mgr,
+ sandesha2_seq_property_mgr_t *seq_prop_mgr,
+ sandesha2_sender_mgr_t *sender_mgr)
{
axis2_conf_ctx_t *conf_ctx = NULL;
- sandesha2_sender_mgr_t *retrans_mgr = NULL;
- sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
sandesha2_sender_bean_t *find_bean = NULL;
axis2_char_t *to_str = NULL;
axis2_msg_ctx_t *msg_ctx = NULL;
@@ -301,8 +297,6 @@
msg_ctx = sandesha2_msg_ctx_get_msg_ctx(rm_msg_ctx, env);
conf_ctx = axis2_msg_ctx_get_conf_ctx(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);
find_bean = sandesha2_sender_bean_create(env);
sandesha2_sender_bean_set_msg_type(find_bean, env, SANDESHA2_MSG_TYPE_ACK);
@@ -313,7 +307,7 @@
if(to)
to_str = (axis2_char_t*)axis2_endpoint_ref_get_address(to, env);
- found_list = sandesha2_sender_mgr_find_by_sender_bean(retrans_mgr, env,
+ found_list = sandesha2_sender_mgr_find_by_sender_bean(sender_mgr, env,
find_bean);
for(i = 0; i < axutil_array_list_size(found_list, env); i++)
{
@@ -343,11 +337,11 @@
continue;
if(0 == axutil_strcmp(to, to_str))
continue;
- sandesha2_sender_mgr_remove(retrans_mgr, env,
+ sandesha2_sender_mgr_remove(sender_mgr, env,
sandesha2_sender_bean_get_msg_id((sandesha2_rm_bean_t *)
sender_bean, env));
sandesha2_storage_mgr_remove_msg_ctx(storage_mgr, env,
- msg_ctx_ref_key);
+ msg_ctx_ref_key, conf_ctx);
ack_rm_msg = sandesha2_msg_init_init_msg(env, msg_ctx1);
if(SANDESHA2_MSG_TYPE_ACK != sandesha2_msg_ctx_get_msg_type(ack_rm_msg,
env))
Modified: webservices/sandesha/trunk/c/src/util/fault_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/fault_mgr.c?rev=604820&r1=604819&r2=604820&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/fault_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/fault_mgr.c Mon Dec 17 02:58:17 2007
@@ -38,15 +38,14 @@
sandesha2_fault_mgr_check_for_create_seq_refused (
const axutil_env_t *env,
axis2_msg_ctx_t *create_seq_msg,
- sandesha2_storage_mgr_t *storage_man)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
sandesha2_msg_ctx_t *rm_msg_ctx = NULL;
sandesha2_create_seq_t *create_seq = NULL;
axis2_bool_t refuse_seq = AXIS2_FALSE;
- AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, create_seq_msg, NULL);
- AXIS2_PARAM_CHECK(env->error, storage_man, NULL);
+ AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, NULL);
rm_msg_ctx = sandesha2_msg_init_init_msg(env, create_seq_msg);
create_seq = (sandesha2_create_seq_t*)sandesha2_msg_ctx_get_msg_part(
@@ -74,9 +73,8 @@
sandesha2_fault_data_set_sub_code(fault_data, env,
SANDESHA2_SOAP_FAULT_SUBCODE_CREATE_SEQ_REFUSED);
sandesha2_fault_data_set_reason(fault_data, env, "");
- return sandesha2_fault_mgr_get_fault(env, rm_msg_ctx,
- fault_data, sandesha2_msg_ctx_get_addr_ns_val(rm_msg_ctx,
- env), storage_man);
+ return sandesha2_fault_mgr_get_fault(env, rm_msg_ctx, fault_data,
+ sandesha2_msg_ctx_get_addr_ns_val(rm_msg_ctx, env), seq_prop_mgr);
}
return NULL;
}
@@ -85,19 +83,17 @@
sandesha2_fault_mgr_check_for_last_msg_num_exceeded(
const axutil_env_t *env,
sandesha2_msg_ctx_t *app_rm_msg,
- sandesha2_storage_mgr_t *storage_man)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
sandesha2_seq_t *sequence = NULL;
long msg_num = -1;
axis2_char_t *seq_id = NULL;
- sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
sandesha2_seq_property_bean_t *last_msg_bean = NULL;
axis2_bool_t exceeded = AXIS2_FALSE;
axis2_char_t reason[256];
- AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, app_rm_msg, NULL);
- AXIS2_PARAM_CHECK(env->error, storage_man, NULL);
+ AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, NULL);
sequence = (sandesha2_seq_t*)sandesha2_msg_ctx_get_msg_part(
app_rm_msg, env, SANDESHA2_MSG_PART_SEQ);
@@ -106,8 +102,6 @@
seq_id = sandesha2_identifier_get_identifier(
sandesha2_seq_get_identifier(sequence, env), env);
- seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(
- storage_man, env);
last_msg_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr,
env, seq_id, SANDESHA2_SEQ_PROP_LAST_OUT_MESSAGE_NO);
if(NULL != last_msg_bean)
@@ -140,9 +134,8 @@
sandesha2_fault_data_set_sub_code(fault_data, env,
SANDESHA2_SOAP_FAULT_SUBCODE_LAST_MESSAGE_NO_EXCEEDED);
sandesha2_fault_data_set_reason(fault_data, env, reason);
- return sandesha2_fault_mgr_get_fault(env, app_rm_msg,
- fault_data, sandesha2_msg_ctx_get_addr_ns_val(app_rm_msg,
- env), storage_man);
+ return sandesha2_fault_mgr_get_fault(env, app_rm_msg, fault_data,
+ sandesha2_msg_ctx_get_addr_ns_val(app_rm_msg, env), seq_prop_mgr);
}
return NULL;
}
@@ -151,11 +144,10 @@
sandesha2_fault_mgr_check_for_msg_num_rollover(
const axutil_env_t *env,
sandesha2_msg_ctx_t *rm_msg_ctx,
- sandesha2_storage_mgr_t *storage_man)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
- AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, NULL);
- AXIS2_PARAM_CHECK(env->error, storage_man, NULL);
+ AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, NULL);
return NULL;
}
@@ -165,19 +157,18 @@
const axutil_env_t *env,
sandesha2_msg_ctx_t *rm_msg_ctx,
axis2_char_t *seq_id,
- sandesha2_storage_mgr_t *storage_man)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr,
+ sandesha2_create_seq_mgr_t *create_seq_mgr,
+ sandesha2_next_msg_mgr_t *next_msg_mgr)
{
- sandesha2_create_seq_mgr_t *create_seq_mgr = NULL;
int type = -1;
axis2_bool_t valid_seq = AXIS2_TRUE;
- AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, NULL);
- AXIS2_PARAM_CHECK(env->error, storage_man, NULL);
+ AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, NULL);
+ AXIS2_PARAM_CHECK(env->error, create_seq_mgr, NULL);
AXIS2_PARAM_CHECK(env->error, seq_id, NULL);
- create_seq_mgr = sandesha2_storage_mgr_get_create_seq_mgr(
- storage_man, env);
type = sandesha2_msg_ctx_get_msg_type(rm_msg_ctx, env);
if(SANDESHA2_MSG_TYPE_ACK == type ||
SANDESHA2_MSG_TYPE_CREATE_SEQ_RESPONSE == type ||
@@ -200,12 +191,9 @@
}
else
{
- sandesha2_next_msg_mgr_t *next_msg_mgr = NULL;
axutil_array_list_t *list = NULL;
axis2_bool_t contains = AXIS2_FALSE;
- next_msg_mgr = sandesha2_storage_mgr_get_next_msg_mgr(
- storage_man, env);
list = sandesha2_next_msg_mgr_retrieve_all(next_msg_mgr, env);
if(list)
{
@@ -257,9 +245,8 @@
sandesha2_fault_data_set_detail(fault_data, env, detail_node);
sandesha2_fault_data_set_reason(fault_data, env, "A sequence with the" \
" given sequenceID has NOT been established");
- return sandesha2_fault_mgr_get_fault(env, rm_msg_ctx,
- fault_data, sandesha2_msg_ctx_get_addr_ns_val(rm_msg_ctx,
- env), storage_man);
+ return sandesha2_fault_mgr_get_fault(env, rm_msg_ctx, fault_data,
+ sandesha2_msg_ctx_get_addr_ns_val(rm_msg_ctx, env), seq_prop_mgr);
}
return NULL;
}
@@ -268,16 +255,15 @@
sandesha2_fault_mgr_check_for_invalid_ack(
const axutil_env_t *env,
sandesha2_msg_ctx_t *ack_rm_msg,
- sandesha2_storage_mgr_t *storage_man)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
axis2_bool_t invalid_ack = AXIS2_FALSE;
axis2_char_t reason[256];
sandesha2_seq_ack_t *seq_ack = NULL;
axutil_array_list_t *ack_range_list = NULL;
- AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, ack_rm_msg, NULL);
- AXIS2_PARAM_CHECK(env->error, storage_man, NULL);
+ AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, NULL);
if(SANDESHA2_MSG_TYPE_ACK != sandesha2_msg_ctx_get_msg_type(ack_rm_msg, env))
return NULL;
@@ -333,9 +319,8 @@
qname, dummy_node, &detail_node);
sandesha2_fault_data_set_detail(fault_data, env, detail_node);
sandesha2_fault_data_set_reason(fault_data, env, reason);
- return sandesha2_fault_mgr_get_fault(env, ack_rm_msg,
- fault_data, sandesha2_msg_ctx_get_addr_ns_val(ack_rm_msg,
- env), storage_man);
+ return sandesha2_fault_mgr_get_fault(env, ack_rm_msg, fault_data,
+ sandesha2_msg_ctx_get_addr_ns_val(ack_rm_msg, env), seq_prop_mgr);
}
return NULL;
}
@@ -345,20 +330,16 @@
const axutil_env_t *env,
sandesha2_msg_ctx_t *rm_msg_ctx,
axis2_char_t *seq_id,
- sandesha2_storage_mgr_t *storage_man)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
- sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
sandesha2_seq_property_bean_t *closed_bean = NULL;
axis2_bool_t seq_closed = AXIS2_FALSE;
axis2_char_t reason[256];
- AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, NULL);
- AXIS2_PARAM_CHECK(env->error, storage_man, NULL);
+ AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, NULL);
AXIS2_PARAM_CHECK(env->error, seq_id, NULL);
- seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(
- storage_man, env);
closed_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env,
seq_id, SANDESHA2_SEQ_PROP_SEQ_CLOSED);
if(closed_bean && 0 == axutil_strcmp(AXIS2_VALUE_TRUE,
@@ -382,9 +363,8 @@
AXIOM_SOAP12_FAULT_CODE_SENDER);
sandesha2_fault_data_set_reason(fault_data, env, reason);
- return sandesha2_fault_mgr_get_fault(env, rm_msg_ctx,
- fault_data, sandesha2_msg_ctx_get_addr_ns_val(rm_msg_ctx,
- env), storage_man);
+ return sandesha2_fault_mgr_get_fault(env, rm_msg_ctx, fault_data,
+ sandesha2_msg_ctx_get_addr_ns_val(rm_msg_ctx, env), seq_prop_mgr);
}
return NULL;
}
@@ -395,7 +375,7 @@
sandesha2_msg_ctx_t *rm_msg_ctx,
sandesha2_fault_data_t *fault_data,
axis2_char_t *addr_ns_uri,
- sandesha2_storage_mgr_t *storage_man)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
axis2_msg_ctx_t *fault_msg_ctx = NULL;
axis2_msg_ctx_t *ref_msg = NULL;
@@ -406,9 +386,8 @@
int soap_ver = -1;
sandesha2_msg_ctx_t *fault_rm_msg = NULL;
- AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, NULL);
- AXIS2_PARAM_CHECK(env->error, storage_man, NULL);
+ AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, NULL);
AXIS2_PARAM_CHECK(env->error, addr_ns_uri, NULL);
AXIS2_PARAM_CHECK(env->error, fault_data, NULL);
@@ -451,12 +430,9 @@
}
else
{
- sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
sandesha2_seq_property_bean_t *acks_to_bean = NULL;
axis2_char_t *seq_id = NULL;
- seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(
- storage_man, env);
seq_id = sandesha2_fault_data_get_seq_id(fault_data, env);
acks_to_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr,
env, seq_id, SANDESHA2_SEQ_PROP_ACKS_TO_EPR);
Modified: webservices/sandesha/trunk/c/src/util/msg_creator.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/msg_creator.c?rev=604820&r1=604819&r2=604820&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/msg_creator.c (original)
+++ webservices/sandesha/trunk/c/src/util/msg_creator.c Mon Dec 17 02:58:17 2007
@@ -78,7 +78,7 @@
sandesha2_msg_ctx_t *application_rm_msg,
axis2_char_t *internal_seq_id,
axis2_char_t *acks_to,
- sandesha2_storage_mgr_t *storage_mgr)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
axis2_msg_ctx_t *application_msg_ctx = NULL;
axis2_msg_ctx_t *create_seq_msg_ctx = NULL;
@@ -104,7 +104,6 @@
sandesha2_create_seq_t *create_seq_part = NULL;
sandesha2_seq_property_bean_t *reply_to_bean = NULL;
sandesha2_seq_property_bean_t *to_bean = NULL;
- sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
sandesha2_msg_ctx_t *create_seq_rm_msg = NULL;
sandesha2_address_t *temp_address = NULL;
sandesha2_acks_to_t *temp_acks_to = NULL;
@@ -123,7 +122,6 @@
AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_CONF_CTX_NULL, AXIS2_FAILURE);
return NULL;
}
- seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(storage_mgr, env);
/* Creating by copying common contents. (This will not see contexts except
* for conf_ctx)
*/
@@ -195,7 +193,8 @@
temp_reply_to = sandesha2_msg_ctx_get_reply_to(application_rm_msg, env);
axis2_msg_ctx_set_reply_to(create_seq_msg_ctx, env, temp_reply_to);
create_seq_rm_msg = sandesha2_msg_ctx_create(env, create_seq_msg_ctx);
- rm_version = sandesha2_utils_get_rm_version(env, internal_seq_id, storage_mgr);
+ rm_version = sandesha2_utils_get_rm_version(env, internal_seq_id,
+ seq_prop_mgr);
if(!rm_version)
{
AXIS2_ERROR_SET(env->error,
@@ -204,7 +203,7 @@
}
rm_ns_value = sandesha2_spec_specific_consts_get_rm_ns_val(env, rm_version);
addressing_ns_value = sandesha2_utils_get_seq_property(env, internal_seq_id,
- SANDESHA2_SEQ_PROP_ADDRESSING_NAMESPACE_VALUE, storage_mgr);
+ SANDESHA2_SEQ_PROP_ADDRESSING_NAMESPACE_VALUE, seq_prop_mgr);
create_seq_part = sandesha2_create_seq_create(env, addressing_ns_value,
rm_ns_value);
/* Adding sequence offer - if present */
@@ -305,7 +304,7 @@
sandesha2_msg_ctx_t *create_seq_msg,
axis2_msg_ctx_t *out_msg,
axis2_char_t *new_seq_id,
- sandesha2_storage_mgr_t *storage_mgr)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
axis2_conf_ctx_t *conf_ctx = NULL;
axis2_ctx_t *ctx = NULL;
@@ -336,7 +335,7 @@
msg_part = (sandesha2_iom_rm_element_t *) sandesha2_msg_ctx_get_msg_part(
create_seq_msg, env, SANDESHA2_MSG_PART_CREATE_SEQ);
cs = (sandesha2_create_seq_t *) msg_part;
- rm_version = sandesha2_utils_get_rm_version(env, new_seq_id, storage_mgr);
+ rm_version = sandesha2_utils_get_rm_version(env, new_seq_id, seq_prop_mgr);
if(!rm_version)
{
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
@@ -348,7 +347,7 @@
}
rm_ns_value = sandesha2_spec_specific_consts_get_rm_ns_val(env, rm_version);
addressing_ns_value = sandesha2_utils_get_seq_property(env, new_seq_id,
- SANDESHA2_SEQ_PROP_ADDRESSING_NAMESPACE_VALUE, storage_mgr);
+ SANDESHA2_SEQ_PROP_ADDRESSING_NAMESPACE_VALUE, seq_prop_mgr);
response = sandesha2_create_seq_res_create(env, rm_ns_value,
addressing_ns_value);
identifier = sandesha2_identifier_create(env, rm_ns_value);
@@ -426,7 +425,7 @@
* Create a new close_seq_response message.
* @param close_seq_msg
* @param out_msg
- * @param storage_mgr
+ * @param seq_prop_mgr
* @return
*/
sandesha2_msg_ctx_t *
@@ -434,7 +433,7 @@
const axutil_env_t *env,
sandesha2_msg_ctx_t *close_seq_msg,
axis2_msg_ctx_t *out_msg,
- sandesha2_storage_mgr_t *storage_mgr)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
axis2_conf_ctx_t *conf_ctx = NULL;
axis2_msg_ctx_t *temp_msg_ctx = NULL;
@@ -471,7 +470,7 @@
sandesha2_msg_ctx_set_soap_envelope(close_seq_response, env, envelope);
sandesha2_msg_ctx_set_msg_part(close_seq_response, env,
SANDESHA2_MSG_PART_CLOSE_SEQ_RESPONSE, response);
- rm_version = sandesha2_utils_get_rm_version(env, seq_id, storage_mgr);
+ rm_version = sandesha2_utils_get_rm_version(env, seq_id, seq_prop_mgr);
temp_action = sandesha2_spec_specific_consts_get_close_seq_res_action(
env, rm_version);
axis2_msg_ctx_set_wsa_action(out_msg, env, temp_action);
@@ -492,10 +491,11 @@
/**
* Create a new create_terminate_seq_msg
- * @param application_rm_msg
+ * @param env
+ * @param ref_rm_msg
* @param seq_id
* @param internal_seq_id
- * @param acks_to
+ * @param seq_prop_mgr
* @return
*/
sandesha2_msg_ctx_t *AXIS2_CALL
@@ -504,7 +504,7 @@
sandesha2_msg_ctx_t *ref_rm_msg,
axis2_char_t *seq_id,
axis2_char_t *internal_seq_id,
- sandesha2_storage_mgr_t *storage_mgr)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
axis2_msg_ctx_t *ref_msg_ctx = NULL;
axis2_msg_ctx_t *terminate_seq_msg_ctx = NULL;
@@ -580,7 +580,7 @@
new_inflow = axis2_phases_info_copy_flow(env, inflow);
axis2_op_set_in_flow(terminate_seq_op, env, new_inflow);
}
- rm_version = sandesha2_utils_get_rm_version(env, internal_seq_id, storage_mgr);
+ rm_version = sandesha2_utils_get_rm_version(env, internal_seq_id, seq_prop_mgr);
if(!rm_version)
{
AXIS2_ERROR_SET(env->error,
@@ -628,7 +628,7 @@
const axutil_env_t *env,
sandesha2_msg_ctx_t *ref_rm_msg,
axis2_msg_ctx_t *out_msg,
- sandesha2_storage_mgr_t *storage_mgr)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
sandesha2_msg_ctx_t *res_rm_msg = NULL;
sandesha2_terminate_seq_t *terminate_seq = NULL;
@@ -662,7 +662,7 @@
sandesha2_msg_ctx_set_msg_part(res_rm_msg, env,
SANDESHA2_MSG_PART_TERMINATE_SEQ_RESPONSE,
(sandesha2_iom_rm_part_t*)terminate_seq_res);
- rm_version = sandesha2_utils_get_rm_version(env, seq_id, storage_mgr);
+ rm_version = sandesha2_utils_get_rm_version(env, seq_id, seq_prop_mgr);
if(!rm_version)
{
rm_version = sandesha2_msg_ctx_get_rm_spec_ver(ref_rm_msg, env);
@@ -857,7 +857,7 @@
const axutil_env_t *env,
sandesha2_msg_ctx_t *app_msg,
axis2_char_t *seq_id,
- sandesha2_storage_mgr_t *storage_mgr)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
axiom_soap_envelope_t *envelope = NULL;
axiom_soap_header_t *soap_header = NULL;
@@ -872,7 +872,6 @@
axis2_char_t *uuid = NULL;
sandesha2_identifier_t *id = NULL;
sandesha2_seq_ack_t *seq_ack = NULL;
- sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
sandesha2_seq_property_bean_t *seq_bean = NULL;
sandesha2_seq_property_bean_t *seq_closed_bean = NULL;
axis2_msg_ctx_t *msg_ctx = NULL;
@@ -888,7 +887,7 @@
}
msg_ctx = sandesha2_msg_ctx_get_msg_ctx(app_msg, env);
conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
- rm_version = sandesha2_utils_get_rm_version(env, seq_id, storage_mgr);
+ rm_version = sandesha2_utils_get_rm_version(env, seq_id, seq_prop_mgr);
if(!rm_version)
{
AXIS2_ERROR_SET(env->error,
@@ -901,7 +900,6 @@
id = sandesha2_identifier_create(env, rm_ns_value);
sandesha2_identifier_set_identifier(id, env, seq_id);
sandesha2_seq_ack_set_identifier(seq_ack, env, id);
- seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(storage_mgr, env);
seq_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, seq_id,
SANDESHA2_SEQ_PROP_SERVER_COMPLETED_MESSAGES);
if(seq_bean)
@@ -943,7 +941,7 @@
soap_header = axiom_soap_envelope_get_header(envelope, env);
sandesha2_iom_rm_element_to_om_node((sandesha2_iom_rm_element_t *)seq_ack, env, soap_header);
- rm_version = sandesha2_utils_get_rm_version(env, seq_id, storage_mgr);
+ rm_version = sandesha2_utils_get_rm_version(env, seq_id, seq_prop_mgr);
ack_req_action = sandesha2_spec_specific_consts_get_seq_ack_action(env,
rm_version);
sandesha2_msg_ctx_set_wsa_action(app_msg, env, ack_req_action);
@@ -965,7 +963,7 @@
sandesha2_msg_ctx_t *ref_rm_msg_ctx,
axis2_char_t *make_conn_seq_id,
axis2_char_t *make_conn_anon_uri,
- sandesha2_storage_mgr_t *storage_mgr)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
axis2_msg_ctx_t *ref_msg_ctx = NULL;
axis2_msg_ctx_t *make_conn_msg_ctx = NULL;
Modified: webservices/sandesha/trunk/c/src/util/msg_init.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/msg_init.c?rev=604820&r1=604819&r2=604820&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/msg_init.c (original)
+++ webservices/sandesha/trunk/c/src/util/msg_init.c Mon Dec 17 02:58:17 2007
@@ -17,6 +17,7 @@
#include <sandesha2_msg_init.h>
#include <sandesha2_storage_mgr.h>
#include <sandesha2_seq_property_mgr.h>
+#include <sandesha2_permanent_seq_property_mgr.h>
#include <sandesha2_spec_specific_consts.h>
#include <sandesha2_utils.h>
#include <sandesha2_ack_mgr.h>
@@ -289,6 +290,7 @@
sandesha2_close_seq_res_t *close_seq_res = NULL;
sandesha2_make_connection_t *make_conn = NULL;
int temp_flow = -1;
+ axis2_char_t *dbname = NULL;
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
"[sandesha2]Entry:validate_msg");
@@ -296,7 +298,8 @@
conf_ctx = axis2_msg_ctx_get_conf_ctx(temp_msg_ctx, env);
conf = axis2_conf_ctx_get_conf(conf_ctx, env);
storage_mgr = sandesha2_utils_get_storage_mgr(env, conf_ctx, conf);
- seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(storage_mgr, env);
+ dbname = sandesha2_util_get_dbname(env, conf_ctx);
+ seq_prop_mgr = sandesha2_permanent_seq_property_mgr_create(env, dbname);
create_seq = (sandesha2_create_seq_t *) sandesha2_msg_ctx_get_msg_part(
rm_msg_ctx, env, SANDESHA2_MSG_PART_CREATE_SEQ);
create_seq_res = (sandesha2_create_seq_res_t *)
@@ -415,6 +418,10 @@
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
" Invalid MakeConnection message. Either Address or Identifier" \
" must be present");
+ if(seq_prop_mgr)
+ sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
+ if(storage_mgr)
+ sandesha2_storage_mgr_free(storage_mgr, env);
return AXIS2_FALSE;
}
}
@@ -445,7 +452,7 @@
axis2_char_t *spec_version = NULL;
axis2_char_t *seq_rm_ns = NULL;
- spec_version = sandesha2_utils_get_rm_version(env, prop_key, storage_mgr);
+ spec_version = sandesha2_utils_get_rm_version(env, prop_key, seq_prop_mgr);
if(spec_version)
{
seq_rm_ns = sandesha2_spec_specific_consts_get_rm_ns_val(env,
@@ -458,10 +465,18 @@
AXIS2_ERROR_SET(env->error,
SANDESHA2_ERROR_RM_NS_VALUE_IS_DIFFERENT_FROM_REGISTERED_NS_FOR_SEQ,
AXIS2_FAILURE);
+ if(seq_prop_mgr)
+ sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
+ if(storage_mgr)
+ sandesha2_storage_mgr_free(storage_mgr, env);
return AXIS2_FALSE;
}
}
}
+ if(seq_prop_mgr)
+ sandesha2_seq_property_mgr_free(seq_prop_mgr, env);
+ if(storage_mgr)
+ sandesha2_storage_mgr_free(storage_mgr, env);
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
"[sandesha2]Exit:validate_msg");
return AXIS2_TRUE;
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=604820&r1=604819&r2=604820&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/msg_retrans_adjuster.c (original)
+++ webservices/sandesha/trunk/c/src/util/msg_retrans_adjuster.c Mon Dec 17 02:58:17 2007
@@ -22,6 +22,9 @@
#include <axutil_property.h>
#include <sandesha2_terminate_mgr.h>
#include <sandesha2_seq_mgr.h>
+#include <sandesha2_seq_property_mgr.h>
+#include <sandesha2_create_seq_mgr.h>
+#include <sandesha2_sender_mgr.h>
/******************************************************************************/
sandesha2_sender_bean_t * AXIS2_CALL
@@ -36,13 +39,16 @@
int count,
long initial_interval);
-axis2_status_t AXIS2_CALL
+static axis2_status_t AXIS2_CALL
sandesha2_msg_retrans_adjuster_finalize_timedout_seq(
const axutil_env_t *env,
axis2_char_t *int_seq_id,
axis2_char_t *seq_id,
axis2_msg_ctx_t *msg_ctx,
- sandesha2_storage_mgr_t *storage_mgr);
+ sandesha2_storage_mgr_t *storage_mgr,
+ sandesha2_seq_property_mgr_t *seq_prop_mgr,
+ sandesha2_create_seq_mgr_t *create_seq_mgr,
+ sandesha2_sender_mgr_t *sender_mgr);
/******************************************************************************/
@@ -52,7 +58,10 @@
const axutil_env_t *env,
sandesha2_sender_bean_t *sender_bean,
axis2_conf_ctx_t *conf_ctx,
- sandesha2_storage_mgr_t *storage_mgr)
+ sandesha2_storage_mgr_t *storage_mgr,
+ sandesha2_seq_property_mgr_t *seq_prop_mgr,
+ sandesha2_create_seq_mgr_t *create_seq_mgr,
+ sandesha2_sender_mgr_t *sender_mgr)
{
axis2_char_t *stored_key = NULL;
axis2_msg_ctx_t *msg_ctx = NULL;
@@ -71,12 +80,15 @@
AXIS2_PARAM_CHECK(env->error, sender_bean, AXIS2_FALSE);
AXIS2_PARAM_CHECK(env->error, conf_ctx, AXIS2_FALSE);
AXIS2_PARAM_CHECK(env->error, storage_mgr, AXIS2_FALSE);
+ AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, create_seq_mgr, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, sender_mgr, AXIS2_FAILURE);
stored_key = sandesha2_sender_bean_get_msg_ctx_ref_key(sender_bean, env);
if(!stored_key)
{
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] Stored Key not"
- " present in the retransmittable message");
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+ "[sandesha2]Stored Key not present in the retransmittable message");
return AXIS2_FALSE;
}
msg_ctx = sandesha2_storage_mgr_retrieve_msg_ctx(storage_mgr, env,
@@ -98,7 +110,7 @@
timeout_seq = AXIS2_TRUE;
if(rm_msg_ctx)
seq_timed_out = sandesha2_seq_mgr_has_seq_timedout(env, int_seq_id,
- rm_msg_ctx, storage_mgr);
+ rm_msg_ctx, seq_prop_mgr, conf_ctx);
if(AXIS2_TRUE == seq_timed_out)
{
@@ -111,7 +123,8 @@
{
sandesha2_sender_bean_set_send(sender_bean, env, AXIS2_FALSE);
sandesha2_msg_retrans_adjuster_finalize_timedout_seq(env, int_seq_id,
- seq_id, msg_ctx, storage_mgr);
+ seq_id, msg_ctx, storage_mgr, seq_prop_mgr, create_seq_mgr,
+ sender_mgr);
continue_sending = AXIS2_FALSE;
}
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
@@ -168,13 +181,16 @@
return interval;
}
-axis2_status_t AXIS2_CALL
+static axis2_status_t AXIS2_CALL
sandesha2_msg_retrans_adjuster_finalize_timedout_seq(
const axutil_env_t *env,
axis2_char_t *int_seq_id,
axis2_char_t *seq_id,
axis2_msg_ctx_t *msg_ctx,
- sandesha2_storage_mgr_t *storage_mgr)
+ sandesha2_storage_mgr_t *storage_mgr,
+ sandesha2_seq_property_mgr_t *seq_prop_mgr,
+ sandesha2_create_seq_mgr_t *create_seq_mgr,
+ sandesha2_sender_mgr_t *sender_mgr)
{
axis2_conf_ctx_t *conf_ctx = NULL;
axis2_ctx_t *ctx = NULL;
@@ -185,12 +201,15 @@
AXIS2_PARAM_CHECK(env->error, seq_id, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, storage_mgr, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, create_seq_mgr, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, sender_mgr, AXIS2_FAILURE);
conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
ctx = axis2_conf_ctx_get_base(conf_ctx, env);
sandesha2_terminate_mgr_time_out_sending_side_seq(env, conf_ctx, int_seq_id,
- AXIS2_FALSE, storage_mgr);
+ AXIS2_FALSE, storage_mgr, seq_prop_mgr, create_seq_mgr, sender_mgr);
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
"[sandesha2]Exit:sandesha2_msg_retrans_adjuster_finalize_timedout_seq");
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=604820&r1=604819&r2=604820&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/property_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/property_mgr.c Mon Dec 17 02:58:17 2007
@@ -129,7 +129,6 @@
axis2_char_t *in_order_invoker_str = NULL;
axis2_char_t *msg_types_str = NULL;
- AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, module_desc, NULL);
property_bean = sandesha2_property_bean_create(env);
@@ -343,8 +342,6 @@
axis2_char_t *value,
sandesha2_property_bean_t *property_bean)
{
-
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, property_bean, AXIS2_FAILURE);
@@ -359,7 +356,6 @@
axis2_char_t *value,
sandesha2_property_bean_t *property_bean)
{
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, property_bean, AXIS2_FAILURE);
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=604820&r1=604819&r2=604820&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/sandesha2_utils.c (original)
+++ webservices/sandesha/trunk/c/src/util/sandesha2_utils.c Mon Dec 17 02:58:17 2007
@@ -137,16 +137,12 @@
sandesha2_utils_get_rm_version(
const axutil_env_t *env,
axis2_char_t *key,
- sandesha2_storage_mgr_t *storage_mgr)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
- sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
sandesha2_seq_property_bean_t *rm_version_bean = NULL;
AXIS2_PARAM_CHECK(env->error, key, NULL);
- AXIS2_PARAM_CHECK(env->error, storage_mgr, NULL);
- seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(
- storage_mgr, env);
if(seq_prop_mgr)
{
rm_version_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr,
@@ -165,36 +161,16 @@
axis2_conf_ctx_t *conf_ctx,
axis2_conf_t *conf)
{
- axis2_char_t *value = NULL;
+ /*axis2_char_t *value = NULL;*/
sandesha2_storage_mgr_t *storage_mgr = NULL;
- sandesha2_property_bean_t *prop_bean = NULL;
+ /*sandesha2_property_bean_t *prop_bean = NULL;*/
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
"[sandesha2]Entry:sandesha2_utils_get_storage_mgr");
AXIS2_PARAM_CHECK(env->error, conf_ctx, NULL);
AXIS2_PARAM_CHECK(env->error, conf, NULL);
- axutil_allocator_switch_to_global_pool(env->allocator);
- prop_bean = (sandesha2_property_bean_t *)sandesha2_utils_get_property_bean(
- env, conf);
- if (prop_bean)
- {
- value = sandesha2_property_bean_get_storage_mgr(prop_bean, env);
- }
-
- if(value && (0 == axutil_strcmp(value, SANDESHA2_INMEMORY_STORAGE_MGR)))
- storage_mgr = sandesha2_utils_get_inmemory_storage_mgr(env, conf_ctx);
- else if (value && (0 == axutil_strcmp(value, SANDESHA2_PERMANENT_STORAGE_MGR)))
- storage_mgr = sandesha2_utils_get_permanent_storage_mgr(env, conf_ctx);
- else
- {
- axutil_allocator_switch_to_local_pool(env->allocator);
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2]Unknown storage manager");
- AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_UNKNOWN_STORAGE_MGR,
- AXIS2_FAILURE);
- return NULL;
- }
- axutil_allocator_switch_to_local_pool(env->allocator);
+ storage_mgr = sandesha2_utils_get_permanent_storage_mgr(env, conf_ctx);
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
"[sandesha2]Exit:sandesha2_utils_get_storage_mgr");
return storage_mgr;
@@ -205,17 +181,14 @@
const axutil_env_t *env,
axis2_char_t *incoming_seq_id,
axis2_char_t *name,
- sandesha2_storage_mgr_t *storage_mgr)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
- sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
sandesha2_seq_property_bean_t *seq_prop_bean = NULL;
AXIS2_PARAM_CHECK(env->error, incoming_seq_id, NULL);
AXIS2_PARAM_CHECK(env->error, name, NULL);
- AXIS2_PARAM_CHECK(env->error, storage_mgr, NULL);
+ AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, NULL);
- seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(
- storage_mgr, env);
seq_prop_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr,
env, incoming_seq_id, name);
if(!seq_prop_bean)
@@ -517,22 +490,23 @@
const axutil_env_t *env,
axis2_conf_ctx_t *conf_ctx)
{
- axutil_property_t *property = NULL;
- axis2_ctx_t *ctx = axis2_conf_ctx_get_base(conf_ctx, env);
+ /*axutil_property_t *property = NULL;
+ axis2_ctx_t *ctx = axis2_conf_ctx_get_base(conf_ctx, env);*/
sandesha2_storage_mgr_t *storage_mgr = NULL;
AXIS2_PARAM_CHECK(env->error, conf_ctx, NULL);
- property = axis2_ctx_get_property(ctx, env, SANDESHA2_PERMANENT_STORAGE_MGR);
+ /*property = axis2_ctx_get_property(ctx, env, SANDESHA2_PERMANENT_STORAGE_MGR);
if(property)
{
storage_mgr = axutil_property_get_value(property, env);
}
else
{
+ axis2_char_t *dbname = sandesha2_util_get_dbname(env, conf_ctx);
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
"[sandesha2]storage_mgr not found in the conf_ctx");
- storage_mgr = sandesha2_permanent_storage_mgr_create(env, conf_ctx);
+ storage_mgr = sandesha2_permanent_storage_mgr_create(env, dbname);
property = axutil_property_create_with_args(env, AXIS2_SCOPE_APPLICATION,
AXIS2_FALSE, 0, storage_mgr);
axis2_ctx_set_property(ctx, env, SANDESHA2_PERMANENT_STORAGE_MGR,
@@ -540,7 +514,9 @@
if(!storage_mgr)
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
"[sandesha2]Could not create storage_mgr");
- }
+ }*/
+ axis2_char_t *dbname = sandesha2_util_get_dbname(env, conf_ctx);
+ storage_mgr = sandesha2_permanent_storage_mgr_create(env, dbname);
return storage_mgr;
}
@@ -1179,7 +1155,7 @@
const axutil_env_t *env,
long highest_in_msg_no,
axis2_char_t *internal_seq_id,
- sandesha2_storage_mgr_t *storage_mgr)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
axis2_char_t *client_completed_msgs = NULL;
axutil_array_list_t *acked_msgs_list = NULL;
@@ -1188,7 +1164,7 @@
client_completed_msgs = sandesha2_utils_get_seq_property(env,
internal_seq_id, SANDESHA2_SEQ_PROP_CLIENT_COMPLETED_MESSAGES,
- storage_mgr);
+ seq_prop_mgr);
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
"[sandesha2]client_completed_msgs:%s", client_completed_msgs);
acked_msgs_list = sandesha2_utils_get_array_list_from_string(env,
@@ -1477,3 +1453,35 @@
{
return;
}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+sandesha2_util_get_dbname(
+ const axutil_env_t *env,
+ axis2_conf_ctx_t *conf_ctx)
+{
+ axis2_conf_t *conf = NULL;
+ axis2_module_desc_t *module_desc = NULL;
+ axutil_qname_t *qname = NULL;
+ axis2_char_t *dbname = NULL;
+ if(conf_ctx)
+ conf = axis2_conf_ctx_get_conf((const axis2_conf_ctx_t *) conf_ctx, env);
+ else
+ {
+ return 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 *dbparam = NULL;
+ dbparam = axis2_module_desc_get_param(module_desc, env, SANDESHA2_DB);
+ if(dbparam)
+ {
+ dbname = axutil_strdup(env, axutil_param_get_value(dbparam, env));
+ }
+ }
+ axutil_qname_free(qname, env);
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "dbname:%s", dbname);
+ return dbname;
+}
+
Modified: webservices/sandesha/trunk/c/src/util/seq_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/seq_mgr.c?rev=604820&r1=604819&r2=604820&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/seq_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/seq_mgr.c Mon Dec 17 02:58:17 2007
@@ -15,7 +15,6 @@
*/
#include <sandesha2_create_seq_mgr.h>
-#include <sandesha2_storage_mgr.h>
#include <sandesha2_seq_property_mgr.h>
#include <sandesha2_next_msg_mgr.h>
#include <sandesha2_create_seq_mgr.h>
@@ -46,7 +45,7 @@
sandesha2_seq_mgr_get_last_activated_time(
const axutil_env_t *env,
axis2_char_t *property_key,
- sandesha2_storage_mgr_t *storage_mgr);
+ sandesha2_seq_property_mgr_t *seq_prop_mgr);
AXIS2_EXTERN axis2_status_t AXIS2_CALL
sandesha2_seq_mgr_update_client_side_listener_if_needed(
@@ -59,7 +58,8 @@
sandesha2_seq_mgr_setup_new_seq(
const axutil_env_t *env,
sandesha2_msg_ctx_t *create_seq_msg,
- sandesha2_storage_mgr_t *storage_mgr)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr,
+ sandesha2_next_msg_mgr_t *next_msg_mgr)
{
axis2_char_t *seq_id = NULL;
axis2_endpoint_ref_t *to = NULL;
@@ -70,8 +70,6 @@
sandesha2_create_seq_t *create_seq = NULL;
axis2_msg_ctx_t *msg_ctx = NULL;
axis2_conf_ctx_t *conf_ctx = NULL;
- sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
- sandesha2_next_msg_mgr_t *next_msg_mgr = NULL;
sandesha2_seq_property_bean_t *received_msg_bean = NULL;
sandesha2_seq_property_bean_t *addressing_ns_bean = NULL;
sandesha2_seq_property_bean_t *reply_to_bean = NULL;
@@ -120,7 +118,6 @@
}
msg_ctx = sandesha2_msg_ctx_get_msg_ctx(create_seq_msg, env);
conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
- seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(storage_mgr, env);
received_msg_bean = sandesha2_seq_property_bean_create_with_data(env, seq_id,
SANDESHA2_SEQ_PROP_SERVER_COMPLETED_MESSAGES, "");
/* Setting the addressing version */
@@ -155,7 +152,6 @@
{
sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, to_bean);
}
- next_msg_mgr = sandesha2_storage_mgr_get_next_msg_mgr(storage_mgr, env);
next_msg_bean = sandesha2_next_msg_bean_create_with_data(env, seq_id, 1);
/* 1 will be the next */
internal_seq_id = sandesha2_utils_get_outgoing_internal_seq_id(env, seq_id);
@@ -216,15 +212,13 @@
sandesha2_seq_mgr_update_last_activated_time(
const axutil_env_t *env,
axis2_char_t *property_key,
- sandesha2_storage_mgr_t *storage_mgr)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
- sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
sandesha2_seq_property_bean_t *last_activated_bean = NULL;
axis2_bool_t added = AXIS2_FALSE;
long current_time = -1;
axis2_char_t current_time_str[32];
- seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(storage_mgr, env);
last_activated_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env,
property_key, SANDESHA2_SEQ_PROP_LAST_ACTIVATED_TIME);
if(last_activated_bean == NULL)
@@ -255,26 +249,25 @@
const axutil_env_t *env,
axis2_char_t *property_key,
sandesha2_msg_ctx_t *rm_msg_ctx,
- sandesha2_storage_mgr_t *storage_mgr)
+ sandesha2_seq_property_mgr_t *seq_prop_mgr,
+ axis2_conf_ctx_t *conf_ctx)
{
sandesha2_property_bean_t *property_bean = NULL;
axis2_bool_t seq_timedout = AXIS2_FALSE;
long last_activated_time = -1;
long current_time = -1;
long timeout_interval = -1;
- axis2_conf_ctx_t *conf_ctx = NULL;
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
"[sandesha2]Entry:sandesha2_seq_mgr_has_seq_timedout");
AXIS2_PARAM_CHECK(env->error, property_key, AXIS2_FALSE);
AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, AXIS2_FALSE);
- AXIS2_PARAM_CHECK(env->error, storage_mgr, AXIS2_FALSE);
+ AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, AXIS2_FALSE);
/* Avoid retrieving property bean from operation until it is availbale */
/*property_bean = sandesha2_utils_get_property_bean_from_op(env,
axis2_msg_ctx_get_op(sandesha2_msg_ctx_get_msg_ctx(
rm_msg_ctx, env), env));*/
- conf_ctx = sandesha2_storage_mgr_get_ctx(storage_mgr, env);
property_bean = sandesha2_utils_get_property_bean(env,
axis2_conf_ctx_get_conf(conf_ctx, env));
timeout_interval = sandesha2_property_bean_get_inactive_timeout_interval(
@@ -282,7 +275,7 @@
if(timeout_interval <= 0)
return AXIS2_FALSE;
last_activated_time = sandesha2_seq_mgr_get_last_activated_time(env,
- property_key, storage_mgr);
+ property_key, seq_prop_mgr);
current_time = sandesha2_utils_get_current_time_in_millis(env);
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[sandesha2]timeout_interval:%ld",
timeout_interval);
@@ -302,20 +295,17 @@
long AXIS2_CALL
-sandesha2_seq_mgr_get_last_activated_time(const axutil_env_t *env,
- axis2_char_t *property_key,
- sandesha2_storage_mgr_t *storage_mgr)
+sandesha2_seq_mgr_get_last_activated_time(
+ const axutil_env_t *env,
+ axis2_char_t *property_key,
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
long last_activated_time = -1;
-
- sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
sandesha2_seq_property_bean_t *seq_prop_bean = NULL;
- AXIS2_ENV_CHECK(env, -1);
AXIS2_PARAM_CHECK(env->error, property_key, -1);
- AXIS2_PARAM_CHECK(env->error, storage_mgr, -1);
+ AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, -1);
- seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(storage_mgr, env);
seq_prop_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env,
property_key, SANDESHA2_SEQ_PROP_LAST_ACTIVATED_TIME);
if(seq_prop_bean)
@@ -335,11 +325,10 @@
axis2_msg_ctx_t *first_app_msg,
axis2_char_t *int_seq_id,
axis2_char_t *spec_version,
- sandesha2_storage_mgr_t *storage_mgr,
+ sandesha2_seq_property_mgr_t *seq_prop_mgr,
const axis2_bool_t persistent)
{
axis2_conf_ctx_t *conf_ctx = NULL;
- sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
axis2_char_t *addr_ns_val = NULL;
axutil_property_t *property = NULL;
sandesha2_seq_property_bean_t *addr_ns_bean = NULL;
@@ -365,10 +354,9 @@
AXIS2_PARAM_CHECK(env->error, first_app_msg, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, int_seq_id, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, spec_version, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK(env->error, storage_mgr, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, AXIS2_FAILURE);
conf_ctx = axis2_msg_ctx_get_conf_ctx(first_app_msg, env);
- seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(storage_mgr, env);
property = axis2_msg_ctx_get_property(first_app_msg, env, AXIS2_WSA_VERSION);
if(property)
@@ -510,7 +498,7 @@
int_seq_id, SANDESHA2_SEQ_PROP_RM_SPEC_VERSION,
spec_version);
sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, spec_version_bean);
- sandesha2_seq_mgr_update_last_activated_time(env, int_seq_id, storage_mgr);
+ sandesha2_seq_mgr_update_last_activated_time(env, int_seq_id, seq_prop_mgr);
epr = axis2_msg_ctx_get_to(first_app_msg, env);
if(epr)
addr = (axis2_char_t*)axis2_endpoint_ref_get_address(
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org