ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r391034 - in /webservices/axis2/trunk/c/modules: core/clientapi/call.c core/clientapi/listener_manager.c core/engine/conf.c util/network_handler.c
Date Mon, 03 Apr 2006 12:35:28 GMT
Author: samisa
Date: Mon Apr  3 05:35:27 2006
New Revision: 391034

URL: http://svn.apache.org/viewcvs?rev=391034&view=rev
Log:
Fixes to get seperate listner working with client

Modified:
    webservices/axis2/trunk/c/modules/core/clientapi/call.c
    webservices/axis2/trunk/c/modules/core/clientapi/listener_manager.c
    webservices/axis2/trunk/c/modules/core/engine/conf.c
    webservices/axis2/trunk/c/modules/util/network_handler.c

Modified: webservices/axis2/trunk/c/modules/core/clientapi/call.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/clientapi/call.c?rev=391034&r1=391033&r2=391034&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/call.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/call.c Mon Apr  3 05:35:27 2006
@@ -241,6 +241,13 @@
         return NULL;
     }
     
+    call_impl->listener_manager = axis2_listener_manager_create(env);
+    if (!(call_impl->listener_manager))
+    {
+        axis2_call_free(&(call_impl->call), env);
+        return NULL;
+    }
+    
     /* initialize ops */    
     call_impl->call.ops  = AXIS2_MALLOC( (*env)->allocator, sizeof(axis2_call_ops_t)
);
     if (!call_impl->call.ops)
@@ -589,7 +596,7 @@
         {
             axis2_char_t *svc_name = NULL, *temp = NULL;
             axis2_qname_t *svc_qname = AXIS2_SVC_GET_QNAME(svc, env);
-            axis2_qname_t *op_qname = AXIS2_OP_GET_QNAME(svc, env);
+            axis2_qname_t *op_qname = AXIS2_OP_GET_QNAME(op, env);
             axis2_qname_t *transport_qname = AXIS2_TRANSPORT_IN_DESC_GET_QNAME(call_impl->listener_transport,
env);
             axis2_endpoint_ref_t *epr = NULL;
             
@@ -598,12 +605,12 @@
             if (temp)
                 AXIS2_FREE((*env)->allocator, temp);
             
-            epr = AXIS2_LISTNER_MANAGER_REPLY_TO_EPR(call_impl->listener_manager, env,
svc_name,
+            /*epr = AXIS2_LISTNER_MANAGER_REPLY_TO_EPR(call_impl->listener_manager, env,
svc_name,
                         AXIS2_QNAME_GET_LOCALPART(transport_qname, env));
             if (epr)
             {
                 AXIS2_MSG_CTX_SET_REPLY_TO(msg_ctx, env, epr);
-            }
+            }*/
             
             if (svc_name)
                 AXIS2_FREE((*env)->allocator, svc_name);
@@ -611,7 +618,7 @@
             
         }
         
-        AXIS2_MSG_CTX_SET_TO(msg_ctx, env, call_impl->to);
+        /*AXIS2_MSG_CTX_SET_TO(msg_ctx, env, call_impl->to);*/
         /* create and set the Operation context */
         AXIS2_MSG_CTX_SET_OP_CTX(msg_ctx, env, AXIS2_OP_FIND_OP_CTX(op, env, msg_ctx, svc_ctx));
         AXIS2_MSG_CTX_SET_SVC_CTX(msg_ctx, env, svc_ctx);

Modified: webservices/axis2/trunk/c/modules/core/clientapi/listener_manager.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/clientapi/listener_manager.c?rev=391034&r1=391033&r2=391034&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/listener_manager.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/listener_manager.c Mon Apr  3 05:35:27
2006
@@ -40,6 +40,15 @@
     
 } axis2_transport_listener_state_t;
 
+typedef struct axis2_listener_manager_worker_func_args
+{
+    axis2_env_t **env;
+    axis2_listener_manager_impl_t *listner_manager;
+    axis2_transport_receiver_t *listener;
+} axis2_listener_manager_worker_func_args_t;
+
+void * AXIS2_THREAD_FUNC
+axis2_listener_manager_worker_func(axis2_thread_t *thd, void *data);
 
 /** Interface to implementation conversion macro */
 #define AXIS2_INTF_TO_IMPL(listener_manager) ((axis2_listener_manager_impl_t *)listener_manager)
