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 2006/12/15 06:33:34 UTC
svn commit: r487452 [2/2] - in /webservices/sandesha/trunk/c: ./ include/
samples/rm_1_1_echo/ samples/rm_echo/ samples/rm_mtom/ samples/rm_ping/
src/core/ src/msgprocessors/ src/polling/ src/storage/ src/storage/beans/
src/storage/inmemory/ src/util/ ...
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?view=diff&rev=487452&r1=487451&r2=487452
==============================================================================
--- webservices/sandesha/trunk/c/src/util/sandesha2_utils.c (original)
+++ webservices/sandesha/trunk/c/src/util/sandesha2_utils.c Thu Dec 14 21:33:32 2006
@@ -28,6 +28,7 @@
#include <sandesha2_close_seq_res.h>
#include <sandesha2_polling_mgr.h>
#include <sandesha2_inmemory_storage_mgr.h>
+#include <sandesha2_permanent_storage_mgr.h>
#include <axis2_string.h>
#include <axis2_conf.h>
#include <axis2_property.h>
@@ -469,43 +470,73 @@
axis2_conf_ctx_t *conf_ctx)
{
axis2_property_t *property = NULL;
+ axis2_ctx_t *ctx = AXIS2_CONF_CTX_GET_BASE(conf_ctx, env);
AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, conf_ctx, NULL);
- property = AXIS2_CTX_GET_PROPERTY(AXIS2_CONF_CTX_GET_BASE(conf_ctx, env),
- env, SANDESHA2_INMEMORY_STORAGE_MGR, AXIS2_FALSE);
+ property = AXIS2_CTX_GET_PROPERTY(ctx, env, SANDESHA2_INMEMORY_STORAGE_MGR,
+ AXIS2_FALSE);
if(property && AXIS2_PROPERTY_GET_VALUE(property, env))
- return (sandesha2_storage_mgr_t*)AXIS2_PROPERTY_GET_VALUE(property,
- env);
+ {
+ sandesha2_storage_mgr_t *storage_mgr = NULL;
+ storage_mgr = (sandesha2_storage_mgr_t*)AXIS2_PROPERTY_GET_VALUE(
+ property, env);
+ return storage_mgr;
+ }
else
{
/* TODO we need to class load the proper storage mgr */
sandesha2_storage_mgr_t *storage_mgr =
- sandesha2_inmemory_storage_mgr_create(env, conf_ctx);
+ sandesha2_inmemory_storage_mgr_create(env, conf_ctx);
property = axis2_property_create(env);
AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_APPLICATION);
AXIS2_PROPERTY_SET_VALUE(property, env, storage_mgr);
AXIS2_PROPERTY_SET_FREE_FUNC(property, env,
- sandesha2_storage_mgr_free_void_arg);
- AXIS2_CTX_SET_PROPERTY(AXIS2_CONF_CTX_GET_BASE(conf_ctx, env),
- env, SANDESHA2_INMEMORY_STORAGE_MGR, property,
- AXIS2_FALSE);
+ sandesha2_storage_mgr_free_void_arg);
+ AXIS2_CTX_SET_PROPERTY(ctx, env, SANDESHA2_INMEMORY_STORAGE_MGR,
+ property, AXIS2_FALSE);
return storage_mgr;
}
return NULL;
}
AXIS2_EXTERN sandesha2_storage_mgr_t* AXIS2_CALL
-sandesha2_utils_get_permanent_storage_mgr(const axis2_env_t *env,
- axis2_conf_ctx_t *conf_ctx)
+sandesha2_utils_get_permanent_storage_mgr(
+ const axis2_env_t *env,
+ axis2_conf_ctx_t *conf_ctx)
{
+ axis2_property_t *property = NULL;
+ axis2_ctx_t *ctx = AXIS2_CONF_CTX_GET_BASE(conf_ctx, env);
+
AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, conf_ctx, NULL);
- /*TODO implement when the persistent storage is avalable */
- return NULL;
+ property = AXIS2_CTX_GET_PROPERTY(ctx, env, SANDESHA2_PERMANENT_STORAGE_MGR,
+ AXIS2_FALSE);
+
+ if(property && AXIS2_PROPERTY_GET_VALUE(property, env))
+ {
+ sandesha2_storage_mgr_t *storage_mgr = NULL;
+ storage_mgr = (sandesha2_storage_mgr_t*)AXIS2_PROPERTY_GET_VALUE(
+ property, env);
+ return storage_mgr;
+ }
+ else
+ {
+ sandesha2_storage_mgr_t *storage_mgr =
+ sandesha2_permanent_storage_mgr_create(env, conf_ctx);
+ property = axis2_property_create(env);
+ AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_APPLICATION);
+ AXIS2_PROPERTY_SET_VALUE(property, env, storage_mgr);
+ AXIS2_PROPERTY_SET_FREE_FUNC(property, env,
+ sandesha2_storage_mgr_free_void_arg);
+ AXIS2_CTX_SET_PROPERTY(ctx, env, SANDESHA2_PERMANENT_STORAGE_MGR,
+ property, AXIS2_FALSE);
+ return storage_mgr;
+ }
+ return NULL;
}
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
@@ -1199,7 +1230,6 @@
axis2_conf_ctx_t *conf_ctx = NULL;
axis2_transport_out_desc_t *transport_out = NULL;
axis2_transport_out_desc_t *sandesha2_transport_out = NULL;
- /*axis2_transport_sender_t *transport_sender = NULL;*/
axis2_property_t *property = NULL;
axis2_engine_t *engine = NULL;
@@ -1216,11 +1246,6 @@
property, AXIS2_FALSE);
transport_out = AXIS2_MSG_CTX_GET_TRANSPORT_OUT_DESC(msg_ctx, env);
- /*transport_sender = AXIS2_TRANSPORT_OUT_DESC_GET_SENDER(transport_out, env);
- if(transport_sender)
- {
- AXIS2_TRANSPORT_SENDER_INVOKE(transport_sender, env, msg_ctx);
- }*/
property = axis2_property_create(env);
AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_APPLICATION);
AXIS2_PROPERTY_SET_FREE_FUNC(property, env,
Modified: webservices/sandesha/trunk/c/src/util/terminate_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/terminate_mgr.c?view=diff&rev=487452&r1=487451&r2=487452
==============================================================================
--- webservices/sandesha/trunk/c/src/util/terminate_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/terminate_mgr.c Thu Dec 14 21:33:32 2006
@@ -114,24 +114,24 @@
axis2_char_t *msg_store_key = NULL;
map_bean = AXIS2_ARRAY_LIST_GET(found_list, env, i);
- msg_store_key = sandesha2_invoker_bean_get_msg_ctx_ref_key(map_bean,
- env);
+ msg_store_key = sandesha2_invoker_bean_get_msg_ctx_ref_key(
+ (sandesha2_rm_bean_t *) map_bean, env);
sandesha2_storage_mgr_remove_msg_ctx(storage_man, env, msg_store_key);
sandesha2_invoker_mgr_remove(invoker_mgr, env,
- sandesha2_invoker_bean_get_msg_ctx_ref_key(map_bean,
- env));
+ sandesha2_invoker_bean_get_msg_ctx_ref_key((sandesha2_rm_bean_t *)
+ map_bean, env));
}
clean_status = axis2_hash_get(sandesha2_terminate_mgr_rcv_side_clean_map,
- seq_id, AXIS2_HASH_KEY_STRING);
+ seq_id, AXIS2_HASH_KEY_STRING);
if(NULL != clean_status && 0 == AXIS2_STRCMP(clean_status,
- SANDESHA2_CLEANED_ON_TERMINATE_MSG))
+ SANDESHA2_CLEANED_ON_TERMINATE_MSG))
sandesha2_terminate_mgr_complete_term_on_recv_side(env, conf_ctx, seq_id,
storage_man);
else
axis2_hash_set(sandesha2_terminate_mgr_rcv_side_clean_map, seq_id,
- AXIS2_HASH_KEY_STRING, AXIS2_STRDUP(
- SANDESHA2_CLEANED_AFTER_INVOCATION, env));
+ AXIS2_HASH_KEY_STRING, AXIS2_STRDUP(
+ SANDESHA2_CLEANED_AFTER_INVOCATION, env));
return AXIS2_SUCCESS;
@@ -422,8 +422,8 @@
create_seq_bean = AXIS2_ARRAY_LIST_GET(found_list, env, i);
sandesha2_create_seq_mgr_remove(create_seq_mgr, env,
- sandesha2_create_seq_bean_get_create_seq_msg_id(
- create_seq_bean, env));
+ sandesha2_create_seq_bean_get_create_seq_msg_id(
+ (sandesha2_rm_bean_t *) create_seq_bean, env));
}
}
Modified: webservices/sandesha/trunk/c/src/workers/in_order_invoker.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/workers/in_order_invoker.c?view=diff&rev=487452&r1=487451&r2=487452
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/in_order_invoker.c (original)
+++ webservices/sandesha/trunk/c/src/workers/in_order_invoker.c Thu Dec 14 21:33:32 2006
@@ -351,10 +351,10 @@
axis2_engine_t *engine = NULL;
st_map_bean = AXIS2_ARRAY_LIST_GET(st_map_list, env, j);
- key = sandesha2_invoker_bean_get_msg_ctx_ref_key(st_map_bean,
- env);
+ key = sandesha2_invoker_bean_get_msg_ctx_ref_key(
+ (sandesha2_rm_bean_t *) st_map_bean, env);
msg_to_invoke = sandesha2_storage_mgr_retrieve_msg_ctx(
- storage_mgr, env, key, invoker->conf_ctx);
+ storage_mgr, env, key, invoker->conf_ctx);
if(msg_to_invoke)
rm_msg_ctx = sandesha2_msg_init_init_msg(env,
msg_to_invoke);
Modified: webservices/sandesha/trunk/c/src/workers/sender.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/workers/sender.c?view=diff&rev=487452&r1=487451&r2=487452
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/sender.c (original)
+++ webservices/sandesha/trunk/c/src/workers/sender.c Thu Dec 14 21:33:32 2006
@@ -265,10 +265,10 @@
AXIS2_SLEEP(SANDESHA2_SENDER_SLEEP_TIME);
transaction = sandesha2_storage_mgr_get_transaction(storage_mgr,
- env);
+ env);
mgr = sandesha2_storage_mgr_get_retrans_mgr(storage_mgr, env);
seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(
- storage_mgr, env);
+ storage_mgr, env);
sender_bean = sandesha2_sender_mgr_get_next_msg_to_send(mgr, env);
if(!sender_bean)
{
@@ -276,7 +276,8 @@
"So continue");
continue;
}
- msg_id = sandesha2_sender_bean_get_msg_id(sender_bean, env);
+ msg_id = sandesha2_sender_bean_get_msg_id((sandesha2_rm_bean_t *)
+ sender_bean, env);
sandesha2_transaction_commit(transaction, env);
if(msg_id)
{
Modified: webservices/sandesha/trunk/c/src/workers/sender_worker.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/workers/sender_worker.c?view=diff&rev=487452&r1=487451&r2=487452
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/sender_worker.c (original)
+++ webservices/sandesha/trunk/c/src/workers/sender_worker.c Thu Dec 14 21:33:32 2006
@@ -280,7 +280,7 @@
qualified_for_sending, SANDESHA2_VALUE_TRUE))
{
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
- "[sandesha2] Message is not qualified for sending sending");
+ "[sandesha2] Message is not qualified for sending");
return NULL;
}
rm_msg_ctx = sandesha2_msg_init_init_msg(env, msg_ctx);
@@ -379,7 +379,8 @@
AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env,
SANDESHA2_WITHIN_TRANSACTION, property, AXIS2_FALSE);
}
- msg_id = sandesha2_sender_bean_get_msg_id(sender_worker_bean, env);
+ msg_id = sandesha2_sender_bean_get_msg_id((sandesha2_rm_bean_t *)
+ sender_worker_bean, env);
bean1 = sandesha2_sender_mgr_retrieve(sender_mgr, env, msg_id);
if(bean1)
{
@@ -398,7 +399,8 @@
{
axis2_char_t *msg_stored_key = NULL;
- msg_id = sandesha2_sender_bean_get_msg_id(bean1, env);
+ msg_id = sandesha2_sender_bean_get_msg_id((sandesha2_rm_bean_t *)
+ bean1, env);
sandesha2_sender_mgr_remove(sender_mgr, env, msg_id);
/* Removing the message from the storage */
msg_stored_key = sandesha2_sender_bean_get_msg_ctx_ref_key(
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org