You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by da...@apache.org on 2006/01/24 09:27:17 UTC

svn commit: r371864 - in /webservices/axis2/trunk/c: include/axis2_dll_desc.h include/axis2_file.h modules/core/deployment/dep_engine.c modules/core/deployment/svc_builder.c modules/util/dir_handler.c modules/util/file.c

Author: damitha
Date: Tue Jan 24 00:27:05 2006
New Revision: 371864

URL: http://svn.apache.org/viewcvs?rev=371864&view=rev
Log:
Fixed the bug of not taking service file path correctly

Modified:
    webservices/axis2/trunk/c/include/axis2_dll_desc.h
    webservices/axis2/trunk/c/include/axis2_file.h
    webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c
    webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c
    webservices/axis2/trunk/c/modules/util/dir_handler.c
    webservices/axis2/trunk/c/modules/util/file.c

Modified: webservices/axis2/trunk/c/include/axis2_dll_desc.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_dll_desc.h?rev=371864&r1=371863&r2=371864&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_dll_desc.h (original)
+++ webservices/axis2/trunk/c/include/axis2_dll_desc.h Tue Jan 24 00:27:05 2006
@@ -150,6 +150,9 @@
 AXIS2_DECLARE(axis2_dll_desc_t*) 
 axis2_dll_desc_create(axis2_env_t **env);
 
+#define AXIS2_DLL_DESC_FREE(dll_desc, env) \
+    ((dll_desc)->ops->free(dll_desc, env))
+
 #define AXIS2_DLL_DESC_GET_NAME(dll_desc, env) \
     ((dll_desc)->ops->get_name(dll_desc, env))
     

Modified: webservices/axis2/trunk/c/include/axis2_file.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_file.h?rev=371864&r1=371863&r2=371864&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_file.h (original)
+++ webservices/axis2/trunk/c/include/axis2_file.h Tue Jan 24 00:27:05 2006
@@ -58,6 +58,15 @@
                 axis2_env_t **env);
     
     axis2_status_t (AXIS2_CALL *
+    set_path)(axis2_file_t *file,
+                axis2_env_t **env,
+                axis2_char_t *path);
+    
+    axis2_char_t *(AXIS2_CALL *
+    get_path)(axis2_file_t *file,
+                axis2_env_t **env);
+    
+    axis2_status_t (AXIS2_CALL *
     set_timestamp)(axis2_file_t *file,
                     axis2_env_t **env,
                     AXIS2_TIME_T timestamp);
@@ -101,6 +110,12 @@
 
 #define AXIS2_FILE_SET_NAME(file, env, name) \
 		((file)->ops->set_name (file, env, name)) 
+
+#define AXIS2_FILE_GET_PATH(file, env) \
+		((file)->ops->get_path (file, env))  
+
+#define AXIS2_FILE_SET_PATH(file, env, path) \
+		((file)->ops->set_path (file, env, path)) 
 
 #define AXIS2_FILE_GET_TIMESTAMP(file, env) \
 		((file)->ops->get_timestamp (file, env))  

Modified: webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c?rev=371864&r1=371863&r2=371864&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c Tue Jan 24 00:27:05 2006
@@ -1302,6 +1302,9 @@
             engine_impl->curr_file = (axis2_arch_file_data_t *) 
                 AXIS2_ARRAY_LIST_GET(engine_impl->ws_to_deploy, env, i);
             
