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

List:       wsf-c-commits
Subject:    [Wsf-commits] svn commit r53672 -
From:       damitha () wso2 ! com
Date:       2010-01-26 20:55:04
Message-ID: E1NZsRE-0006ug-2F () wso2 ! org
[Download RAW message or body]

Author: damitha
Date: Tue Jan 26 12:55:03 2010
New Revision: 53672
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=53672

Log:


Added:
   trunk/wsf/c/adminservices/statistics_admin/module/global_request_count_handler.c
Modified:
   trunk/wsf/c/adminservices/statistics_admin/module/module.xml
   trunk/wsf/c/adminservices/statistics_admin/module/response_time_handler.c

Added: trunk/wsf/c/adminservices/statistics_admin/module/global_request_count_handler.c
                
URL: http://wso2.org/svn/browse/wso2/trunk/wsf/c/adminservices/statistics_admin/module/global_request_count_handler.c?pathrev=53672
 ==============================================================================
--- (empty file)
+++ trunk/wsf/c/adminservices/statistics_admin/module/global_request_count_handler.c	Tue \
Jan 26 12:55:03 2010 @@ -0,0 +1,79 @@
+/*
+ * 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_handler_desc.h>
+#include <axis2_op.h>
+#include <axis2_msg_ctx.h>
+#include <axutil_property.h>
+#include <axis2_op.h>
+#include "../axis2_counter.h"
+#include "../axis2_statistics_admin_constants.h"
+
+axis2_status_t AXIS2_CALL
+axis2_statistics_admin_global_request_count_handler_invoke(
+        struct axis2_handler *handler, 
+        const axutil_env_t *env,
+        struct axis2_msg_ctx *msg_ctx);
+
+
+AXIS2_EXTERN axis2_handler_t* AXIS2_CALL
+axis2_statistics_admin_global_request_count_handler_create(
+        const axutil_env_t *env, 
+        axutil_qname_t *qname) 
+{
+    axis2_handler_t *handler = NULL;
+    
+    handler = axis2_handler_create(env);
+    if (!handler)
+    {
+        return NULL;
+    }
+   
+    /* Handler init is handled by conf loading, so no need to do it here */
+    
+    /* Set the base struct's invoke op */
+	axis2_handler_set_invoke(handler, env, \
axis2_statistics_admin_global_request_count_handler_invoke); +
+    return handler;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_statistics_admin_global_request_count_handler_invoke(struct axis2_handler \
*handler,  +                        const axutil_env_t *env,
+                        struct axis2_msg_ctx *msg_ctx)
+{
+    axis2_status_t status = AXIS2_SUCCESS;
+    axis2_svc_t *svc = NULL;
+    
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[adminservices] \
Start:axis2_statistics_admin_global_request_count_handler_invoke"); +    \
AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE); +
+    svc = axis2_msg_ctx_get_svc(msg_ctx, env);
+    if(svc)
+    {
+        long *time_now = NULL;
+        axutil_property_t *property = NULL;
+        
+        *time_now = sandesha2_utils_get_current_time_in_millis(env);
+        property = axutil_property_create_with_args(env, 0, 0, 0, time_now);
+        axis2_msg_ctx_set_property(msg_ctx, env, AXIS2_REQUEST_RECEIVED_TIME, \
property); +    }
+    
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[adminservices] \
End:axis2_statistics_admin_global_request_count_handler_invoke"); +    
+    return status;
+}
+

Modified: trunk/wsf/c/adminservices/statistics_admin/module/module.xml
URL: http://wso2.org/svn/browse/wso2/trunk/wsf/c/adminservices/statistics_admin/module/module.xml?rev=53672&r1=53671&r2=53672&view=diff
 ==============================================================================
--- trunk/wsf/c/adminservices/statistics_admin/module/module.xml	(original)
+++ trunk/wsf/c/adminservices/statistics_admin/module/module.xml	Tue Jan 26 12:55:03 \
2010 @@ -3,6 +3,9 @@
         This module handles server statistics
     </Description>
     <inflow>
+        <handler name="global_request_count_handler" class="statistics">
+            <order phase="Transport"/>
+        </handler>
         <handler name="svc_request_count_handler" class="statistics">
             <order phase="Dispatch"/>
         </handler>

Modified: trunk/wsf/c/adminservices/statistics_admin/module/response_time_handler.c
URL: http://wso2.org/svn/browse/wso2/trunk/wsf/c/adminservices/statistics_admin/module/response_time_handler.c?rev=53672&r1=53671&r2=53672&view=diff
 ==============================================================================
--- trunk/wsf/c/adminservices/statistics_admin/module/response_time_handler.c	(original)
                
+++ trunk/wsf/c/adminservices/statistics_admin/module/response_time_handler.c	Tue Jan \
26 12:55:03 2010 @@ -86,6 +86,21 @@
     axis2_status_t status = AXIS2_SUCCESS;
     axis2_counter_t *counter = NULL;
     axutil_param_t *param = NULL;
+    axis2_op_ctx_t *op_ctx = NULL;
 
+    op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
+    if(op_ctx)
+    {
+        axis2_msg_ctx_t *in_msg_ctx = NULL;
+        in_msg_ctx =  axis2_op_ctx_get_msg_ctx(op_ctx, env, \
AXIS2_WSDL_MESSAGE_LABEL_IN); +        if(in_msg_ctx)
+        {
+            axutil_property_t *property = NULL;
+            long *received_time = NULL;
+
+            property = axis2_msg_ctx_get_property(msg_ctx, env, \
AXIS2_REQUEST_RECEIVED_TIME); +            received_time = \
axutil_property_get_value(property, env); +        }
+    }
 }
 

_______________________________________________
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