ws-savan-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r762609 - in /webservices/savan/trunk/c: include/ src/msgreceivers/ src/publisher/common/ src/publisher/default/ src/publisher/esb/ src/storage/inmemory/ src/storage/service/ src/storage/sqlite/
Date Tue, 07 Apr 2009 03:07:36 GMT
Author: damitha
Date: Tue Apr  7 03:07:36 2009
New Revision: 762609

URL: http://svn.apache.org/viewvc?rev=762609&view=rev
Log: (empty)

Modified:
    webservices/savan/trunk/c/include/savan_publisher_mod.h
    webservices/savan/trunk/c/src/msgreceivers/savan_msg_recv.c
    webservices/savan/trunk/c/src/publisher/common/publisher_mod.c
    webservices/savan/trunk/c/src/publisher/default/publisher_mod.c
    webservices/savan/trunk/c/src/publisher/esb/publisher_mod.c
    webservices/savan/trunk/c/src/storage/inmemory/storage_mgr_inmemory.c
    webservices/savan/trunk/c/src/storage/service/service_storage_mgr.c
    webservices/savan/trunk/c/src/storage/sqlite/storage_mgr.c

Modified: webservices/savan/trunk/c/include/savan_publisher_mod.h
URL: http://svn.apache.org/viewvc/webservices/savan/trunk/c/include/savan_publisher_mod.h?rev=762609&r1=762608&r2=762609&view=diff
==============================================================================
--- webservices/savan/trunk/c/include/savan_publisher_mod.h (original)
+++ webservices/savan/trunk/c/include/savan_publisher_mod.h Tue Apr  7 03:07:36 2009
@@ -27,6 +27,7 @@
 #include <axis2_conf.h>
 #include <axis2_msg_ctx.h>
 #include <axiom_node.h>
+#include <savan_storage_mgr.h>
 
 #ifdef __cplusplus
 extern "C"
@@ -56,7 +57,8 @@
             publish)(
                 savan_publisher_mod_t *publisher, 
                 const axutil_env_t *env,
-                void *msg_ctx);
+                void *msg_ctx,
+                savan_storage_mgr_t *storage_mgr);
 
 };
 
@@ -73,11 +75,20 @@
  * @return status of the operation
  */
 AXIS2_EXTERN savan_publisher_mod_t * AXIS2_CALL
-savan_publisher_mod_create(
+savan_publisher_mod_create_with_conf(
     const axutil_env_t *env,
     axis2_conf_t *conf);
 
 /**
+ * Create the savan publisher.
+ * @param env environment object
+ * @return status of the operation
+ */
+AXIS2_EXTERN savan_publisher_mod_t * AXIS2_CALL
+savan_publisher_mod_create(
+    const axutil_env_t *env);
+
+/**
  * Deallocate the publisher.
  * @param publisher
  * @param env environment object
@@ -97,7 +108,8 @@
 savan_publisher_mod_publish(
     savan_publisher_mod_t *publishermod, 
     const axutil_env_t *env,
-    void *msg_ctx);
+    void *msg_ctx,
+    savan_storage_mgr_t *storage_mgr);
 
 /** @} */
 #ifdef __cplusplus

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=762609&r1=762608&r2=762609&view=diff
==============================================================================
--- webservices/savan/trunk/c/src/msgreceivers/savan_msg_recv.c (original)
+++ webservices/savan/trunk/c/src/msgreceivers/savan_msg_recv.c Tue Apr  7 03:07:36 2009
@@ -114,15 +114,17 @@
     axis2_conf_t *conf = NULL;
     axis2_conf_ctx_t *conf_ctx = NULL;
     savan_publisher_mod_t *pub_mod = NULL;
+    savan_storage_mgr_t *storage_mgr = NULL;
     
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[savan] Entry:savan_msg_recv_handle_event");
    
     conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
     conf = axis2_conf_ctx_get_conf(conf_ctx, env);
 
-    pub_mod = savan_publisher_mod_create(env, conf);
+    pub_mod = savan_publisher_mod_create_with_conf(env, conf);
 
-    savan_publisher_mod_publish(pub_mod, env, msg_ctx);
+    storage_mgr = savan_util_get_storage_mgr(env, conf_ctx, conf);
+    savan_publisher_mod_publish(pub_mod, env, msg_ctx, storage_mgr);
     savan_publisher_mod_free(pub_mod, env);
     
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[savan] Exit:savan_msg_recv_handle_event");

Modified: webservices/savan/trunk/c/src/publisher/common/publisher_mod.c
URL: http://svn.apache.org/viewvc/webservices/savan/trunk/c/src/publisher/common/publisher_mod.c?rev=762609&r1=762608&r2=762609&view=diff
==============================================================================
--- webservices/savan/trunk/c/src/publisher/common/publisher_mod.c (original)
+++ webservices/savan/trunk/c/src/publisher/common/publisher_mod.c Tue Apr  7 03:07:36 2009
@@ -37,8 +37,9 @@
 savan_publisher_mod_publish(
     savan_publisher_mod_t *publishermod, 
     const axutil_env_t *env,
-    void *msg_ctx)
+    void *msg_ctx,
+    savan_storage_mgr_t *storage_mgr)
 {
-    publishermod->ops->publish(publishermod, env, msg_ctx);
+    publishermod->ops->publish(publishermod, env, msg_ctx, storage_mgr);
 }
 

