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 2005/12/23 07:01:18 UTC

svn commit: r358727 - in /webservices/axis2/trunk/c: include/axis2_dll_desc.h include/axis2_svc_skeleton.h modules/core/deployment/src/ws_info.c

Author: damitha
Date: Thu Dec 22 22:01:09 2005
New Revision: 358727

URL: http://svn.apache.org/viewcvs?rev=358727&view=rev
Log:
Added new files

Added:
    webservices/axis2/trunk/c/include/axis2_dll_desc.h
    webservices/axis2/trunk/c/include/axis2_svc_skeleton.h
Modified:
    webservices/axis2/trunk/c/modules/core/deployment/src/ws_info.c

Added: 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=358727&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_dll_desc.h (added)
+++ webservices/axis2/trunk/c/include/axis2_dll_desc.h Thu Dec 22 22:01:09 2005
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_DLL_DESC_H
+#define AXIS2_DLL_DESC_H
+
+/**
+ * @file axis2_dll_desc.h
+ * @brief Axis2 dll_desc interface
+ */
+
+#include <axis2_defines.h>
+#include <axis2_qname.h>
+#include <axis2_error.h>
+#include <axis2.h>
+#include <axis2_svc_skeleton.h>
+#include <axis2_platform_auto_sense.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+    
+/**
+ * @defgroup axis2_dll_desc DLL Description
+ * @ingroup axis2_description
+ * @{
+ */
+
+    
+typedef struct axis2_dll_desc axis2_dll_desc_t;
+typedef struct axis2_dll_desc_ops axis2_dll_desc_ops_t;
+     
+    
+typedef int (*CREATE_FUNCT) (void **inst);
+
+typedef int (*DELETE_FUNCT) (void *inst);
+
+typedef enum axis2_dll_type
+{
+    /** service dll */
+    AXIS2_SVC_DLL = 0,
+    /** handler dll */
+    AXIS2_HANDLER_DLL,
+    /** message receiver dll */
+    AXIS2_MSG_RECV_DLL
+       
+}axis2_dll_type_t;
+
+/**
+ *   \brief DLL Description ops struct
+ */
+AXIS2_DECLARE_DATA struct axis2_dll_desc_ops
+{ 
+    axis2_status_t (AXIS2_CALL *
+    free) (struct axis2_dll_desc *dll_desc, 
+            axis2_env_t **env);
+        
+    axis2_status_t (AXIS2_CALL *
+    set_name) (axis2_dll_desc_t *dll_desc,
+                            axis2_env_t **env,
+                            axis2_char_t *name);
+    
+    axis2_char_t *(AXIS2_CALL *
+    get_name) (axis2_dll_desc_t *dll_desc,
+                            axis2_env_t **env);
+    
+    axis2_status_t (AXIS2_CALL *
+    set_type) (axis2_dll_desc_t *dll_desc,
+                            axis2_env_t **env,
+                            axis2_dll_type_t type);
+    
+    axis2_dll_type_t (AXIS2_CALL *
+    get_type) (axis2_dll_desc_t *dll_desc,
+                            axis2_env_t **env);
+    
+    axis2_status_t (AXIS2_CALL *
+    set_load_options) (axis2_dll_desc_t *dll_desc,
+                            axis2_env_t **env,
+                            int options);
+    
+    int (AXIS2_CALL *
+    get_load_options) (axis2_dll_desc_t *dll_desc,
+                            axis2_env_t **env);
+    
+    axis2_status_t (AXIS2_CALL *
+    set_dl_handler) (axis2_dll_desc_t *dll_desc,
+                            axis2_env_t **env,
+                            AXIS2_DLHANDLER dl_handler);
+    
+    AXIS2_DLHANDLER (AXIS2_CALL *
+    get_dl_handler) (axis2_dll_desc_t *dll_desc,
+                            axis2_env_t **env);
+    
+    axis2_status_t (AXIS2_CALL *
+    set_create_funct) (axis2_dll_desc_t *dll_desc,
+                            axis2_env_t **env,
+                            CREATE_FUNCT funct);
+    
+    CREATE_FUNCT (AXIS2_CALL *
+    get_create_funct) (axis2_dll_desc_t *dll_desc,
+                            axis2_env_t **env);
+    
+    axis2_status_t (AXIS2_CALL *
+    set_delete_funct) (axis2_dll_desc_t *dll_desc,
+                            axis2_env_t **env,
+                            DELETE_FUNCT funct);
+    
+    DELETE_FUNCT (AXIS2_CALL *
+    get_delete_funct) (axis2_dll_desc_t *dll_desc,
+                            axis2_env_t **env);
+
+        
+};
+	
+/** 
+* \brief DLL Description struct
+*/
+AXIS2_DECLARE_DATA struct axis2_dll_desc
+{
+    /** DLL Description related ops */
+    axis2_dll_desc_ops_t *ops;
+    
+};
+
+
+/**
+ * creates dll_desc struct
+ * @param qname qname, can be NULL
+ */
+AXIS2_DECLARE(axis2_dll_desc_t*) 
+axis2_dll_desc_create(axis2_env_t **env);
+
+#define AXIS2_DLL_DESC_GET_NAME(dll_desc, env) \
+    ((dll_desc)->ops->get_name(dll_desc, env))
+    
+#define AXIS2_DLL_DESC_SET_NAME(dll_desc, env, name) \
+    ((dll_desc)->ops->set_name(dll_desc, env, name))
+
+#define AXIS2_DLL_DESC_GET_TYPE(dll_desc, env) \
+    ((dll_desc)->ops->get_type(dll_desc, env))
+    
+#define AXIS2_DLL_DESC_SET_TYPE(dll_desc, env, type) \
+    ((dll_desc)->ops->set_type(dll_desc, env, type))
+
+#define AXIS2_DLL_DESC_GET_LOAD_OPTIONS(dll_desc, env) \
+    ((dll_desc)->ops->get_load_options(dll_desc, env))
+    
+#define AXIS2_DLL_DESC_SET_LOAD_OPTIONS(dll_desc, env, load_options) \
+    ((dll_desc)->ops->set_load_options(dll_desc, env, load_options))
+    
+#define AXIS2_DLL_DESC_GET_DL_HANDLER(dll_desc, env) \
+    ((dll_desc)->ops->get_dl_handler(dll_desc, env))
+    
+#define AXIS2_DLL_DESC_SET_DL_HANDLER(dll_desc, env, dl_handler) \
+    ((dll_desc)->ops->set_dl_handler(dll_desc, env, dl_handler))
+    
+#define AXIS2_DLL_DESC_GET_CREATE_FUNCT(dll_desc, env) \
+    ((dll_desc)->ops->get_create_funct(dll_desc, env))
+    
+#define AXIS2_DLL_DESC_SET_CREATE_FUNCT(dll_desc, env, funct) \
+    ((dll_desc)->ops->set_create_funct(dll_desc, env, funct))
+    
+#define AXIS2_DLL_DESC_GET_DELETE_FUNCT(dll_desc, env) \
+    ((dll_desc)->ops->get_delete_funct((dll_desc, env))
+    
+#define AXIS2_DLL_DESC_SET_DELETE_FUNCT(dll_desc, env, funct) \
+    ((dll_desc)->ops->set_delete_funct(dll_desc, env, funct))
+    
+/** @} */
+    
+#ifdef __cplusplus
+}
+#endif
+
+#endif    /* AXIS2_DLL_DESC_H */