@@ -180,7 +189,37 @@
                     listener = AXIS2_TRANSPORT_IN_DESC_GET_RECV(transport_in, env);
                     if (listener)
                     {
-                        AXIS2_TRANSPORT_RECEIVER_START(listener, env);
+                        axis2_thread_t *worker_thread = NULL;
+                        axis2_listener_manager_worker_func_args_t *arg_list = NULL;
+                        arg_list = AXIS2_MALLOC((*env)->allocator, 
+                                        sizeof(axis2_listener_manager_worker_func_args_t));
+                        if(NULL == arg_list)
+                        {
+                            return AXIS2_FAILURE;			
+                        }
+                        arg_list->env = env;
+                        arg_list->listner_manager = listener_manager_impl;
+                        arg_list->listener = listener;
+#ifdef AXIS2_SVR_MULTI_THREADED
+                        if ((*env)->thread_pool)
+                        {
+                            worker_thread = AXIS2_THREAD_POOL_GET_THREAD((*env)->thread_pool,
+                                                             axis2_listener_manager_worker_func,
(void*)arg_list);
+                            if(NULL == worker_thread)
+                            {
+                                AXIS2_LOG_ERROR((*env)->log, AXIS2_LOG_SI, "Thread creation
failed"
+                                                 "call invoke non blocking");
+                            }
+                            AXIS2_THREAD_POOL_THREAD_DETACH((*env)->thread_pool, worker_thread);
+                        }
+                        else
+                        {
+                            AXIS2_LOG_ERROR((*env)->log, AXIS2_LOG_SI, "Thread pool not
set in envioronment."
+                                                         " Cannot invoke call non blocking");
+                        }
+#else
+                        axis2_listener_manager_worker_func(NULL, (void*)arg_list);
+#endif
                         
                         tl_state  = AXIS2_MALLOC( (*env)->allocator, 
                                         sizeof(axis2_transport_listener_state_t) );
@@ -300,4 +339,21 @@
 {
     AXIS2_ENV_CHECK(env, NULL);
     return AXIS2_INTF_TO_IMPL(listener_manager)->conf_ctx;
+}
+
+void * AXIS2_THREAD_FUNC
+axis2_listener_manager_worker_func(axis2_thread_t *thd, void *data)
+{
+    axis2_listener_manager_worker_func_args_t *args_list = NULL;
+    
+    args_list = (axis2_listener_manager_worker_func_args_t *) data;
+    if (!args_list)
+       return NULL;    
+
+    AXIS2_ENV_CHECK(args_list->env, AXIS2_FAILURE);
+    if (args_list->listener)
+    {
+        AXIS2_TRANSPORT_RECEIVER_START(args_list->listener, args_list->env);
+    }
+    return NULL;
 }

Modified: webservices/axis2/trunk/c/modules/core/engine/conf.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/engine/conf.c?rev=391034&r1=391033&r2=391034&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/conf.c (original)
+++ webservices/axis2/trunk/c/modules/core/engine/conf.c Mon Apr  3 05:35:27 2006
@@ -1429,11 +1429,27 @@
                                 axis2_env_t **env,
                                 axis2_qname_t *module_name) 
 {
+    axis2_conf_impl_t *config_impl = NULL;
+    int i = 0;
+    int size = 0;
     AXIS2_ENV_CHECK(env, AXIS2_FALSE);
     AXIS2_PARAM_CHECK((*env)->error, module_name, AXIS2_FALSE);
-    
-    return AXIS2_ARRAY_LIST_CONTAINS(AXIS2_INTF_TO_IMPL(conf)->
-        engaged_modules, env, module_name);
+    config_impl = AXIS2_INTF_TO_IMPL(conf);
+   
+   
+    size = AXIS2_ARRAY_LIST_SIZE(config_impl->engaged_modules, env);
+    for(i = 0; i < size; i++)
+    {
+        axis2_qname_t *qname = NULL;
+        
+        qname = (axis2_qname_t *) AXIS2_ARRAY_LIST_GET(config_impl->
+            engaged_modules, env, i);
+        if(AXIS2_TRUE == AXIS2_QNAME_EQUALS(module_name, env, qname))
+        {
+            return AXIS2_TRUE;
+        }
+    }
+    return AXIS2_FALSE;
 }
 
 axis2_phases_info_t *AXIS2_CALL

Modified: webservices/axis2/trunk/c/modules/util/network_handler.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/network_handler.c?rev=391034&r1=391033&r2=391034&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/network_handler.c (original)
+++ webservices/axis2/trunk/c/modules/util/network_handler.c Mon Apr  3 05:35:27 2006
@@ -191,8 +191,8 @@
 	cli_len = sizeof(cli_addr);
 	cli_socket = accept(svr_socket, (struct sockaddr *)&cli_addr, &cli_len);
     if (cli_socket < 0)
-    	AXIS2_LOG_WRITE((*env)->log, "[Axis2][network_handler] Socket accept \
-						failed", AXIS2_LOG_LEVEL_ERROR);
+    	AXIS2_LOG_ERROR((*env)->log, AXIS2_LOG_SI, "[Axis2][network_handler] Socket accept
\
+						failed");
 	
 	setsockopt(cli_socket, IPPROTO_TCP, TCP_NODELAY, &nodelay, 
 						sizeof(nodelay));



Mime
View raw message