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/10/31 08:42:34 UTC

svn commit: r469398 - in /webservices/axis2/trunk/c: include/axis2_op.h include/axis2_op_client.h modules/core/clientapi/callback.c modules/core/clientapi/callback_recv.c modules/core/clientapi/op_client.c

Author: damitha
Date: Mon Oct 30 23:42:33 2006
New Revision: 469398

URL: http://svn.apache.org/viewvc?view=rev&rev=469398
Log:
Added get_callback function to op_client. Added thread locking mutext to callback_recv and callback.


Modified:
    webservices/axis2/trunk/c/include/axis2_op.h
    webservices/axis2/trunk/c/include/axis2_op_client.h
    webservices/axis2/trunk/c/modules/core/clientapi/callback.c
    webservices/axis2/trunk/c/modules/core/clientapi/callback_recv.c
    webservices/axis2/trunk/c/modules/core/clientapi/op_client.c

Modified: webservices/axis2/trunk/c/include/axis2_op.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_op.h?view=diff&rev=469398&r1=469397&r2=469398
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_op.h (original)
+++ webservices/axis2/trunk/c/include/axis2_op.h Mon Oct 30 23:42:33 2006
@@ -256,19 +256,6 @@
                     struct axis2_msg_recv *msg_recv);
 
         /**
-         * Gets message receiver. message receiver is responsible for invoking
-         * the business logic associated with the operation.
-         * @param op pointer to operation
-         * @param env pointer to environment struct
-         * @return pointer to message receiver, returns a reference, not a 
-         * cloned copy
-         */
-        struct axis2_msg_recv *(AXIS2_CALL *
-                get_msg_recv)(
-                    const axis2_op_t *op,
-                    const axis2_env_t *env);
-
-        /**
          * Gets style of operation. Style is that mentioned in WSDL, either 
          * RPC or document literal.
          * @param op pointer to operation
@@ -891,11 +878,6 @@
     @sa axis2_op_ops#set_msg_recv */
 #define AXIS2_OP_SET_MSG_RECV(op, env, msg_recv) \
         ((op)->ops->set_msg_recv (op, env, msg_recv))
-
-/** Gets message receiver.
-    @sa axis2_op_ops#get_msg_recv */
-#define AXIS2_OP_GET_MSG_RECV(op, env) \
-        ((op)->ops->get_msg_recv (op, env))
 
 /** Sets QName.
     @sa axis2_op_ops#set_qname */

Modified: webservices/axis2/trunk/c/include/axis2_op_client.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_op_client.h?view=diff&rev=469398&r1=469397&r2=469398
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_op_client.h (original)
+++ webservices/axis2/trunk/c/include/axis2_op_client.h Mon Oct 30 23:42:33 2006
@@ -152,6 +152,17 @@
                     axis2_op_client_t *op_client,
                     const axis2_env_t *env,
                     axis2_callback_t *callback);
+        /**
+         * Gets the callback. 
+         * @param op_client pointer to operation client struct
+         * @param env pointer to environment struct
+         * @return callback
+         */
+        axis2_callback_t *(AXIS2_CALL *
+                get_callback)(
+                    axis2_op_client_t *op_client,
+                    const axis2_env_t *env);
+
 
         /**
          * Execute the MEP. What this does depends on the specific operation client.
@@ -295,6 +306,12 @@
     @sa axis2_op_client_ops#set_callback*/
 #define AXIS2_OP_CLIENT_SET_CALLBACK(op_client, env, callback) \
       ((op_client)->ops->set_callback(op_client, env, callback))
+
+/** gets operation callback. 
+    @sa axis2_op_client_ops#get_callback*/
+#define AXIS2_OP_CLIENT_GET_CALLBACK(op_client, env) \
+      ((op_client)->ops->get_callback(op_client, env))
+
 
 /** Executes operation client. 
     @sa axis2_op_client_ops#execute*/

Modified: webservices/axis2/trunk/c/modules/core/clientapi/callback.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/clientapi/callback.c?view=diff&rev=469398&r1=469397&r2=469398
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/callback.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/callback.c Mon Oct 30 23:42:33 2006
@@ -30,6 +30,7 @@
     int error;
     /** to store callback specific data */
     void *data;
+    axis2_thread_mutex_t *mutex;
 }
 axis2_callback_impl_t;
 
@@ -137,6 +138,7 @@
     callback_impl->envelope = NULL;
     callback_impl->error = AXIS2_ERROR_NONE;
     callback_impl->data = NULL;
+    callback_impl->mutex = NULL;
 
     /* initialize ops */
     callback_impl->callback.ops =
@@ -148,7 +150,8 @@
         axis2_callback_free(&(callback_impl->callback), env);
         return NULL;
     }
-
+    callback_impl->mutex = axis2_thread_mutex_create(env->allocator,
+                                 AXIS2_THREAD_MUTEX_DEFAULT);
     callback_impl->callback.ops->invoke_on_complete =
         axis2_callback_invoke_on_complete;
     callback_impl->callback.ops->on_complete =
