axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r392182 - in /webservices/axis2/trunk/c: include/axis2_callback.h modules/core/clientapi/callback.c
Date Fri, 07 Apr 2006 04:41:44 GMT
Author: damitha
Date: Thu Apr  6 21:41:42 2006
New Revision: 392182

URL: http://svn.apache.org/viewcvs?rev=392182&view=rev
Log:
added methods to get/set data in callback, to set on_complete and on_error callback functions

Modified:
    webservices/axis2/trunk/c/include/axis2_callback.h
    webservices/axis2/trunk/c/modules/core/clientapi/callback.c

Modified: webservices/axis2/trunk/c/include/axis2_callback.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_callback.h?rev=392182&r1=392181&r2=392182&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_callback.h (original)
+++ webservices/axis2/trunk/c/include/axis2_callback.h Thu Apr  6 21:41:42 2006
@@ -41,6 +41,11 @@
 typedef struct axis2_callback_ops axis2_callback_ops_t;
 typedef struct axis2_callback axis2_callback_t; 
 
+typedef axis2_status_t(*on_complete_func_ptr)
+	(struct axis2_callback *, axis2_env_t **);
+
+typedef axis2_status_t(*on_error_func_ptr)(struct axis2_callback *,
+	axis2_env_t **, int);
     
 /** 
  * @brief Message Context ops struct
@@ -133,7 +138,21 @@
                axis2_env_t **env, 
                int error);
 	
-	
+	axis2_status_t (AXIS2_CALL *
+	set_data)(struct axis2_callback *callback,
+			void *data);
+
+	void * (AXIS2_CALL *
+	get_data)(struct axis2_callback *callback);
+
+	void (AXIS2_CALL *
+	set_on_complete)(struct axis2_callback *callback,
+		on_complete_func_ptr f);
+
+	void (AXIS2_CALL *
+	set_on_error)(struct axis2_callback *callback,
+		on_error_func_ptr f);
+
     axis2_status_t (AXIS2_CALL *
 	free)(struct axis2_callback *callback, 
           axis2_env_t **env);
@@ -181,7 +200,19 @@
 		
 #define AXIS2_CALLBACK_SET_ERROR(callback, env, error) \
 		((callback)->ops->set_error(callback, env, error))
-		
+
+#define AXIS2_CALLBACK_GET_DATA(callback) \
+		((callback)->ops->get_data(callback))
+
+#define AXIS2_CALLBACK_SET_DATA(callback, data) \
+		((callback)->ops->set_data(callback, data))
+
+#define AXIS2_CALLBACK_SET_ON_COMPLETE(callback, func) \
+		((callback)->ops->set_on_complete(callback, func))
+
+#define AXIS2_CALLBACK_SET_ON_ERROR(callback, func) \
+		((callback)->ops->set_on_error(callback, func))
+
 #define AXIS2_CALLBACK_FREE(callback, env) \
 		((callback)->ops->free (callback, env))
 

Modified: webservices/axis2/trunk/c/modules/core/clientapi/callback.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/clientapi/callback.c?rev=392182&r1=392181&r2=392182&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/callback.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/callback.c Thu Apr  6 21:41:42 2006
@@ -28,6 +28,8 @@
     axis2_soap_envelope_t *envelope;
     /** error code */
     int error;
+	/** to store callback specific data */
+	void *data;
 } axis2_callback_impl_t;
 
 /** Interface to implementation conversion macro */
@@ -82,7 +84,20 @@
 axis2_callback_free (struct axis2_callback *callback, 
                      axis2_env_t **env);
 
+void AXIS2_CALL
+axis2_callback_set_on_complete(struct axis2_callback *callback,
+								on_complete_func_ptr f);
+
+void  AXIS2_CALL
+axis2_callback_set_on_error(struct axis2_callback *callback,
+							on_error_func_ptr f);
+		
+axis2_status_t AXIS2_CALL
+axis2_callback_set_data(struct axis2_callback *callback,
+						void *data);
 
+void* AXIS2_CALL
+axis2_callback_get_data(struct axis2_callback *callback);
 
 axis2_callback_t* AXIS2_CALL 
 axis2_callback_create(axis2_env_t **env)
@@ -102,6 +117,7 @@
     callback_impl->complete = AXIS2_FALSE;
     callback_impl->envelope = NULL;
     callback_impl->error = AXIS2_ERROR_NONE;
+	callback_impl->data = NULL;
     
     /* initialize ops */    
     callback_impl->callback.ops  = 
@@ -143,7 +159,19 @@
         
     callback_impl->callback.ops->set_error = 
         axis2_callback_set_error;
-        
+
+	callback_impl->callback.ops->set_data =
+		axis2_callback_set_data;
+
+	callback_impl->callback.ops->get_data =
+		axis2_callback_get_data;
+
+	callback_impl->callback.ops->set_on_complete = 
+		axis2_callback_set_on_complete;
+
+	callback_impl->callback.ops->set_on_error =
+		axis2_callback_set_on_error;
+
     callback_impl->callback.ops->free = 
         axis2_callback_free;
 
@@ -243,6 +271,43 @@
     callback_impl = NULL;
     
     return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_callback_set_data(struct axis2_callback *callback,
+							void *data)
+{
+	axis2_callback_impl_t *callback_impl = NULL;
+	
+	callback_impl = AXIS2_INTF_TO_IMPL(callback);
+
+	callback_impl->data = (void*)data;
+
+	return AXIS2_SUCCESS;
+}
+
+void * AXIS2_CALL
+axis2_callback_get_data(struct axis2_callback *callback)
+{
+	axis2_callback_impl_t *callback_impl = NULL;
+
+	callback_impl = AXIS2_INTF_TO_IMPL(callback);
+
+	return callback_impl->data;
+}
+
+void AXIS2_CALL
+axis2_callback_set_on_complete(struct axis2_callback *callback,
+								on_complete_func_ptr func)
+{
+	callback->ops->on_complete = func;
+}
+
+void AXIS2_CALL
+axis2_callback_set_on_error(struct axis2_callback *callback,
+							on_error_func_ptr func)
+{
+	callback->ops->on_error = func;
 }
 
 axis2_status_t AXIS2_CALL 



Mime
View raw message