You are viewing a plain text version of this content. The canonical link for it is here.
Posted to savan-dev@ws.apache.org by da...@apache.org on 2009/03/13 12:43:58 UTC
svn commit: r753211 - in /webservices/savan/trunk/c/src:
msgreceivers/savan_msg_recv.c util/savan_util.c
Author: damitha
Date: Fri Mar 13 11:43:57 2009
New Revision: 753211
URL: http://svn.apache.org/viewvc?rev=753211&view=rev
Log:
Adding calls to storage manager in global pool
Modified:
webservices/savan/trunk/c/src/msgreceivers/savan_msg_recv.c
webservices/savan/trunk/c/src/util/savan_util.c
Modified: webservices/savan/trunk/c/src/msgreceivers/savan_msg_recv.c
URL: http://svn.apache.org/viewvc/webservices/savan/trunk/c/src/msgreceivers/savan_msg_recv.c?rev=753211&r1=753210&r2=753211&view=diff
==============================================================================
--- webservices/savan/trunk/c/src/msgreceivers/savan_msg_recv.c (original)
+++ webservices/savan/trunk/c/src/msgreceivers/savan_msg_recv.c Fri Mar 13 11:43:57 2009
@@ -477,6 +477,14 @@
/* Expires element */
subscriber = savan_util_get_subscriber_from_msg(env, msg_ctx, storage_mgr, NULL);
+ if(!subscriber)
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+ "[savan] Failed get subscriber using msg from storage manager");
+ AXIS2_HANDLE_ERROR(env, SAVAN_ERROR_SUBSCRIBER_NOT_FOUND, AXIS2_FAILURE);
+
+ return AXIS2_FAILURE;
+ }
expires = savan_subscriber_get_expires(subscriber, env);
if(expires)
{
Modified: webservices/savan/trunk/c/src/util/savan_util.c
URL: http://svn.apache.org/viewvc/webservices/savan/trunk/c/src/util/savan_util.c?rev=753211&r1=753210&r2=753211&view=diff
==============================================================================
--- webservices/savan/trunk/c/src/util/savan_util.c (original)
+++ webservices/savan/trunk/c/src/util/savan_util.c Fri Mar 13 11:43:57 2009
@@ -230,7 +230,9 @@
sub_id = savan_util_get_subscription_id_from_msg(env, msg_ctx);
}
+ axutil_allocator_switch_to_global_pool(env->allocator);
subscriber = savan_storage_mgr_retrieve_subscriber(storage_mgr, env, sub_id);
+ axutil_allocator_switch_to_local_pool(env->allocator);
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[savan] Entry:savan_util_get_subscriber_from_msg");
@@ -270,7 +272,9 @@
sub_id = savan_util_get_subscription_id_from_msg(env, msg_ctx);
}
+ axutil_allocator_switch_to_global_pool(env->allocator);
subscriber = savan_storage_mgr_retrieve_subscriber(storage_mgr, env, sub_id);
+ axutil_allocator_switch_to_local_pool(env->allocator);
/* Get soap envelop and extract the subscription id */
@@ -353,6 +357,7 @@
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[savan] Entry:savan_util_add_subscriber");
+ axutil_allocator_switch_to_global_pool(env->allocator);
status = savan_storage_mgr_insert_subscriber(storage_mgr, env, subscriber);
if(status)
{
@@ -361,6 +366,7 @@
savan_subscriber_free_void_arg, subscriber);
axis2_msg_ctx_set_property(msg_ctx, env, SAVAN_SUBSCRIBER, subs_prop);
}
+ axutil_allocator_switch_to_local_pool(env->allocator);
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[savan] Exit:savan_util_add_subscriber");
return status;
@@ -375,7 +381,9 @@
{
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[savan] Entry:savan_util_update_subscriber");
+ axutil_allocator_switch_to_global_pool(env->allocator);
savan_storage_mgr_update_subscriber(storage_mgr, env, subscriber);
+ axutil_allocator_switch_to_local_pool(env->allocator);
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[savan] Exit:savan_util_update_subscriber");
return AXIS2_SUCCESS;
@@ -388,17 +396,15 @@
savan_storage_mgr_t *storage_mgr,
savan_subscriber_t *subscriber)
{
- AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[savan] Entry:savan_util_remove_subscriber");
-
- {
- const axis2_char_t *subs_id = NULL;
+ const axis2_char_t *subs_id = NULL;
- subs_id = savan_subscriber_get_id(subscriber, env);
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[savan] Entry:savan_util_remove_subscriber");
- /* Extract the store from the svc and remove the given subscriber */
+ axutil_allocator_switch_to_global_pool(env->allocator);
+ subs_id = savan_subscriber_get_id(subscriber, env);
- savan_storage_mgr_remove_subscriber(storage_mgr, env, subs_id);
- }
+ savan_storage_mgr_remove_subscriber(storage_mgr, env, subs_id);
+ axutil_allocator_switch_to_local_pool(env->allocator);
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[savan] Exit:savan_util_remove_subscriber");
return AXIS2_SUCCESS;
@@ -910,6 +916,7 @@
axutil_property_t *storage_mgr_prop = NULL;
savan_storage_mgr_t *storage_mgr = NULL;
+ axutil_allocator_switch_to_global_pool(env->allocator);
if(conf_ctx)
{
storage_mgr_prop = axis2_conf_ctx_get_property(conf_ctx, env, SAVAN_STORAGE_MANAGER);
@@ -929,6 +936,8 @@
axis2_conf_ctx_set_property(conf_ctx, env, SAVAN_STORAGE_MANAGER, storage_mgr_prop);
}
}
+
+ axutil_allocator_switch_to_local_pool(env->allocator);
return storage_mgr;
}