@@ -189,10 +192,16 @@
     const axis2_env_t *env,
     axis2_async_result_t *result)
 {
+    axis2_callback_impl_t *callback_impl = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    callback_impl = AXIS2_INTF_TO_IMPL(callback);
     axis2_callback_set_envelope(callback, env,
             AXIS2_ASYNC_RESULT_GET_ENVELOPE(result, env));
-    return AXIS2_CALLBACK_ON_COMPLETE(callback, env);
+    status = AXIS2_CALLBACK_ON_COMPLETE(callback, env);
+
+    return status;
 }
 
 axis2_status_t AXIS2_CALL
@@ -220,7 +229,9 @@
     const axis2_env_t *env,
     axis2_bool_t complete)
 {
+    axis2_callback_impl_t *callback_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    callback_impl = AXIS2_INTF_TO_IMPL(callback);
     AXIS2_INTF_TO_IMPL(callback)->complete = complete;
     return AXIS2_SUCCESS;
 }
@@ -275,6 +286,11 @@
 
     callback_impl = AXIS2_INTF_TO_IMPL(callback);
 
+    if(NULL != callback_impl->mutex)
+    {
+        axis2_thread_mutex_destroy(callback_impl->mutex);
+        callback_impl->mutex = NULL;
+    }
     if (callback_impl->callback.ops)
     {
         AXIS2_FREE(env->allocator, callback_impl->callback.ops);

Modified: webservices/axis2/trunk/c/modules/core/clientapi/callback_recv.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/clientapi/callback_recv.c?view=diff&rev=469398&r1=469397&r2=469398
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/callback_recv.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/callback_recv.c Mon Oct 30 23:42:33 2006
@@ -26,6 +26,7 @@
     axis2_msg_recv_t *base;
     /** callback map */
     axis2_hash_t *callback_map;
+    axis2_thread_mutex_t *mutex;
 }
 axis2_callback_recv_impl_t;
 
@@ -77,6 +78,7 @@
     callback_recv_impl->callback_recv.ops = NULL;
     callback_recv_impl->base = NULL;
     callback_recv_impl->callback_map = NULL;
+    callback_recv_impl->mutex = NULL;
 
     callback_recv_impl->base = axis2_msg_recv_create(env);
     if (!(callback_recv_impl->base))
@@ -94,6 +96,8 @@
         return NULL;
     }
 
+    callback_recv_impl->mutex = axis2_thread_mutex_create(env->allocator,
+                                 AXIS2_THREAD_MUTEX_DEFAULT);
     /* initialize ops */
     callback_recv_impl->callback_recv.ops  =
         AXIS2_MALLOC(env->allocator, sizeof(axis2_callback_recv_ops_t));
@@ -139,6 +143,11 @@
     {
         AXIS2_FREE(env->allocator, callback_recv_impl->callback_recv.ops);
         callback_recv_impl->callback_recv.ops = NULL;
+    }
+    if(NULL != callback_recv_impl->mutex)
+    {
+        axis2_thread_mutex_destroy(callback_recv_impl->mutex);
+        callback_recv_impl->mutex = NULL;
     }
 
     if (callback_recv_impl->callback_map)

Modified: webservices/axis2/trunk/c/modules/core/clientapi/op_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/clientapi/op_client.c?view=diff&rev=469398&r1=469397&r2=469398
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/op_client.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/op_client.c Mon Oct 30 23:42:33 2006
@@ -106,6 +106,11 @@
     const axis2_env_t *env,
     axis2_callback_t *callback);
 
+axis2_callback_t *AXIS2_CALL
+axis2_op_client_get_callback(
+    axis2_op_client_t *op_client,
+    const axis2_env_t *env);
+
 axis2_status_t AXIS2_CALL
 axis2_op_client_execute(
     axis2_op_client_t *op_client,
@@ -357,6 +362,20 @@
     return AXIS2_SUCCESS;
 }
 
+axis2_callback_t *AXIS2_CALL
+axis2_op_client_get_callback(
+    axis2_op_client_t *op_client,
+    const axis2_env_t *env)
+{
+    axis2_op_client_impl_t *op_client_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    op_client_impl = AXIS2_INTF_TO_IMPL(op_client);
+
+    return op_client_impl->callback;
+}
+
+
 axis2_status_t AXIS2_CALL
 axis2_op_client_execute(
     axis2_op_client_t *op_client,
@@ -687,6 +706,7 @@
     op_client->ops->add_out_msg_ctx = axis2_op_client_add_out_msg_ctx;
     op_client->ops->get_msg_ctx = axis2_op_client_get_msg_ctx;
     op_client->ops->set_callback = axis2_op_client_set_callback;
+    op_client->ops->get_callback = axis2_op_client_get_callback;
     op_client->ops->execute = axis2_op_client_execute;
     op_client->ops->reset = axis2_op_client_reset;
     op_client->ops->complete = axis2_op_client_complete;



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org