+            axis2_file_t *svc_folder = AXIS2_ARCH_FILE_DATA_GET_FILE(engine_impl->curr_file, env);
+            axis2_char_t *svc_folder_path = AXIS2_FILE_GET_PATH(svc_folder, env);
+            axis2_char_t *folder_name = AXIS2_FILE_GET_NAME(svc_folder, env);
             type = AXIS2_ARCH_FILE_DATA_GET_TYPE(engine_impl->curr_file, env);
             switch (type) 
             {

Modified: webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c?rev=371864&r1=371863&r2=371864&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c Tue Jan 24 00:27:05 2006
@@ -240,11 +240,15 @@
     axis2_char_t *svc_dll_name = NULL;
     axis2_dll_desc_t *dll_desc = NULL;
     axis2_param_t *impl_info_param = NULL;
-    axis2_char_t *repos_path = NULL;
+    /*axis2_char_t *repos_path = NULL;
     axis2_char_t *svcs_path = NULL;
     axis2_char_t *temp_path1 = NULL;
     axis2_char_t *temp_path2 = NULL;
     axis2_char_t *temp_path3 = NULL;
+    */
+    axis2_arch_file_data_t *arch_file_data = NULL;
+    axis2_file_t *svc_folder = NULL;
+    axis2_char_t *temp_path = NULL;
     axis2_char_t *dll_path = NULL;
     axis2_char_t *svc_folder_path = NULL;
     int i = 0;
@@ -329,34 +333,47 @@
     dll_desc = axis2_dll_desc_create(env);
     impl_info_param = AXIS2_PARAM_CONTAINER_GET_PARAM(builder_impl->svc->
         param_container, env, AXIS2_SERVICE_CLASS);
+    if(!impl_info_param)
+    {
+        AXIS2_DLL_DESC_FREE(dll_desc, env);
+        return AXIS2_FAILURE;
+    }
     svc_dll_name = AXIS2_PARAM_GET_VALUE(impl_info_param, env);
     
-    repos_path = AXIS2_DEP_ENGINE_GET_REPOS_PATH(builder_impl->svc_builder.
+    /*repos_path = AXIS2_DEP_ENGINE_GET_REPOS_PATH(builder_impl->svc_builder.
         desc_builder->engine, env);
+    printf("repos_path:%s\n", repos_path);
     temp_path1 = AXIS2_STRACAT(repos_path, AXIS2_PATH_SEP_STR, env);
     temp_path2 = AXIS2_STRACAT(temp_path1, AXIS2_SERVICE_FOLDER, env);
     svcs_path = AXIS2_STRACAT(temp_path2, AXIS2_PATH_SEP_STR, env);
     temp_path3 = AXIS2_STRACAT(svcs_path, svc_name, env);
-    svc_folder_path = AXIS2_STRACAT(temp_path3, AXIS2_PATH_SEP_STR, env);
-    dll_path = AXIS2_STRACAT(svc_folder_path, svc_dll_name, env);
+    svc_folder_path = AXIS2_STRACAT(temp_path3, AXIS2_PATH_SEP_STR, env);*/
+    
+    arch_file_data = AXIS2_DEP_ENGINE_GET_CURRENT_FILE_ITEM(builder_impl->
+        svc_builder.desc_builder->engine, env);
+    svc_folder = AXIS2_ARCH_FILE_DATA_GET_FILE(arch_file_data, env);
+    svc_folder_path = AXIS2_FILE_GET_PATH(svc_folder, env);
+    temp_path = AXIS2_STRACAT(svc_folder_path, AXIS2_PATH_SEP_STR, env);
+    dll_path = AXIS2_STRACAT(temp_path, svc_dll_name, env);
+    printf("dll_path:%s\n", dll_path);
     AXIS2_DLL_DESC_SET_NAME(dll_desc, env, dll_path);
     /* param does not free the value, because it does not know the value type.
      * therefore we free the value
      */
     AXIS2_FREE((*env)->allocator, svc_dll_name);
     /* free all temp vars */
-    AXIS2_FREE((*env)->allocator, repos_path);
-    AXIS2_FREE((*env)->allocator, svcs_path);
+    /*AXIS2_FREE((*env)->allocator, svcs_path);
     AXIS2_FREE((*env)->allocator, temp_path1);
     AXIS2_FREE((*env)->allocator, temp_path2);
-    AXIS2_FREE((*env)->allocator, temp_path3);
+    AXIS2_FREE((*env)->allocator, temp_path3);*/
+    AXIS2_FREE((*env)->allocator, temp_path);
     AXIS2_FREE((*env)->allocator, svc_folder_path);
     AXIS2_FREE((*env)->allocator, dll_path);
     
     AXIS2_DLL_DESC_SET_TYPE(dll_desc, env, AXIS2_SVC_DLL);
     axis2_class_loader_init(env);
     AXIS2_PARAM_SET_VALUE(impl_info_param, env, dll_desc);
-         
+      
     /* end of my logic */
     /* processing service wide modules which required to engage globally */
     qmodulest = axis2_qname_create(env, AXIS2_MODULEST, NULL, NULL);

Modified: webservices/axis2/trunk/c/modules/util/dir_handler.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/dir_handler.c?rev=371864&r1=371863&r2=371864&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/dir_handler.c (original)
+++ webservices/axis2/trunk/c/modules/util/dir_handler.c Tue Jan 24 00:27:05 2006
@@ -71,6 +71,7 @@
         strcpy(path, pathname);
         strcat(path, AXIS2_PATH_SEP_STR);
         strcat(path, fname);
+        AXIS2_FILE_SET_PATH(arch_file, env, path);
         buf = AXIS2_MALLOC((*env)->allocator, sizeof(struct stat));
         if(!buf)
         {
@@ -146,6 +147,7 @@
         strcpy(path, pathname);
         strcat(path, AXIS2_PATH_SEP_STR);
         strcat(path, fname);
+        AXIS2_FILE_SET_PATH(arch_file, env, path);
         buf = AXIS2_MALLOC((*env)->allocator, sizeof(struct stat));
         if(!buf)
         {

Modified: webservices/axis2/trunk/c/modules/util/file.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/file.c?rev=371864&r1=371863&r2=371864&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/file.c (original)
+++ webservices/axis2/trunk/c/modules/util/file.c Tue Jan 24 00:27:05 2006
@@ -21,6 +21,7 @@
 {
     axis2_file_t file;
     axis2_char_t *name;
+    axis2_char_t *path;
     AXIS2_TIME_T timestamp;
     
     
@@ -45,6 +46,15 @@
                     axis2_env_t **env);
 
 axis2_status_t AXIS2_CALL
+axis2_file_set_path(axis2_file_t *file,
+                        axis2_env_t **env,
+                        axis2_char_t *path);
+
+axis2_char_t *AXIS2_CALL
+axis2_file_get_path(axis2_file_t *file,
+                    axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
 axis2_file_set_timestamp(axis2_file_t *file,
                         axis2_env_t **env,
                         AXIS2_TIME_T timestamp);
@@ -75,6 +85,7 @@
         return NULL;
     }
     file_impl->name = NULL;
+    file_impl->path = NULL;
     file_impl->timestamp = 0;
     
     file_impl->file.ops = 
@@ -89,6 +100,8 @@
     file_impl->file.ops->free =  axis2_file_free;
     file_impl->file.ops->set_name = axis2_file_set_name;
     file_impl->file.ops->get_name = axis2_file_get_name;
+    file_impl->file.ops->set_path = axis2_file_set_path;
+    file_impl->file.ops->get_path = axis2_file_get_path;
     file_impl->file.ops->set_timestamp = axis2_file_set_timestamp;
     file_impl->file.ops->get_timestamp = axis2_file_get_timestamp;
     file_impl->file.ops->clone = axis2_file_clone;
@@ -112,6 +125,12 @@
         file_impl->name = NULL;
     }
     
+    if(file_impl->path)
+    {
+        AXIS2_FREE((*env)->allocator, file_impl->path);
+        file_impl->path = NULL;
+    }
+    
     if(file_impl)
     {
         AXIS2_FREE((*env)->allocator, file_impl);
@@ -149,22 +168,61 @@
                     axis2_env_t **env)
 {
     axis2_file_impl_t *file_impl = NULL;
-    axis2_char_t *name = NULL;
+    
     AXIS2_FUNC_PARAM_CHECK(file, env, NULL);
     file_impl = AXIS2_INTF_TO_IMPL(file);
     
     if(!file_impl->name)
     {
-        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_FILE_NAME_NOT_SET, AXIS2_FAILURE);   
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_FILE_NAME_NOT_SET, 
+            AXIS2_FAILURE);   
         return NULL;
     }
-    name = AXIS2_STRDUP(file_impl->name, env);
-    if(!name)
+    
+    return file_impl->name;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_file_set_path(axis2_file_t *file,
+                    axis2_env_t **env,
+                    axis2_char_t *path)
+{
+    axis2_file_impl_t *file_impl = NULL;
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, path, AXIS2_FAILURE);
+    file_impl = AXIS2_INTF_TO_IMPL(file);
+    
+    if(file_impl->path)
+    {
+        AXIS2_FREE((*env)->allocator, file_impl->path);
+        file_impl->path = NULL;
+    }
+    file_impl->path = AXIS2_STRDUP(path, env);
+    if(!file_impl->path)
     {
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}
+
+axis2_char_t *AXIS2_CALL
+axis2_file_get_path(axis2_file_t *file,
+                    axis2_env_t **env)
+{
+    axis2_file_impl_t *file_impl = NULL;
+    
+    AXIS2_FUNC_PARAM_CHECK(file, env, NULL);
+    file_impl = AXIS2_INTF_TO_IMPL(file);
+    
+    if(!file_impl->path)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_FILE_NAME_NOT_SET, 
+            AXIS2_FAILURE);   
         return NULL;
     }
-    return name;
+    
+    return file_impl->path;
 }
 
 axis2_status_t AXIS2_CALL
@@ -187,7 +245,7 @@
                     axis2_env_t **env)
 {
     axis2_file_impl_t *file_impl = NULL;
-    AXIS2_ENV_CHECK(env, NULL);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     file_impl = AXIS2_INTF_TO_IMPL(file);
     return file_impl->timestamp;
 }
@@ -205,6 +263,11 @@
     
     new_file = axis2_file_create(env);
     status = AXIS2_FILE_SET_NAME(new_file, env, file_impl->name);
+    if(AXIS2_SUCCESS != status)
+    {
+        return NULL;
+    }
+    status = AXIS2_FILE_SET_PATH(new_file, env, file_impl->path);
     if(AXIS2_SUCCESS != status)
     {
         return NULL;