Modified: webservices/savan/trunk/c/src/publisher/default/publisher_mod.c
URL: http://svn.apache.org/viewvc/webservices/savan/trunk/c/src/publisher/default/publisher_mod.c?rev=762609&r1=762608&r2=762609&view=diff
==============================================================================
--- webservices/savan/trunk/c/src/publisher/default/publisher_mod.c (original)
+++ webservices/savan/trunk/c/src/publisher/default/publisher_mod.c Tue Apr  7 03:07:36 2009
@@ -60,7 +60,8 @@
 savan_default_publisher_mod_publish(
     savan_publisher_mod_t *publishermod,
     const axutil_env_t *env,
-    void *msg_ctx);
+    void *msg_ctx,
+    savan_storage_mgr_t *storage_mgr);
 
 static axis2_status_t
 savan_default_publisher_mod_publish_to_subscriber(
@@ -78,7 +79,7 @@
 };
 
 AXIS2_EXTERN savan_publisher_mod_t * AXIS2_CALL
-savan_publisher_mod_create(
+savan_publisher_mod_create_with_conf(
     const axutil_env_t *env,
     axis2_conf_t *conf)
 {
@@ -99,6 +100,13 @@
     return (savan_publisher_mod_t *) publishermodimpl;
 }
 
+AXIS2_EXTERN savan_publisher_mod_t * AXIS2_CALL
+savan_publisher_mod_create(
+    const axutil_env_t *env)
+{
+    return NULL;
+}
+
 AXIS2_EXTERN void AXIS2_CALL
 savan_default_publisher_mod_free(
     savan_publisher_mod_t *publishermod,
@@ -124,12 +132,12 @@
 savan_default_publisher_mod_publish(
     savan_publisher_mod_t *publishermod,
     const axutil_env_t *env,
-    void *msg_ctx)
+    void *msg_ctx,
+    savan_storage_mgr_t *storage_mgr)
 {
     savan_default_publisher_mod_t *publishermodimpl = NULL;
     axutil_array_list_t *subs_store = NULL;
     int i = 0, size = 0;
-    savan_storage_mgr_t *storage_mgr = NULL;
     savan_filter_mod_t *filtermod = NULL;
     axis2_char_t *path = NULL;
     axis2_conf_ctx_t *client_conf_ctx = NULL;
@@ -145,7 +153,6 @@
 
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[savan] Entry:savan_default_publisher_mod_publish");
 
-    storage_mgr = savan_util_get_storage_mgr(env, NULL, publishermodimpl->conf);
     axutil_allocator_switch_to_global_pool(env->allocator);
     if(storage_mgr)
     {

Modified: webservices/savan/trunk/c/src/publisher/esb/publisher_mod.c
URL: http://svn.apache.org/viewvc/webservices/savan/trunk/c/src/publisher/esb/publisher_mod.c?rev=762609&r1=762608&r2=762609&view=diff
==============================================================================
--- webservices/savan/trunk/c/src/publisher/esb/publisher_mod.c (original)
+++ webservices/savan/trunk/c/src/publisher/esb/publisher_mod.c Tue Apr  7 03:07:36 2009
@@ -53,8 +53,7 @@
     savan_publisher_mod_t *publishermod,
     const axutil_env_t *env,
     void *msg_ctx,
-    savan_subscriber_t *subscriber,
-    savan_filter_mod_t *filtermod);
+    savan_subscriber_t *subscriber);
 
 AXIS2_EXTERN void AXIS2_CALL
 savan_esb_publisher_mod_free(
@@ -65,7 +64,8 @@
 savan_esb_publisher_mod_publish(
     savan_publisher_mod_t *publishermod,
     const axutil_env_t *env,
-    void *msg_ctx);
+    void *msg_ctx,
+    savan_storage_mgr_t *storage_mgr);
 
 static const savan_publisher_mod_ops_t savan_publisher_mod_ops = 
 {
@@ -75,6 +75,27 @@
 
 AXIS2_EXTERN savan_publisher_mod_t * AXIS2_CALL
 savan_publisher_mod_create(
+    const axutil_env_t *env)
+{
+    savan_esb_publisher_mod_t *publishermodimpl = NULL;
+    
+    publishermodimpl = AXIS2_MALLOC(env->allocator, sizeof(savan_esb_publisher_mod_t));
+    if (!publishermodimpl)
+    {
+        AXIS2_HANDLE_ERROR(env, SAVAN_ERROR_FILTER_CREATION_FAILED, AXIS2_FAILURE);
+        return NULL;
+    }
+
+    memset ((void *) publishermodimpl, 0, sizeof(savan_esb_publisher_mod_t));
+
+    publishermodimpl->conf = NULL;
+    publishermodimpl->publishermod.ops = &savan_publisher_mod_ops;
+
+    return (savan_publisher_mod_t *) publishermodimpl;
+}
+
+AXIS2_EXTERN savan_publisher_mod_t * AXIS2_CALL
+savan_publisher_mod_create_with_conf(
     const axutil_env_t *env,
     axis2_conf_t *conf)
 {
@@ -120,21 +141,19 @@
 savan_esb_publisher_mod_publish(
     savan_publisher_mod_t *publishermod,
     const axutil_env_t *env,
-    void *esb_ctx)
+    void *esb_ctx,
+    savan_storage_mgr_t *storage_mgr)
 {
     savan_esb_publisher_mod_t *publishermodimpl = NULL;
 
     axutil_array_list_t *subs_store = NULL;
     int i = 0, size = 0;
-    savan_storage_mgr_t *storage_mgr = NULL;
-    savan_filter_mod_t *filtermod = NULL;
     axis2_char_t *filter = NULL;
 
     publishermodimpl = SAVAN_INTF_TO_IMPL(publishermod);
 
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[savan] Entry:savan_esb_publisher_mod_publish");
 
-    storage_mgr = savan_util_get_storage_mgr(env, NULL, publishermodimpl->conf);
     axutil_allocator_switch_to_global_pool(env->allocator);
     if(storage_mgr)
     {
@@ -158,13 +177,11 @@
             axis2_char_t *id = savan_subscriber_get_id(sub, env);
             AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[savan] Publishing to:%s", id);
 
-            filtermod = savan_util_get_filter_module(env, publishermodimpl->conf);
             /* Ideally publishing to each subscriber should happen within a thread for each

              * subscriber. However until Axis2/C provide a good thread pool to handle
              * such tasks I use this sequential publishing to subscribers.
              */
-            if(!savan_esb_publisher_mod_publish_to_subscriber(publishermod, env, esb_ctx,
sub, 
-                        filtermod))
+            if(!savan_esb_publisher_mod_publish_to_subscriber(publishermod, env, esb_ctx,
sub))
             {
                 axis2_endpoint_ref_t *notifyto = savan_subscriber_get_notify_to(sub, env);
                 const axis2_char_t *address = NULL;
@@ -192,12 +209,10 @@
     savan_publisher_mod_t *publishermod,
     const axutil_env_t *env,
     void *esb_ctx,
-    savan_subscriber_t *subscriber,
-    savan_filter_mod_t *filtermod)
+    savan_subscriber_t *subscriber)
 {
     axis2_status_t status = AXIS2_SUCCESS;
     const axis2_char_t *address = NULL;
-    axis2_bool_t filter_apply = AXIS2_TRUE;
     axis2_endpoint_ref_t *notifyto = NULL;
     esb_rt_epr_t *epr = NULL;
     axiom_soap_envelope_t *envelope = NULL;
@@ -226,36 +241,8 @@
     body_node = axiom_soap_body_get_base_node(body, env);
     payload = axiom_node_get_first_element(body_node, env);
 
-    /* If this is a filtering request and we cannot find any filter module to filter then
error */
-    if(savan_subscriber_get_filter(subscriber, env) && !filtermod)
-    {
-        AXIS2_HANDLE_ERROR(env, SAVAN_ERROR_FILTER_MODULE_COULD_NOT_BE_RETRIEVED, AXIS2_FAILURE);
-        return AXIS2_FAILURE;
-    }
-
-#ifdef SAVAN_FILTERING
-    /* If this is a filtering request and filter module is defined then filter the request.
-     */
-    if(filtermod && savan_subscriber_get_filter(subscriber, env))
-    {
-	    /* Apply the filter, and check whether it evaluates to success */
-        filter_apply = savan_filter_mod_apply(filtermod ,env, subscriber, payload);
-        if(!filter_apply)
-        {
-            status = axutil_error_get_status_code(env->error);
-            if(AXIS2_SUCCESS != status)
-            {
-                axiom_node_detach(payload, env);
-                return status;
-            }
-        }
-    }
-#endif
 
-    if(filter_apply)
-    {
-        esb_send_on_out_only(env, epr, (esb_ctx_t *) esb_ctx);
-    }
+    esb_send_on_out_only(env, epr, (esb_ctx_t *) esb_ctx);
 	
     axiom_node_detach(payload, env); /*insert this to prevent payload corruption in subsequent

                                        "publish" calls with some payload.*/

Modified: webservices/savan/trunk/c/src/storage/inmemory/storage_mgr_inmemory.c
URL: http://svn.apache.org/viewvc/webservices/savan/trunk/c/src/storage/inmemory/storage_mgr_inmemory.c?rev=762609&r1=762608&r2=762609&view=diff
==============================================================================
--- webservices/savan/trunk/c/src/storage/inmemory/storage_mgr_inmemory.c (original)
+++ webservices/savan/trunk/c/src/storage/inmemory/storage_mgr_inmemory.c Tue Apr  7 03:07:36
2009
@@ -24,3 +24,13 @@
 	return NULL;
 }
 
+AXIS2_EXTERN savan_storage_mgr_t * AXIS2_CALL
+savan_storage_mgr_create_with_connection_info(
+    const axutil_env_t *env,
+    axis2_char_t *connection_string,
+    axis2_char_t *username,
+    axis2_char_t *password)
+{
+    return NULL;
+}
+

Modified: webservices/savan/trunk/c/src/storage/service/service_storage_mgr.c
URL: http://svn.apache.org/viewvc/webservices/savan/trunk/c/src/storage/service/service_storage_mgr.c?rev=762609&r1=762608&r2=762609&view=diff
==============================================================================
--- webservices/savan/trunk/c/src/storage/service/service_storage_mgr.c (original)
+++ webservices/savan/trunk/c/src/storage/service/service_storage_mgr.c Tue Apr  7 03:07:36
2009
@@ -166,6 +166,15 @@
     return (savan_storage_mgr_t *) storage_mgr_impl;
 }
 
+AXIS2_EXTERN savan_storage_mgr_t * AXIS2_CALL
+savan_storage_mgr_create_with_connection_info(
+    const axutil_env_t *env,
+    axis2_char_t *connection_string,
+    axis2_char_t *username,
+    axis2_char_t *password)
+{
+}
+
 AXIS2_EXTERN void AXIS2_CALL
 savan_service_storage_mgr_free(
     savan_storage_mgr_t *storage_mgr,

Modified: webservices/savan/trunk/c/src/storage/sqlite/storage_mgr.c
URL: http://svn.apache.org/viewvc/webservices/savan/trunk/c/src/storage/sqlite/storage_mgr.c?rev=762609&r1=762608&r2=762609&view=diff
==============================================================================
--- webservices/savan/trunk/c/src/storage/sqlite/storage_mgr.c (original)
+++ webservices/savan/trunk/c/src/storage/sqlite/storage_mgr.c Tue Apr  7 03:07:36 2009
@@ -159,6 +159,16 @@
     return (savan_storage_mgr_t *) storage_mgr_impl;
 }
 
+AXIS2_EXTERN savan_storage_mgr_t * AXIS2_CALL
+savan_storage_mgr_create_with_connection_info(
+    const axutil_env_t *env,
+    axis2_char_t *connection_string,
+    axis2_char_t *username,
+    axis2_char_t *password)
+{
+    return NULL;
+}
+
 AXIS2_EXTERN void AXIS2_CALL
 savan_sqlite_storage_mgr_free(
     savan_storage_mgr_t *storage_mgr,



Mime
View raw message