Added: webservices/axis2/trunk/c/include/axis2_svc_skeleton.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_svc_skeleton.h?rev=358727&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_svc_skeleton.h (added)
+++ webservices/axis2/trunk/c/include/axis2_svc_skeleton.h Thu Dec 22 22:01:09 2005
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+  
+#ifndef AXIS2_SVC_SKELETON_H
+#define AXIS2_SVC_SKELETON_H
+
+#include <axis2_om_node.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+    
+/**
+ * @file axis2_svc_skeleton.h
+ * @brief Axis2c service skeleton that should be implemented by actual service
+ * wrappers
+ */
+
+/** @defgroup axis2_svc_skeleton Axis2 Service Skeleton
+ * @ingroup axis2_deployment
+ * @{
+ */    
+
+typedef struct axis2_svc_skeleton_ops axis2_svc_skeleton_ops_t;   
+typedef struct axis2_svc_skeleton axis2_svc_skeleton_t;
+    
+AXIS2_DECLARE_DATA struct axis2_svc_skeleton_ops
+{
+    int (AXIS2_CALL *
+    init) (axis2_svc_skeleton_t *svc_skeleton,
+            axis2_env_t **env);
+
+    int (AXIS2_CALL * 
+    free)(axis2_svc_skeleton_t *svc_skeli,
+            axis2_env_t **env);
+    
+    axis2_om_node_t *(AXIS2_CALL* 
+    invoke)(axis2_svc_skeleton_t *svc_skeli, 
+            axis2_env_t **env,
+            axis2_om_node_t *node);
+    
+    axis2_om_node_t *(AXIS2_CALL* 
+    on_fault)(axis2_svc_skeleton_t *svc_skeli, 
+                axis2_env_t **env,
+                axis2_om_node_t *node);
+    
+    struct axis2_array_list *(AXIS2_CALL* 
+    get_function_list)(axis2_svc_skeleton_t *svc_skeli,
+                        axis2_env_t **env);
+
+} ;
+
+AXIS2_DECLARE_DATA struct axis2_svc_skeleton 
+{
+    axis2_svc_skeleton_ops_t *ops; 
+};
+
+/**
+ * Creates axis2_svc_skeleton struct
+ * @return pointer to newly created axis2_svc_struct
+ */
+AXIS2_DECLARE(axis2_svc_skeleton_t *) 
+axis2_svc_skeleton_create (axis2_env_t **env);
+
+/*************************** Function macros **********************************/
+
+#define AXIS2_SVC_SKELETON_INIT(svc_skeleton, env) \
+		((svc_skeleton->ops)->init (svc_skeleton, env))
+
+#define AXIS2_SVC_SKELETON_FREE(svc_skeleton, env) \
+		((svc_skeleton->ops)->free (svc_skeleton, env))
+
+#define AXIS2_SVC_SKELETON_INVOKE(svc_skeleton, env, node) \
+		((svc_skeleton->ops)->invoke (svc_skeleton, env, node))
+
+#define AXIS2_SVC_SKELETON_ON_FAULT(svc_skeleton, env, node) \
+		((svc_skeleton->ops)->on_fault (svc_skeleton, env, node))
+
+#define AXIS2_SVC_SKELETON_GET_FUNCTION_LIST(svc_skeleton, env) \
+		((svc_skeleton->ops)->get_function_list (svc_skeleton, env))     
+
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* AXIS2_SVC_SKELETON_H */

