[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wsf-c-commits
Subject:    [Wsf-commits] svn commit r53651 -
From:       damitha () wso2 ! com
Date:       2010-01-25 18:43:16
Message-ID: E1NZTu8-00045t-2n () wso2 ! org
[Download RAW message or body]

Author: damitha
Date: Mon Jan 25 10:43:15 2010
New Revision: 53651
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=53651

Log:


Added:
   trunk/wsf/c/adminservices/statistics_admin/module/mod_statistics_admin.c
   trunk/wsf/c/adminservices/statistics_admin/module/mod_statistics_admin.h
Modified:
   trunk/wsf/c/adminservices/statistics_admin/module/Makefile.am

Modified: trunk/wsf/c/adminservices/statistics_admin/module/Makefile.am
URL: http://wso2.org/svn/browse/wso2/trunk/wsf/c/adminservices/statistics_admin/module/Makefile.am?rev=53651&r1=53650&r2=53651&view=diff
 ==============================================================================
--- trunk/wsf/c/adminservices/statistics_admin/module/Makefile.am	(original)
+++ trunk/wsf/c/adminservices/statistics_admin/module/Makefile.am	Mon Jan 25 10:43:15 \
2010 @@ -4,7 +4,8 @@
 								 fault_count_handler.c \
 								 in_op_count_handler.c \
 								 out_op_count_handler.c \
-								 svc_request_count_handler.c
+								 svc_request_count_handler.c \
+								 mod_statistics_admin.c
 libstatistics_admin_la_LIBADD = 
 
 INCLUDES = -I$(top_builddir)/include \

Added: trunk/wsf/c/adminservices/statistics_admin/module/mod_statistics_admin.c
URL: http://wso2.org/svn/browse/wso2/trunk/wsf/c/adminservices/statistics_admin/module/mod_statistics_admin.c?pathrev=53651
 ==============================================================================
--- (empty file)
+++ trunk/wsf/c/adminservices/statistics_admin/module/mod_statistics_admin.c	Mon Jan \
25 10:43:15 2010 @@ -0,0 +1,152 @@
+/*
+ * 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.
+ */
+#include <axis2_module.h>
+#include <axis2_conf_ctx.h>
+#include <mod_statistics_admin.h>
+#include "../axis2_statistics_admin_constants.h"
+
+/*#include <sqlite3.h>*/
+
+axis2_status_t AXIS2_CALL
+mod_statistics_admin_shutdown(axis2_module_t *module,
+                        const axutil_env_t *env);
+
+axis2_status_t AXIS2_CALL
+mod_statistics_admin_init(axis2_module_t *module,
+        const axutil_env_t *env,
+        axis2_conf_ctx_t *conf_ctx,
+        axis2_module_desc_t *module_desc);
+
+axis2_status_t AXIS2_CALL
+mod_statistics_admin_fill_handler_create_func_map(
+		axis2_module_t *module,
+        const axutil_env_t *env);
+
+static const axis2_module_ops_t statistics_admin_module_ops_var = {
+	mod_statistics_admin_init,
+	mod_statistics_admin_shutdown,
+	mod_statistics_admin_fill_handler_create_func_map
+};
+
+axis2_module_t *
+mod_statistics_admin_create(const axutil_env_t *env)
+{
+    axis2_module_t *module = NULL;
+    module = AXIS2_MALLOC(env->allocator, sizeof(axis2_module_t));
+    if(!module)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+           "[adminservices] Memory allocation failed for Statistics Admin Module");
+        return NULL;
+    }
+    /* Do the memset*/
+    
+    module->ops = &statistics_admin_module_ops_var;
+    return module;
+}
+
+axis2_status_t AXIS2_CALL
+mod_statistics_admin_init(
+        axis2_module_t *module,
+        const axutil_env_t *env,
+        axis2_conf_ctx_t *conf_ctx,
+        axis2_module_desc_t *module_desc)
+{
+    /* Any initialization stuff of mod_statistics_admin goes here */
+    axis2_status_t status = AXIS2_SUCCESS;
+
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[adminservices] \
Entry:mod_statistics_admin_init"); +    /* Add initialization code here */
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[adminservices] \
Exit:mod_statistics_admin_init"); +
+    return status;
+}
+
+axis2_status_t AXIS2_CALL
+mod_statistics_admin_shutdown(axis2_module_t *module,
+                        const axutil_env_t *env)
+{
+    if(module->handler_create_func_map)
+    {
+        /* TODO
+         *  do the neccessary clean in hash map
+         */
+        axutil_hash_free(module->handler_create_func_map, env);
+    }
+    if(module)
+    {
+        AXIS2_FREE(env->allocator, module);
+    }
+    return AXIS2_SUCCESS; 
+}
+
+axis2_status_t AXIS2_CALL
+mod_statistics_admin_fill_handler_create_func_map(axis2_module_t *module,
+                                            const axutil_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    module->handler_create_func_map = axutil_hash_make(env);
+    if(!module->handler_create_func_map)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+           "[adminservices] Memory allocation failed for Statistics Admin Module");
+        return AXIS2_FAILURE;
+    }
+    /* Remove the hard coded strings. Instead use macros */
+    axutil_hash_set(module->handler_create_func_map, \
AXIS2_MOD_STATISTICS_ADMIN_IN_OP_COUNT_HANDLER,  +        AXIS2_HASH_KEY_STRING, \
axis2_statistics_admin_in_op_count_handler_create); +
+    axutil_hash_set(module->handler_create_func_map, \
AXIS2_MOD_STATISTICS_ADMIN_OUT_OP_COUNT_HANDLER,  +        AXIS2_HASH_KEY_STRING, \
axis2_statistics_admin_out_op_count_handler_create); +    
+    axutil_hash_set(module->handler_create_func_map, \
AXIS2_MOD_STATISTICS_ADMIN_FAULT_COUNT_HANDLER,  +        AXIS2_HASH_KEY_STRING, \
axis2_statistics_admin_fault_count_handler_create); +    
+    return AXIS2_SUCCESS;
+}
+
+/**
+ * Following block distinguish the exposed part of the dll.
+ */
+
+AXIS2_EXPORT int 
+axis2_get_instance(axis2_module_t **inst,
+                   const axutil_env_t *env)
+{
+   *inst = mod_statistics_admin_create(env);
+    if(!(*inst))
+    {
+        return AXIS2_FAILURE;
+    }
+
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXPORT int 
+axis2_remove_instance(axis2_module_t *inst,
+                      const axutil_env_t *env)
+{
+    axis2_status_t status = AXIS2_FAILURE;
+   if (inst)
+   {
+        status = mod_statistics_admin_shutdown(inst, env);
+    }
+    return status;
+}
+

Added: trunk/wsf/c/adminservices/statistics_admin/module/mod_statistics_admin.h
URL: http://wso2.org/svn/browse/wso2/trunk/wsf/c/adminservices/statistics_admin/module/mod_statistics_admin.h?pathrev=53651
 ==============================================================================
--- (empty file)
+++ trunk/wsf/c/adminservices/statistics_admin/module/mod_statistics_admin.h	Mon Jan \
25 10:43:15 2010 @@ -0,0 +1,53 @@
+/*
+ * 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_MOD_STATISTICS_ADMIN_H
+#define AXIS2_MOD_STATISTICS_ADMIN_H
+
+/**
+ * @file mod_statistics_admin.h
+ * @brief Axis2 Statistics Admin module interface
+ */
+
+#include <axis2_handler.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+AXIS2_EXTERN axis2_handler_t* AXIS2_CALL
+axis2_statistics_admin_in_op_count_handler_create(
+        const axutil_env_t *env, 
+        axutil_qname_t *qname);
+
+AXIS2_EXTERN axis2_handler_t* AXIS2_CALL
+axis2_statistics_admin_out_op_count_handler_create(
+        const axutil_env_t *env, 
+        axutil_qname_t *qname);
+
+AXIS2_EXTERN axis2_handler_t* AXIS2_CALL
+axis2_statistics_admin_fault_count_handler_create(
+        const axutil_env_t *env, 
+        axutil_qname_t *qname);
+    
+/** @} */
+    
+#ifdef __cplusplus
+}
+#endif
+
+#endif    /* AXIS2_MOD_STATISTICS_ADMIN_H */

_______________________________________________
Wsf-commits mailing list
Wsf-commits@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/wsf-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic