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/05/04 13:03:59 UTC

svn commit: r535164 - in /webservices/sandesha/trunk/c: config/module.xml include/sandesha2_constants.h src/storage/mysql/permanent_transaction.c

Author: damitha
Date: Fri May  4 04:03:58 2007
New Revision: 535164

URL: http://svn.apache.org/viewvc?view=rev&rev=535164
Log:
added db parameters to the module.xml. Now server, user name and password
for mysql is configurable. default is localhost, g, g

Modified:
    webservices/sandesha/trunk/c/config/module.xml
    webservices/sandesha/trunk/c/include/sandesha2_constants.h
    webservices/sandesha/trunk/c/src/storage/mysql/permanent_transaction.c

Modified: webservices/sandesha/trunk/c/config/module.xml
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/config/module.xml?view=diff&rev=535164&r1=535163&r2=535164
==============================================================================
--- webservices/sandesha/trunk/c/config/module.xml (original)
+++ webservices/sandesha/trunk/c/config/module.xml Fri May  4 04:03:58 2007
@@ -69,6 +69,9 @@
 
    <!-- Database connection parameters -->
    <parameter name="sandesha2_db" locked="false">/axis2c/deploy</parameter>
+   <parameter name="db_server" locked="false">localhost</parameter>
+   <parameter name="db_user" locked="false">g</parameter>
+   <parameter name="db_password" locked="false">g</parameter>
    <!-- General parameters -->
     <parameter name="ExponentialBackoff" locked="false">AXIS2_FALSE</parameter>
     <parameter name="RetransmissionInterval" locked="false">1</parameter>

Modified: webservices/sandesha/trunk/c/include/sandesha2_constants.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_constants.h?view=diff&rev=535164&r1=535163&r2=535164
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_constants.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_constants.h Fri May  4 04:03:58 2007
@@ -506,6 +506,9 @@
     #define SANDESHA2_BUSY_WAIT_TIME 1
     #define SANDESHA2_IS_SVR_SIDE "is_svr_side" 
     #define SANDESHA2_DB "sandesha2_db"
+    #define SANDESHA2_DB_SERVER "sandesha2_server"
+    #define SANDESHA2_DB_USER "db_user"
+    #define SANDESHA2_DB_PASSWORD "db_password"
 /** @} */
 #ifdef __cplusplus
 }

Modified: webservices/sandesha/trunk/c/src/storage/mysql/permanent_transaction.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/mysql/permanent_transaction.c?view=diff&rev=535164&r1=535163&r2=535164
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/mysql/permanent_transaction.c (original)
+++ webservices/sandesha/trunk/c/src/storage/mysql/permanent_transaction.c Fri May  4 04:03:58 2007
@@ -95,9 +95,9 @@
     unsigned long int thread_id)
 {
     sandesha2_permanent_transaction_impl_t *trans_impl = NULL;
-    char *server = "localhost";
-    char *user = "g";
-    char *password = "g";
+    axis2_char_t *server = NULL;
+    axis2_char_t *user = NULL;
+    axis2_char_t *password = NULL;
     axis2_char_t *path = NULL;
     axis2_char_t *db_name = NULL;
     int rc = -1;
@@ -106,6 +106,8 @@
     sandesha2_property_bean_t *prop_bean = NULL;
     axis2_ctx_t *conf_ctx_base = NULL; 
     axutil_property_t *property = NULL;
+    axis2_module_desc_t *module_desc = NULL;
+    axutil_qname_t *qname = NULL;
 
     AXIS2_ENV_CHECK(env, NULL);
     
@@ -127,23 +129,39 @@
         return NULL;
     prop_bean = (sandesha2_property_bean_t *)sandesha2_utils_get_property_bean(
         env, conf);
-    /*path = sandesha2_property_bean_get_db_path(prop_bean, env);*/
+    qname = axutil_qname_create(env, "sandesha2", NULL, NULL);
+    module_desc = axis2_conf_get_module(conf, env, qname);
+    if(module_desc)
     {
-        axis2_module_desc_t *module_desc = NULL;
-        axutil_qname_t *qname = NULL;
-        qname = axutil_qname_create(env, "sandesha2", NULL, NULL);
-        module_desc = axis2_conf_get_module(conf, env, qname);
-        if(module_desc)
+        axutil_param_t *db_path = NULL;
+        axutil_param_t *db_server = NULL;
+        axutil_param_t *db_user = NULL;
+        axutil_param_t *db_password = NULL;
+        db_path = axis2_module_desc_get_param(module_desc, env, SANDESHA2_DB);
+        if(db_path)
         {
-            axutil_param_t *db_param = NULL;
-            db_param = axis2_module_desc_get_param(module_desc, env, SANDESHA2_DB);
-            if(db_param)
-            {
-                path = (axis2_char_t *) axutil_param_get_value(db_param, env);
-            }
+            path = (axis2_char_t *) axutil_param_get_value(db_path, env);
+        }
+        db_server = axis2_module_desc_get_param(module_desc, env, 
+            SANDESHA2_DB_SERVER);
+        if(db_server)
+        {
+            server = (axis2_char_t *) axutil_param_get_value(db_server, env);
+        }
+        db_user = axis2_module_desc_get_param(module_desc, env, 
+            SANDESHA2_DB_USER);
+        if(db_user)
+        {
+            user = (axis2_char_t *) axutil_param_get_value(db_user, env);
+        }
+        db_password = axis2_module_desc_get_param(module_desc, env, 
+            SANDESHA2_DB_PASSWORD);
+        if(db_password)
+        {
+            password = (axis2_char_t *) axutil_param_get_value(db_password, env);
         }
-        axutil_qname_free(qname, env);
     }
+    axutil_qname_free(qname, env);
     conf_ctx_base = axis2_conf_ctx_get_base(conf_ctx, env);
     property = axis2_ctx_get_property(conf_ctx_base, env, 
         SANDESHA2_IS_SVR_SIDE);



---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org