Modified: webservices/axis2/trunk/c/modules/core/deployment/src/ws_info.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/src/ws_info.c?rev=358727&r1=358726&r2=358727&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/src/ws_info.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/src/ws_info.c Thu Dec 22 22:01:09 2005
@@ -24,6 +24,13 @@
 {
 	axis2_ws_info_t ws_info;
     
+    axis2_char_t *file_name;
+    long last_modified_date;
+    /**
+     * To check whether the file is a module or a servise
+     */
+    int type;
+    
     	
 } axis2_ws_info_impl_t;
 
@@ -42,11 +49,14 @@
 /************************** End of function prototypes ************************/
 
 axis2_ws_info_t * AXIS2_CALL 
-axis2_ws_info_create (axis2_env_t **env)
+axis2_ws_info_create_with_file_name_and_last_modified_date (axis2_env_t **env,
+                                        axis2_char_t *file_name,
+                                        long last_modified_date)
 {
     axis2_ws_info_impl_t *ws_info_impl = NULL;
     
 	AXIS2_ENV_CHECK(env, NULL);
+    AXIS2_FUNC_PARAM_CHECK((*env)->error, file_name, NULL);
 	
 	ws_info_impl = (axis2_ws_info_impl_t *) AXIS2_MALLOC((*env)->
         allocator, sizeof(axis2_ws_info_impl_t));
@@ -58,8 +68,21 @@
         return NULL;
     }
     
+    ws_info_impl->file_name = NULL;
+    ws_info_impl->last_modified_date = 0;
+    ws_info_impl->type = 0;
     ws_info_impl->ws_info.ops = NULL;
     
+    ws_info_impl->file_name = AXIS2_STRDUP((*env)->allocator, file_name);
+    if(!ws_info_impl->file_name)
+    {
+        axis2_ws_info_free(&(ws_info_impl->ws_info), env);
+		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;   
+    }
+    
+    ws_info_impl->last_modified_date = last_modified_date;
+    
 	ws_info_impl->ws_info.ops = 
 		AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_ws_info_ops_t));
 	if(NULL == ws_info_impl->ws_info.ops)
@@ -74,23 +97,99 @@
 	return &(ws_info_impl->ws_info);
 }
 
+axis2_ws_info_t * AXIS2_CALL 
+axis2_ws_info_create_with_file_name_and_last_modified_date_and_type (
+                                        axis2_env_t **env,
+                                        axis2_char_t *file_name,
+                                        long last_modified_date,
+                                        int type)
+{
+    axis2_ws_info_impl_t *ws_info_impl = NULL;
+   
+	AXIS2_ENV_CHECK(env, NULL);
+    AXIS2_FUNC_PARAM_CHECK((*env)->error, file_name, NULL);
+    
+    ws_info_impl = (axis2_ws_info_impl_t *)
+        axis2_ws_info_create_with_file_name_and_last_modified_date(env,
+            file_name, last_modified_date);
+    if(!ws_info_impl)
+    {
+        axis2_ws_info_free(&(ws_info_impl->ws_info), env);
+		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;  
+    }
+    ws_info_impl->type = type;
+    return &(ws_info_impl->ws_info);
+}
+
 /***************************Function implementation****************************/
 
 axis2_status_t AXIS2_CALL 
 axis2_ws_info_free (axis2_ws_info_t *ws_info, 
                             axis2_env_t **env)
 {
-    axis2_ws_info_impl_t *feature_impl = NULL;
+    axis2_ws_info_impl_t *ws_info_impl = NULL;
     
     AXIS2_FUNC_PARAM_CHECK(ws_info, env, AXIS2_FAILURE);
     
-    feature_impl = AXIS2_INTF_TO_IMPL(ws_info);
+    ws_info_impl = AXIS2_INTF_TO_IMPL(ws_info);
     
 	if(NULL != ws_info->ops)
+    {
         AXIS2_FREE((*env)->allocator, ws_info->ops);
+        ws_info->ops = NULL;
+    }
     
-    AXIS2_FREE((*env)->allocator, feature_impl);
-    feature_impl = NULL;
+    if(NULL != ws_info_impl->file_name)
+    {
+        AXIS2_FREE((*env)->allocator, ws_info_impl->file_name);
+        ws_info_impl->file_name = NULL;
+    }
+    
+    if(ws_info_impl)
+    {
+        AXIS2_FREE((*env)->allocator, ws_info_impl);
+        ws_info_impl = NULL;
+    }
     
 	return AXIS2_SUCCESS;
+}
+
+axis2_char_t *AXIS2_CALL
+axis2_ws_info_get_file_name(axis2_ws_info_t *ws_info,
+                                axis2_env_t **env) 
+{
+    AXIS2_FUNC_PARAM_CHECK(ws_info, env, NULL);
+    return AXIS2_INTF_TO_IMPL(ws_info)->filename;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_ws_info_set_file_name(axis2_ws_info_t *ws_info,
+                                axis2_env_t **env,
+                                axis2_char_t *file_name) 
+{
+    
+    this.filename = filename;
+}
+
+long AXIS2_CALL
+axis2_ws_info_get_last_modified_date(axis2_ws_info_t *ws_info,
+                                        axis2_env_t **env) 
+{
+    return lastmodifieddate;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_ws_info_set_last_modified_date(axis2_ws_info_t *ws_info,
+                                        axis2_env_t **env,
+                                        long last_modified_date) 
+{
+    this.lastmodifieddate = lastmodifieddate;
+}
+
+int AXIS2_CALL
+axis2_ws_info_get_type(axis2_ws_info_t *ws_info,
+                        axis2_env_t **env) 
+{
+    return type;
 }