axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r518623 [6/17] - in /webservices/axis2/trunk/c: build/win32/ include/ modules/core/clientapi/ modules/core/deployment/ modules/core/engine/ modules/core/phaseresolver/ modules/core/receivers/ modules/core/transport/http/receiver/ modules/co...
Date Thu, 15 Mar 2007 13:16:11 GMT
Modified: webservices/axis2/trunk/c/include/axis2_svc_client.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_svc_client.h?view=diff&rev=518623&r1=518622&r2=518623
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_svc_client.h (original)
+++ webservices/axis2/trunk/c/include/axis2_svc_client.h Thu Mar 15 06:16:07 2007
@@ -71,330 +71,351 @@
 {
 #endif
 
-    /** Type name for struct axis2_svc_client_ops */
-    typedef struct axis2_svc_client_ops axis2_svc_client_ops_t;
     /** Type name for struct axis2_svc_client */
     typedef struct axis2_svc_client axis2_svc_client_t;
 
 
     /**
-     * service client ops struct.
-     * Encapsulator struct for operations of axis2_svc_client.
+     * Returns the axis2_svc_t this is a client for. This is primarily 
+     * useful when the service is created anonymously or from WSDL.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @return a pointer to axis service struct, or NULL if no service 
+     * is associated. Returns a reference, not a cloned copy. 
+     */
+    AXIS2_EXTERN axis2_svc_t *AXIS2_CALL
+    axis2_svc_client_get_svc(const axis2_svc_client_t *svc_client,
+        const axis2_env_t *env);
+
+    /**
+     * Sets the options to be used by service client.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @param options pointer to options struct to be set
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+     */
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axis2_svc_client_set_options(axis2_svc_client_t *svc_client,
+        const axis2_env_t *env,
+        const axis2_options_t *options);
+
+    /**
+     * Gets options used by service client. 
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @return a pointer to the options struct if options set, else NULL.
+     * Returns a reference, not a cloned copy.
+     */
+    AXIS2_EXTERN const axis2_options_t *AXIS2_CALL
+    axis2_svc_client_get_options(const axis2_svc_client_t *svc_client,
+        const axis2_env_t *env);
+
+    /**
+     * Sets the overriding options. The overriding client options related 
+     * to this service interaction override any options that the 
+     * underlying operation client may have.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @param options pointer to options struct to be set
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+     */
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axis2_svc_client_set_override_options(axis2_svc_client_t *svc_client,
+        const axis2_env_t *env,
+        const axis2_options_t *override_options);
+
+    /**
+     * Gets the overriding options.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @return pointer to overriding options struct if options set, else NULL.
+     * Returns a reference, not a cloned copy.
+     */
+    AXIS2_EXTERN const axis2_options_t *AXIS2_CALL
+    axis2_svc_client_get_override_options(const axis2_svc_client_t *svc_client,
+        const axis2_env_t *env);
+
+    /**
+     * Engages the named module. The engaged modules extend the message
+     * processing when consuming services. Modules help to apply QoS
+     * norms in messaging. Once a module is engaged to a service client,
+     * the axis2_engine makes sure to invoke the module for all the 
+     * interactions between the client and the service.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @param module_name name of the module to be engaged
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
      */
-    struct axis2_svc_client_ops
-    {
-        /**
-         * Returns the axis2_svc_t this is a client for. This is primarily 
-         * useful when the service is created anonymously or from WSDL.
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @return a pointer to axis service struct, or NULL if no service 
-         * is associated. Returns a reference, not a cloned copy. 
-         */
-        axis2_svc_t *(AXIS2_CALL *
-                get_svc)(
-                    const axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env);
-
-        /**
-         * Sets the options to be used by service client.
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @param options pointer to options struct to be set
-         * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
-         */
-        axis2_status_t (AXIS2_CALL *
-                set_options)(
-                    axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env,
-                    const axis2_options_t *options);
-
-        /**
-         * Gets options used by service client. 
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @return a pointer to the options struct if options set, else NULL.
-         * Returns a reference, not a cloned copy.
-         */
-        const axis2_options_t *(AXIS2_CALL *
-                get_options)(
-                    const axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env);
-
-        /**
-         * Sets the overriding options. The overriding client options related 
-         * to this service interaction override any options that the 
-         * underlying operation client may have.
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @param options pointer to options struct to be set
-         * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
-         */
-        axis2_status_t (AXIS2_CALL *
-                set_override_options)(
-                    axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env,
-                    const axis2_options_t *override_options);
-
-        /**
-         * Gets the overriding options.
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @return pointer to overriding options struct if options set, else NULL.
-         * Returns a reference, not a cloned copy.
-         */
-        const axis2_options_t *(AXIS2_CALL *
-                get_override_options)(
-                    const axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env);
-
-        /**
-         * Engages the named module. The engaged modules extend the message
-         * processing when consuming services. Modules help to apply QoS
-         * norms in messaging. Once a module is engaged to a service client,
-         * the axis2_engine makes sure to invoke the module for all the 
-         * interactions between the client and the service.
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @param module_name name of the module to be engaged
-         * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
-         */
-        axis2_status_t (AXIS2_CALL *
-                engage_module)(
-                    axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env,
-                    const axis2_char_t *module_name);
-
-        /**
-         * Dis-engages the named module. Dis-engaging a module on a service 
-         * client ensures that the axis2_engine would not invoke the named 
-         * module when sending and receiving messages.
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @param module_name name of the module to be dis-engaged
-         * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
-         */
-        axis2_status_t (AXIS2_CALL *
-                disengage_module)(
-                    axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env,
-                    const axis2_char_t *module_name);
-
-        /**
-         * Adds an XML element as a header to be sent to the server side.
-         * This allows users to go beyond the usual XML-in/XML-out pattern,
-         * and send custom SOAP headers. Once added, service client owns
-         * the header and will clean up when the service client is freed.
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @param header om node representing the SOAP header in XML
-         * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
-         */
-        axis2_status_t (AXIS2_CALL *
-                add_header)(
-                    axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env,
-                    axiom_node_t *header);
-
-        /**
-         * Removes all the headers added to service client.
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
-         */
-        axis2_status_t (AXIS2_CALL *
-                remove_all_headers)(
-                    axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env);
-
-        /**
-         * This method can be used to send an XML message.
-         * This is a simple method to invoke a service operation whose MEP is
-         * Robust Out-Only. If a fault triggers on server side, this method 
-         * would report an error back to the caller.
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @param op_qname operation qname. NULL is equivalent to an
-         * operation name of "__OPERATION_ROBUST_OUT_ONLY__"
-         * @param payload pointer to OM node representing the XML payload to be sent
-         * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
-         */
-        axis2_status_t (AXIS2_CALL *
-                send_robust)(
-                    axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env,
-                    const axis2_qname_t *op_qname,
-                    const axiom_node_t *payload);
-
-        /**
-         * Sends a message and forget about it. This method is used to interact with
-         * a service operation whose MEP is In-Only. That is, there is no
-         * opportunity to get an error from the service via this method; one may still
-         * get client-side errors, such as host unknown etc.
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @param op_qname operation qname. NULL is equivalent to an
-         * operation name of "__OPERATION_OUT_ONLY__"
-         * @param payload pointer to OM node representing the XML payload to be sent
-         */
-        void (AXIS2_CALL *
-                fire_and_forget)(
-                    axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env,
-                    const axis2_qname_t *op_qname,
-                    const axiom_node_t *payload);
-
-        /**
-         * Sends XML request and receives XML response.
-         * This method is used to interact with a service operation whose MEP is In-Out.
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @param op_qname operation qname. NULL is equivalent to an
-         * operation name of "__OPERATION_OUT_IN__"
-         * @param payload pointer to OM node representing the XML payload to be sent
-         * @return pointer to OM node representing the XML response. The 
-         * caller owns the returned node.
-         */
-        axiom_node_t *(AXIS2_CALL *
-                send_receive)(
-                    axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env,
-                    const axis2_qname_t *op_qname,
-                    const axiom_node_t *payload);
-
-        /**
-         * Sends XML request and receives XML response, but does not block for response.
-         * This method is used to interact in non-blocking mode with a service
-         * operation whose MEP is In-Out.
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @param op_qname operation qname. NULL is equivalent to an
-         * operation name of "__OPERATION_OUT_IN__"
-         * @param payload pointer to OM node representing the XML payload to be sent
-         * @callback pointer to callback struct used to capture response
-         */
-        void (AXIS2_CALL *
-                send_receive_non_blocking)(
-                    axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env,
-                    const axis2_qname_t *op_qname,
-                    const axiom_node_t *payload,
-                    axis2_callback_t *callback);
-
-        /**
-         * Creates an op_client for a specific operation. This is the way to  
-         * create a full functional MEP client which can be used to exchange 
-         * messages for this specific operation.
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @param op_qname axis2_qname_t of the operation
-         * @return pointer to newly created op_client configured for the given operation
-         */
-        axis2_op_client_t *(AXIS2_CALL *
-                create_op_client)(
-                    axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env,
-                    const axis2_qname_t *op_qname);
-
-        /**
-         * Cleans up service client invocation. This will close the output 
-         * stream and/or remove entry from waiting queue of the transport 
-         * listener queue.
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
-         */
-        axis2_status_t (AXIS2_CALL *
-                finalize_invoke)(
-                    axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env);
-
-        /**
-         * Gets the service client's own endpoint_ref, that is the
-         * endpoint the client will be sending from.
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @param transport name of the transport, e.g "http"
-         * @return pointer to the endpoint_ref struct. Returns a reference, 
-         * not a cloned copy.
-         */
-        const axis2_endpoint_ref_t *(AXIS2_CALL *
-                get_own_endpoint_ref)(
-                    const axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env,
-                    const axis2_char_t *transport);
-
-        /**
-         * Gets the target endpoint ref.
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @return pointer to the endpoint_ref struct. Returns a reference, 
-         * not a cloned copy.
-         */
-        const axis2_endpoint_ref_t *(AXIS2_CALL *
-                get_target_endpoint_ref)(
-                    const axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env);
-
-        /**
-         * Sets the target endpoint ref.
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @param target_epr pointer to the endpoint_ref struct to be set as 
-         * target. service client takes over the ownership of the struct.
-         * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
-         */
-        axis2_status_t (AXIS2_CALL *
-                set_target_endpoint_ref)(
-                    axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env,
-                    axis2_endpoint_ref_t *target_epr);
-
-        /**
-         * Gets the service context.
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @return pointer to service context struct. service client owns
-         * the returned pointer.
-         */
-        axis2_svc_ctx_t *(AXIS2_CALL *
-                get_svc_ctx)(
-                    const axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env);
-
-        /**
-         * Frees the service client.
-         * @param svc_client pointer to service client struct
-         * @param env pointer to environment struct
-         * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
-         */
-
-        axis2_status_t (AXIS2_CALL *
-                free_fn)(
-                    axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env);
-
-        /**
-         * Gets the operation client
-         * @param svc_client pointer to service_client struct
-         * @param env env pointer to environemt struct
-         * @return pointer to service context struct. service client owns 
-         * the returned pointer
-         */
-        axis2_op_client_t *(AXIS2_CALL *
-                get_op_client)(
-                    const axis2_svc_client_t *svc_client,
-                    const axis2_env_t *env);
-    };
-
-    /**
-     * service client struct. 
-     */
-    struct axis2_svc_client
-    {
-        /** operations of service client */
-        axis2_svc_client_ops_t *ops;
-    };
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axis2_svc_client_engage_module(axis2_svc_client_t *svc_client,
+        const axis2_env_t *env,
+        const axis2_char_t *module_name);
+
+    /**
+     * Dis-engages the named module. Dis-engaging a module on a service 
+     * client ensures that the axis2_engine would not invoke the named 
+     * module when sending and receiving messages.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @param module_name name of the module to be dis-engaged
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+     */
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axis2_svc_client_disengage_module(axis2_svc_client_t *svc_client,
+        const axis2_env_t *env,
+        const axis2_char_t *module_name);
+
+    /**
+     * Adds an XML element as a header to be sent to the server side.
+     * This allows users to go beyond the usual XML-in/XML-out pattern,
+     * and send custom SOAP headers. Once added, service client owns
+     * the header and will clean up when the service client is freed.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @param header om node representing the SOAP header in XML
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+     */
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axis2_svc_client_add_header(axis2_svc_client_t *svc_client,
+        const axis2_env_t *env,
+        axiom_node_t *header);
+
+    /**
+     * Removes all the headers added to service client.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+     */
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axis2_svc_client_remove_all_headers(axis2_svc_client_t *svc_client,
+        const axis2_env_t *env);
+
+    /**
+     * This method can be used to send an XML message.
+     * This is a simple method to invoke a service operation whose MEP is
+     * Robust Out-Only. If a fault triggers on server side, this method 
+     * would report an error back to the caller.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @param op_qname operation qname. NULL is equivalent to an
+     * operation name of "__OPERATION_ROBUST_OUT_ONLY__"
+     * @param payload pointer to OM node representing the XML payload to be sent
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+     */
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axis2_svc_client_send_robust_with_op_qname(axis2_svc_client_t *svc_client,
+        const axis2_env_t *env,
+        const axis2_qname_t *op_qname,
+        const axiom_node_t *payload);
+
+    /**
+     * This method can be used to send an XML message.
+     * This is a simple method to invoke a service operation whose MEP is
+     * Robust Out-Only. If a fault triggers on server side, this method 
+     * would report an error back to the caller.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * operation name of "__OPERATION_ROBUST_OUT_ONLY__"
+     * @param payload pointer to OM node representing the XML payload to be sent
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+     */
+
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axis2_svc_client_send_robust(axis2_svc_client_t *svc_client,
+        const axis2_env_t *env,
+        const axiom_node_t *payload);
+
+    /**
+     * Sends a message and forget about it. This method is used to interact with
+     * a service operation whose MEP is In-Only. That is, there is no
+     * opportunity to get an error from the service via this method; one may still
+     * get client-side errors, such as host unknown etc.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @param op_qname operation qname. NULL is equivalent to an
+     * operation name of "__OPERATION_OUT_ONLY__"
+     * @param payload pointer to OM node representing the XML payload to be sent
+     */
+    AXIS2_EXTERN void AXIS2_CALL
+    axis2_svc_client_fire_and_forget_with_op_qname(axis2_svc_client_t *svc_client,
+        const axis2_env_t *env,
+        const axis2_qname_t *op_qname,
+        const axiom_node_t *payload);
+
+    /**
+     * Sends a message and forget about it. This method is used to interact with
+     * a service operation whose MEP is In-Only. That is, there is no
+     * opportunity to get an error from the service via this method; one may still
+     * get client-side errors, such as host unknown etc.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @param payload pointer to OM node representing the XML payload to be sent
+     */
+    AXIS2_EXTERN void AXIS2_CALL
+    axis2_svc_client_fire_and_forget(axis2_svc_client_t *svc_client,
+        const axis2_env_t *env,
+        const axiom_node_t *payload);
+
+    /**
+     * Sends XML request and receives XML response.
+     * This method is used to interact with a service operation whose MEP is In-Out.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @param op_qname operation qname. NULL is equivalent to an
+     * operation name of "__OPERATION_OUT_IN__"
+     * @param payload pointer to OM node representing the XML payload to be sent
+     * @return pointer to OM node representing the XML response. The 
+     * caller owns the returned node.
+     */
+    AXIS2_EXTERN axiom_node_t *AXIS2_CALL
+    axis2_svc_client_send_receive_with_op_qname(axis2_svc_client_t *svc_client,
+        const axis2_env_t *env,
+        const axis2_qname_t *op_qname,
+        const axiom_node_t *payload);
+
+    /**
+     * Sends XML request and receives XML response.
+     * This method is used to interact with a service operation whose MEP is In-Out.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @param payload pointer to OM node representing the XML payload to be sent
+     * @return pointer to OM node representing the XML response. The 
+     * caller owns the returned node.
+     */
+    AXIS2_EXTERN axiom_node_t *AXIS2_CALL
+    axis2_svc_client_send_receive(axis2_svc_client_t *svc_client,
+        const axis2_env_t *env,
+        const axiom_node_t *payload);
+
+    /**
+     * Sends XML request and receives XML response, but does not block for response.
+     * This method is used to interact in non-blocking mode with a service
+     * operation whose MEP is In-Out.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @param op_qname operation qname. NULL is equivalent to an
+     * operation name of "__OPERATION_OUT_IN__"
+     * @param payload pointer to OM node representing the XML payload to be sent
+     * @callback pointer to callback struct used to capture response
+     */
+    AXIS2_EXTERN void AXIS2_CALL
+    axis2_svc_client_send_receive_non_blocking_with_op_qname(axis2_svc_client_t *svc_client,
+        const axis2_env_t *env,
+        const axis2_qname_t *op_qname,
+        const axiom_node_t *payload,
+        axis2_callback_t *callback);
+
+    /**
+     * Sends XML request and receives XML response, but does not block for response.
+     * This method is used to interact in non-blocking mode with a service
+     * operation whose MEP is In-Out.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @param payload pointer to OM node representing the XML payload to be sent
+     * @callback pointer to callback struct used to capture response
+     */
+    AXIS2_EXTERN void AXIS2_CALL
+    axis2_svc_client_send_receive_non_blocking(axis2_svc_client_t *svc_client,
+        const axis2_env_t *env,
+        const axiom_node_t *payload,
+        axis2_callback_t *callback);
+
+    /**
+     * Creates an op_client for a specific operation. This is the way to  
+     * create a full functional MEP client which can be used to exchange 
+     * messages for this specific operation.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @param op_qname axis2_qname_t of the operation
+     * @return pointer to newly created op_client configured for the given operation
+     */
+    AXIS2_EXTERN axis2_op_client_t *AXIS2_CALL
+    axis2_svc_client_create_op_client(axis2_svc_client_t *svc_client,
+        const axis2_env_t *env,
+        const axis2_qname_t *op_qname);
+
+    /**
+     * Cleans up service client invocation. This will close the output 
+     * stream and/or remove entry from waiting queue of the transport 
+     * listener queue.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+     */
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axis2_svc_client_finalize_invoke(axis2_svc_client_t *svc_client,
+        const axis2_env_t *env);
+
+    /**
+     * Gets the service client's own endpoint_ref, that is the
+     * endpoint the client will be sending from.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @param transport name of the transport, e.g "http"
+     * @return pointer to the endpoint_ref struct. Returns a reference, 
+     * not a cloned copy.
+     */
+    AXIS2_EXTERN const axis2_endpoint_ref_t *AXIS2_CALL
+    axis2_svc_client_get_own_endpoint_ref(const axis2_svc_client_t *svc_client,
+        const axis2_env_t *env,
+        const axis2_char_t *transport);
+
+    /**
+     * Gets the target endpoint ref.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @return pointer to the endpoint_ref struct. Returns a reference, 
+     * not a cloned copy.
+     */
+    AXIS2_EXTERN const axis2_endpoint_ref_t *AXIS2_CALL
+    axis2_svc_client_get_target_endpoint_ref(const axis2_svc_client_t *svc_client,
+        const axis2_env_t *env);
+
+    /**
+     * Sets the target endpoint ref.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @param target_epr pointer to the endpoint_ref struct to be set as 
+     * target. service client takes over the ownership of the struct.
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+     */
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axis2_svc_client_set_target_endpoint_ref(axis2_svc_client_t *svc_client,
+        const axis2_env_t *env,
+        axis2_endpoint_ref_t *target_epr);
+
+    /**
+     * Gets the service context.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @return pointer to service context struct. service client owns
+     * the returned pointer.
+     */
+    AXIS2_EXTERN axis2_svc_ctx_t *AXIS2_CALL
+    axis2_svc_client_get_svc_ctx(const axis2_svc_client_t *svc_client,
+        const axis2_env_t *env);
+
+    /**
+     * Frees the service client.
+     * @param svc_client pointer to service client struct
+     * @param env pointer to environment struct
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+     */
+
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axis2_svc_client_free(axis2_svc_client_t *svc_client,
+        const axis2_env_t *env);
+
+    /**
+     * Gets the operation client
+     * @param svc_client pointer to service_client struct
+     * @param env env pointer to environemt struct
+     * @return pointer to service context struct. service client owns 
+     * the returned pointer
+     */
+    AXIS2_EXTERN axis2_op_client_t *AXIS2_CALL
+    axis2_svc_client_get_op_client(const axis2_svc_client_t *svc_client,
+        const axis2_env_t *env);
 
     /**
      * Creates a service client struct.
@@ -404,8 +425,7 @@
      *         or NULL on error with error code set in environment's error
      */
     AXIS2_EXTERN axis2_svc_client_t * AXIS2_CALL
-    axis2_svc_client_create(
-        const axis2_env_t *env,
+    axis2_svc_client_create(const axis2_env_t *env,
         const axis2_char_t *client_home);
 
     /**
@@ -421,8 +441,7 @@
      *         or NULL on error with error code set in environment's error
      */
     AXIS2_EXTERN axis2_svc_client_t * AXIS2_CALL
-    axis2_svc_client_create_with_conf_ctx_and_svc(
-        const axis2_env_t *env,
+    axis2_svc_client_create_with_conf_ctx_and_svc(const axis2_env_t *env,
         const axis2_char_t *client_home,
         axis2_conf_ctx_t *conf_ctx,
         axis2_svc_t *svc);
@@ -443,142 +462,116 @@
      *         or NULL on error with error code set in environment's error
      */
     AXIS2_EXTERN axis2_svc_client_t* AXIS2_CALL
-    axis2_svc_client_create_for_dynamic_invocation(
-        const axis2_env_t *env,
+    axis2_svc_client_create_for_dynamic_invocation(const axis2_env_t *env,
         axis2_conf_ctx_t *conf_ctx,
         const axis2_uri_t *wsdl_uri,
         const axis2_qname_t *wsdl_svc_qname,
         const axis2_char_t *endpoint_name,
         const axis2_char_t *client_home);
 
-/** Gets the service consumed by service client. 
-    @sa axis2_svc_client_ops#get_svc */
+/** Gets the service consumed by service client. */
 #define AXIS2_SVC_CLIENT_GET_AXIS_SERVICE(svc_client, env) \
-        ((svc_client)->ops->get_svc(svc_client, env))
+        axis2_svc_client_get_svc(svc_client, env)
 
-/** Sets the options to be used by service client. 
-    @sa axis2_svc_client_ops#set_options */
+/** Sets the options to be used by service client.  */
 #define AXIS2_SVC_CLIENT_SET_OPTIONS(svc_client, env, options) \
-        ((svc_client)->ops->set_options(svc_client, env, options))
+        axis2_svc_client_set_options(svc_client, env, options)
 
-/** Gets the options being used by service client. 
-    @sa axis2_svc_client_ops#get_options */
+/** Gets the options being used by service client.  */
 #define AXIS2_SVC_CLIENT_GET_OPTIONS(svc_client, env) \
-        ((svc_client)->ops->get_options(svc_client, env))
+        axis2_svc_client_get_options(svc_client, env)
 
-/** Sets the overriding options to be used by service client. 
-    @sa axis2_svc_client_ops#set_override_options */
+/** Sets the overriding options to be used by service client.  */
 #define AXIS2_SVC_CLIENT_SET_OVERRIDE_OPTIONS(svc_client, env, override_options) \
-        ((svc_client)->ops->set_override_options(svc_client, env, override_options))
+        axis2_svc_client_set_override_options(svc_client, env, override_options)
 
-/** Gets the overriding options being used by service client 
-    @sa axis2_svc_client_ops#get_override_options */
+/** Gets the overriding options being used by service client  */
 #define AXIS2_SVC_CLIENT_GET_OVERRIDE_OPTIONS(svc_client, env) \
-        ((svc_client)->ops->get_override_options(svc_client, env))
+        axis2_svc_client_get_override_options(svc_client, env)
 
-/** Engages the given module. 
-    @sa axis2_svc_client_ops#engage_module */
+/** Engages the given module.  */
 #define AXIS2_SVC_CLIENT_ENGAGE_MODULE(svc_client, env, module_name) \
-        ((svc_client)->ops->engage_module(svc_client, env, module_name))
+        axis2_svc_client_engage_module(svc_client, env, module_name)
 
-/** Dis-engages the given module. 
-    @sa axis2_svc_client_ops#disengage_module */
+/** Dis-engages the given module.  */
 #define AXIS2_SVC_CLIENT_DISENGAGE_MODULE(svc_client, env, module_name) \
-        ((svc_client)->ops->disengage_module(svc_client, env, module_name))
+        axis2_svc_client_disengage_module(svc_client, env, module_name)
 
-/** Adds a SOAP header to be sent by the service client. 
-    @sa axis2_svc_client_ops#add_header */
+/** Adds a SOAP header to be sent by the service client.  */
 #define AXIS2_SVC_CLIENT_ADD_HEADER(svc_client, env, header) \
-        ((svc_client)->ops->add_header(svc_client, env, header))
+        axis2_svc_client_add_header(svc_client, env, header)
 
-/** Removes all the SOAP headers currently set on service client. 
-    @sa axis2_svc_client_ops#remove_all_headers */
+/** Removes all the SOAP headers currently set on service client.  */
 #define AXIS2_SVC_CLIENT_REMOVE_ALL_HEADERS(svc_client, env) \
-        ((svc_client)->ops->remove_all_headers(svc_client, env))
+        axis2_svc_client_remove_all_headers(svc_client, env)
 
 /** Sends the given payload in a robust manner. 
-    Robust means that SOAP faults are captured and reported. 
-    @sa axis2_svc_client_ops#send_robust */
+    Robust means that SOAP faults are captured and reported.  */
 #define AXIS2_SVC_CLIENT_SEND_ROBUST(svc_client, env, payload) \
-        ((svc_client)->ops->send_robust(svc_client, env, NULL, payload))
+        axis2_svc_client_send_robust(svc_client, env, payload)
 
-/** Sends the given payload in a robust manner targeted to named operation. 
-    @sa axis2_svc_client_ops#send_robust */
+/** Sends the given payload in a robust manner targeted to named operation.  */
 #define AXIS2_SVC_CLIENT_SEND_ROBUST_WITH_OP_QNAME(svc_client, env, op_qname, payload) \
-        ((svc_client)->ops->send_robust(svc_client, env, op_qname, payload))
+        axis2_svc_client_send_robust_with_op_qname(svc_client, env, op_qname, payload)
 
 /** Sends the given payload and forgets about it. 
-    No SOAP faults are reported.
-    @sa axis2_svc_client_ops#fire_and_forget */
+    No SOAP faults are reported. */
 #define AXIS2_SVC_CLIENT_FIRE_AND_FORGET(svc_client, env, payload) \
-        ((svc_client)->ops->fire_and_forget(svc_client, env, NULL, payload))
+        axis2_svc_client_fire_and_forget(svc_client, env, payload)
 
-/** Sends the given payload targeted to named operation and forgets about it
-    @sa axis2_svc_client_ops#fire_and_forget */
+/** Sends the given payload targeted to named operation and forgets about it */
 #define AXIS2_SVC_CLIENT_FIRE_AND_FORGET_WITH_OP_QNAME(svc_client, env, op_qname, payload) \
-        ((svc_client)->ops->fire_and_forget(svc_client, env, op_qname, payload))
+        axis2_svc_client_fire_and_forget_with_op_qname(svc_client, env, op_qname, payload)
 
-/** Sends the given payload and receives the response. 
-    @sa axis2_svc_client_ops#send_receive */
+/** Sends the given payload and receives the response.  */
 #define AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload) \
-        ((svc_client)->ops->send_receive(svc_client, env, NULL, payload))
+        axis2_svc_client_send_receive(svc_client, env, payload)
 
-/** Sends the given payload targeted to named operation and receives the response. 
-    @sa axis2_svc_client_ops#send_receive */
+/** Sends the given payload targeted to named operation and receives the response.  */
 #define AXIS2_SVC_CLIENT_SEND_RECEIVE_WITH_OP_QNAME(svc_client, env, op_qname, payload) \
-        ((svc_client)->ops->send_receive(svc_client, env, op_qname, payload))
+        axis2_svc_client_send_receive_with_op_qname(svc_client, env, op_qname, payload)
 
 /** Sends the given payload and receives the response.
-    Does not block till response arrives. Uses the callback to capture response. 
-    @sa axis2_svc_client_ops#send_receive_non_blocking */
+    Does not block till response arrives. Uses the callback to capture response.  */
 #define AXIS2_SVC_CLIENT_SEND_RECEIVE_NON_BLOCKING(svc_client, env, payload, callback) \
-        ((svc_client)->ops->send_receive_non_blocking(svc_client, env, NULL, payload, callback))
+        axis2_svc_client_send_receive_non_blocking(svc_client, env, payload, callback)
 
 /** Sends the given payload targeted to named operation and receives the response.
-    Does not block till response arrives. Uses the callback to capture response 
-    @sa axis2_svc_client_ops#send_receive_non_blocking */
+    Does not block till response arrives. Uses the callback to capture response  */
 #define AXIS2_SVC_CLIENT_SEND_RECEIVE_NON_BLOCKING_WITH_OP_QNAME(svc_client, env, op_qname, payload, callback) \
-        ((svc_client)->ops->send_receive_non_blocking(svc_client, env, op_qname, payload, callback))
+        axis2_svc_client_send_receive_non_blocking_with_op_qname(svc_client, env, op_qname, payload, callback)
 
-/** Creates an operation client for a specific operation. 
-    @sa axis2_svc_client_ops#create_op_client */
+/** Creates an operation client for a specific operation.  */
 #define AXIS2_SVC_CLIENT_CREATE_OP_CLIENT(svc_client, env, op_qname) \
-        ((svc_client)->ops->create_op_client(svc_client, env, op_qname))
+        axis2_svc_client_create_op_client(svc_client, env, op_qname)
 
-/** Cleans up after the invocations. 
-    @sa axis2_svc_client_ops#finalize_invoke */
+/** Cleans up after the invocations.  */
 #define AXIS2_SVC_CLIENT_FINALIZE_INVOKE(svc_client, env) \
-        ((svc_client)->ops->finalize_invoke(svc_client, env))
+        axis2_svc_client_finalize_invoke(svc_client, env)
 
-/** Gets the service client's own endpoint ref. 
-    @sa axis2_svc_client_ops#get_own_endpoint_ref */
+/** Gets the service client's own endpoint ref.  */
 #define AXIS2_SVC_CLIENT_GET_OWN_ENDPOINT_REF(svc_client, env, transport) \
-        ((svc_client)->ops->get_own_endpoint_ref(svc_client, env, transport))
+        axis2_svc_client_get_own_endpoint_ref(svc_client, env, transport)
 
-/** Gets the target endpoint ref. 
-    @sa axis2_svc_client_ops#get_target_endpoint_ref */
+/** Gets the target endpoint ref.  */
 #define AXIS2_SVC_CLIENT_GET_TARGET_ENDPOINT_REF(svc_client, env) \
-        ((svc_client)->ops->get_target_endpoint_ref(svc_client, env))
+        axis2_svc_client_get_target_endpoint_ref(svc_client, env)
 
-/** Sets the target endpoint ref. 
-    @sa axis2_svc_client_ops#set_target_endpoint_ref */
+/** Sets the target endpoint ref.  */
 #define AXIS2_SVC_CLIENT_SET_TARGET_ENDPOINT_REF(svc_client, env, target_epr) \
-        ((svc_client)->ops->set_target_endpoint_ref(svc_client, env, target_epr))
+        axis2_svc_client_set_target_endpoint_ref(svc_client, env, target_epr)
 
-/** Gets the service context being used by the service client. 
-    @sa axis2_svc_client_ops#get_svc_ctx */
+/** Gets the service context being used by the service client.  */
 #define AXIS2_SVC_CLIENT_GET_SVC_CTX(svc_client, env) \
-        ((svc_client)->ops->get_svc_ctx(svc_client, env))
+        axis2_svc_client_get_svc_ctx(svc_client, env)
 
-/** Frees given service client. 
-    @sa axis2_svc_client_ops#free_fn */
+/** Frees given service client.  */
 #define AXIS2_SVC_CLIENT_FREE(svc_client, env) \
-        ((svc_client)->ops->free_fn(svc_client, env))
+        axis2_svc_client_free(svc_client, env)
         
-/** Gets the op_client .
-    @sa axis2_svc_client_ops#get_op_client */
+/** Gets the op_client . */
     #define AXIS2_SVC_CLIENT_GET_OP_CLIENT(svc_client, env) \
-            ((svc_client)->ops->get_op_client(svc_client, env))
+            axis2_svc_client_get_op_client(svc_client, env)
 
 
 /** @} */

Modified: webservices/axis2/trunk/c/include/axis2_svr_callback.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_svr_callback.h?view=diff&rev=518623&r1=518622&r2=518623
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_svr_callback.h (original)
+++ webservices/axis2/trunk/c/include/axis2_svr_callback.h Thu Mar 15 06:16:07 2007
@@ -37,63 +37,42 @@
 #include <axis2_const.h>
 #include <axis2_msg_ctx.h>
 
-    /** Type name for struct axis2_svr_callback_ops */
-    typedef struct axis2_svr_callback_ops axis2_svr_callback_ops_t;
     /** Type name for struct axis2_svr_callback */
     typedef struct axis2_svr_callback axis2_svr_callback_t;
 
     /**
-     * service callback ops struct
-     * Encapsulator struct for ops of axis2_svr_callback
+     * Deallocate memory
+     * @param svr_callback pointer to server callback struct
+     * @param env pointer to environment struct
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+     */
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axis2_svr_callback_free(axis2_svr_callback_t *svr_callback,
+        const axis2_env_t *env);
+
+    /**
+     * Handle result
+     * @param svr_callback pointer to server callback struct
+     * @param env pointer to environment struct
+     * @param msg_ctx pointer to message context
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
      */
-    struct axis2_svr_callback_ops
-    {
-        /**
-         * Deallocate memory
-         * @param svr_callback pointer to server callback struct
-         * @param env pointer to environment struct
-         * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
-         */
-        axis2_status_t (AXIS2_CALL *
-                free)(
-                    axis2_svr_callback_t *svr_callback,
-                    const axis2_env_t *env);
-
-        /**
-         * Handle result
-         * @param svr_callback pointer to server callback struct
-         * @param env pointer to environment struct
-         * @param msg_ctx pointer to message context
-         * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
-         */
-        axis2_status_t (AXIS2_CALL *
-                handle_result)(
-                    axis2_svr_callback_t *svr_callback,
-                    const axis2_env_t *env,
-                    axis2_msg_ctx_t *msg_ctx);
-
-        /**
-         * Handle fault
-         * @param svr_callback pointer to server callback struct
-         * @param env pointer to environment struct
-         * @param msg_ctx pointer to message context
-         * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
-         */
-        axis2_status_t (AXIS2_CALL *
-                handle_fault)(
-                    axis2_svr_callback_t *svr_callback,
-                    const axis2_env_t *env,
-                    axis2_msg_ctx_t *msg_ctx);
-    };
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axis2_svr_callback_handle_result(axis2_svr_callback_t *svr_callback,
+        const axis2_env_t *env,
+        axis2_msg_ctx_t *msg_ctx);
 
     /**
-     * server callback struct
+     * Handle fault
+     * @param svr_callback pointer to server callback struct
+     * @param env pointer to environment struct
+     * @param msg_ctx pointer to message context
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
      */
-    struct axis2_svr_callback
-    {
-        /** operations of server callback */
-        axis2_svr_callback_ops_t *ops;
-    };
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axis2_svr_callback_handle_fault(axis2_svr_callback_t *svr_callback,
+        const axis2_env_t *env,
+        axis2_msg_ctx_t *msg_ctx);
 
     /**
      * Create Server Callback struct
@@ -101,27 +80,19 @@
      * @return newly created server callback object
      */
     AXIS2_EXTERN axis2_svr_callback_t *AXIS2_CALL
-    axis2_svr_callback_create(
-        const axis2_env_t *env);
+    axis2_svr_callback_create(const axis2_env_t *env);
 
-/************************** Start of function macros **************************/
-
-/** Frees server callback.
-    @sa axis2_svr_callback_ops#free */
+/** Frees server callback. */
 #define AXIS2_SVR_CALLBACK_FREE(svr_callback, env) \
-        ((svr_callback)->ops->free (svr_callback, env))
+        axis2_svr_callback_free (svr_callback, env)
 
-/** Handler result.
-    @sa axis2_svr_callback_ops#handle-result */
+/** Handler result. */
 #define AXIS2_SVR_CALLBACK_HANDLER_RESULT(svr_callback, env, msg_ctx) \
-      ((svr_callback)->ops->handle_result (svr_callback, env, msg_ctx))
+      axis2_svr_callback_handle_result (svr_callback, env, msg_ctx)
 
-/** Handler fault.
-    @sa axis2_svr_callback_ops#handle_fault */
+/** Handler fault. */
 #define AXIS2_SVR_CALLBACK_HANDLER_FAULT(svr_callback, env, msg_ctx) \
-      ((svr_callback)->ops->handle_fault (svr_callback, env, msg_ctx))
-
-/************************** End of function macros ****************************/
+      axis2_svr_callback_handle_fault (svr_callback, env, msg_ctx)
 
 /** @} */
 #ifdef __cplusplus

Modified: webservices/axis2/trunk/c/modules/core/clientapi/async_result.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/clientapi/async_result.c?view=diff&rev=518623&r1=518622&r2=518623
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/async_result.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/async_result.c Thu Mar 15 06:16:07 2007
@@ -19,135 +19,68 @@
 #include <axis2_const.h>
 #include <axis2_hash.h>
 
-typedef struct axis2_async_result_impl
+struct axis2_async_result
 {
-    /** context base struct */
-    axis2_async_result_t async_result;
     /** result message context */
     axis2_msg_ctx_t *result;
-}
-axis2_async_result_impl_t;
-
-/** Interface to implementation conversion macro */
-#define AXIS2_INTF_TO_IMPL(async_result) ((axis2_async_result_impl_t *)async_result)
-
+};
 
-axiom_soap_envelope_t *AXIS2_CALL
-axis2_async_result_get_envelope(
-    axis2_async_result_t *async_result,
-    const axis2_env_t *env);
-
-axis2_msg_ctx_t *AXIS2_CALL
-axis2_async_result_get_result(
-    axis2_async_result_t *async_result,
-    const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_async_result_free(
-    axis2_async_result_t *async_result,
-    const axis2_env_t *env);
-
-axis2_async_result_t *AXIS2_CALL
-axis2_async_result_create(
-    const axis2_env_t *env,
+AXIS2_EXTERN axis2_async_result_t *AXIS2_CALL
+axis2_async_result_create(const axis2_env_t *env,
     axis2_msg_ctx_t *result)
 {
-    axis2_async_result_impl_t *async_result_impl = NULL;
+    axis2_async_result_t *async_result = NULL;
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    async_result_impl = AXIS2_MALLOC(env->allocator,
-            sizeof(axis2_async_result_impl_t));
-    if (!async_result_impl)
+    async_result = AXIS2_MALLOC(env->allocator,
+            sizeof(axis2_async_result_t));
+    if (!async_result)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
 
-    async_result_impl->async_result.ops = NULL;
-    async_result_impl->result = NULL;
+    async_result->result = NULL;
 
     if (result)
     {
-        async_result_impl->result = result; /* shallow copy */
-    }
-
-    /* initialize ops */
-    async_result_impl->async_result.ops  =
-        AXIS2_MALLOC(env->allocator, sizeof(axis2_async_result_ops_t));
-    if (!async_result_impl->async_result.ops)
-    {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        axis2_async_result_free(&(async_result_impl->async_result), env);
-        return NULL;
+        async_result->result = result; /* shallow copy */
     }
 
-    async_result_impl->async_result.ops->get_envelope =
-        axis2_async_result_get_envelope;
-
-    async_result_impl->async_result.ops->get_result =
-        axis2_async_result_get_result;
-
-    async_result_impl->async_result.ops->free =
-        axis2_async_result_free;
-
-    return &(async_result_impl->async_result);
+    return async_result;
 }
 
-axiom_soap_envelope_t *AXIS2_CALL
-axis2_async_result_get_envelope(
-    axis2_async_result_t *async_result,
+AXIS2_EXTERN axiom_soap_envelope_t *AXIS2_CALL
+axis2_async_result_get_envelope(axis2_async_result_t *async_result,
     const axis2_env_t *env)
 {
-    axis2_async_result_impl_t *async_result_impl = NULL;
-
     AXIS2_ENV_CHECK(env, NULL);
 
-    async_result_impl = AXIS2_INTF_TO_IMPL(async_result);
-
-    if (async_result_impl->result)
+    if (async_result->result)
     {
-        return  axis2_msg_ctx_get_soap_envelope(async_result_impl->result, env);
+        return  axis2_msg_ctx_get_soap_envelope(async_result->result, env);
     }
 
     return NULL;
 }
 
-axis2_msg_ctx_t *AXIS2_CALL
-axis2_async_result_get_result(
-    axis2_async_result_t *async_result,
+AXIS2_EXTERN axis2_msg_ctx_t *AXIS2_CALL
+axis2_async_result_get_result(axis2_async_result_t *async_result,
     const axis2_env_t *env)
 {
-    AXIS2_ENV_CHECK(env, NULL);
-    return AXIS2_INTF_TO_IMPL(async_result)->result;
+    return async_result->result;
 }
 
-axis2_status_t AXIS2_CALL
-axis2_async_result_free(
-    axis2_async_result_t *async_result,
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axis2_async_result_free(axis2_async_result_t *async_result,
     const axis2_env_t *env)
 {
-    axis2_async_result_impl_t *async_result_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    async_result_impl = AXIS2_INTF_TO_IMPL(async_result);
-
-    if (async_result_impl->async_result.ops)
-    {
-        AXIS2_FREE(env->allocator, async_result_impl->async_result.ops);
-        async_result_impl->async_result.ops = NULL;
-    }
-
-    /* We have a shallow copy here, so it is not appropriate to free it here.
-    if (async_result_impl->result)
-    {
-         axis2_msg_ctx_free(async_result_impl->result, env);
-        async_result_impl->result = NULL;
-    }*/
-
-    AXIS2_FREE(env->allocator, async_result_impl);
-    async_result_impl = NULL;
+    AXIS2_FREE(env->allocator, async_result);
 
     return AXIS2_SUCCESS;
 }
+
+

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=518623&r1=518622&r2=518623
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/callback.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/callback.c Thu Mar 15 06:16:07 2007
@@ -19,10 +19,8 @@
 #include <axis2_const.h>
 #include <axis2_hash.h>
 
-typedef struct axis2_callback_impl
+struct axis2_callback
 {
-    /** context base struct */
-    axis2_callback_t callback;
     /** callback complete? */
     axis2_bool_t complete;
     /** envelope corresponding to the result */
@@ -32,320 +30,205 @@
     /** to store callback specific data */
     void *data;
     axis2_thread_mutex_t *mutex;
-}
-axis2_callback_impl_t;
-
-/** Interface to implementation conversion macro */
-#define AXIS2_INTF_TO_IMPL(callback) ((axis2_callback_impl_t *)callback)
 
+    /**
+     * This function is called by invoke_on_complete.
+     * Users could provide this method so that they can define what to be 
+     * done when the callback returns on completion.
+     * @param callback pointer to callback struct
+     * @param env pointer to environment struct
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+     */
+    axis2_status_t (AXIS2_CALL *
+    on_complete)(axis2_callback_t *callback,
+        const axis2_env_t *env);
+
+    /**
+     * This function is called by report_error.
+     * Users could provide this method so that they can define what to be done
+     * when the callback returns an error.
+     * @param callback pointer to callback struct
+     * @param env pointer to environment struct
+     * @param exception error code representing the error
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+     */
+    axis2_status_t (AXIS2_CALL *
+    on_error)(axis2_callback_t *callback,
+        const axis2_env_t *env,
+        const int exception);
+};
 
-axis2_status_t AXIS2_CALL
-axis2_callback_invoke_on_complete(
-    axis2_callback_t *callback,
-    const axis2_env_t *env,
-    axis2_async_result_t *result);
-
-axis2_status_t AXIS2_CALL
+static axis2_status_t AXIS2_CALL
 axis2_callback_on_complete(
     axis2_callback_t *callback,
     const axis2_env_t *env);
 
-axis2_status_t AXIS2_CALL
-axis2_callback_report_error(
-    axis2_callback_t *callback,
-    const axis2_env_t *env,
-    int exception);
-
-axis2_status_t AXIS2_CALL
+static axis2_status_t AXIS2_CALL
 axis2_callback_on_error(
     axis2_callback_t *callback,
     const axis2_env_t *env,
     int exception);
 
-axis2_bool_t AXIS2_CALL
-axis2_callback_get_complete(
-    const axis2_callback_t *callback,
-    const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_callback_set_complete(
-    axis2_callback_t *callback,
-    const axis2_env_t *env,
-    axis2_bool_t complete);
-
-axiom_soap_envelope_t *AXIS2_CALL
-axis2_callback_get_envelope(
-    const axis2_callback_t *callback,
-    const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_callback_set_envelope(
-    axis2_callback_t *callback,
-    const axis2_env_t *env,
-    axiom_soap_envelope_t *envelope);
-
-int AXIS2_CALL
-axis2_callback_get_error(
-    const axis2_callback_t *callback,
-    const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_callback_set_error(
-    axis2_callback_t *callback,
-    const axis2_env_t *env,
-    int error);
-
-axis2_status_t AXIS2_CALL
-axis2_callback_free(
-    axis2_callback_t *callback,
-    const axis2_env_t *env);
-
-void AXIS2_CALL
-axis2_callback_set_on_complete(
-    axis2_callback_t *callback,
-    axis2_on_complete_func_ptr f);
-
-void AXIS2_CALL
-axis2_callback_set_on_error(
-    axis2_callback_t *callback,
-    axis2_on_error_func_ptr f);
-
-axis2_status_t AXIS2_CALL
-axis2_callback_set_data(
-    axis2_callback_t *callback,
-    void *data);
-
-void *AXIS2_CALL
-axis2_callback_get_data(
-    const axis2_callback_t *callback);
-
-axis2_callback_t *AXIS2_CALL
+AXIS2_EXTERN axis2_callback_t *AXIS2_CALL
 axis2_callback_create(
     const axis2_env_t *env)
 {
-    axis2_callback_impl_t *callback_impl = NULL;
+    axis2_callback_t *callback = NULL;
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    callback_impl = AXIS2_MALLOC(env->allocator, sizeof(axis2_callback_impl_t));
-    if (!callback_impl)
+    callback = AXIS2_MALLOC(env->allocator, sizeof(axis2_callback_t));
+    if (!callback)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
 
-    callback_impl->callback.ops = NULL;
-    callback_impl->complete = AXIS2_FALSE;
-    callback_impl->envelope = NULL;
-    callback_impl->error = AXIS2_ERROR_NONE;
-    callback_impl->data = NULL;
-    callback_impl->mutex = NULL;
-
-    /* initialize ops */
-    callback_impl->callback.ops =
-        AXIS2_MALLOC(env->allocator, sizeof(axis2_callback_ops_t));
+    callback->complete = AXIS2_FALSE;
+    callback->envelope = NULL;
+    callback->error = AXIS2_ERROR_NONE;
+    callback->data = NULL;
+    callback->mutex = NULL;
+    callback->on_complete = axis2_callback_on_complete;
+    callback->on_error = axis2_callback_on_error;
 
-    if (!callback_impl->callback.ops)
-    {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        axis2_callback_free(&(callback_impl->callback), env);
-        return NULL;
-    }
-    callback_impl->mutex = axis2_thread_mutex_create(env->allocator,
+    callback->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 =
-        axis2_callback_on_complete;
-    callback_impl->callback.ops->report_error =
-        axis2_callback_report_error;
-    callback_impl->callback.ops->on_error =
-        axis2_callback_on_error;
-    callback_impl->callback.ops->get_complete =
-        axis2_callback_get_complete;
-    callback_impl->callback.ops->set_complete =
-        axis2_callback_set_complete;
-    callback_impl->callback.ops->get_envelope =
-        axis2_callback_get_envelope;
-    callback_impl->callback.ops->set_envelope =
-        axis2_callback_set_envelope;
-    callback_impl->callback.ops->get_error =
-        axis2_callback_get_error;
-    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;
-
-    return &(callback_impl->callback);
+    return callback;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_callback_invoke_on_complete(
     axis2_callback_t *callback,
     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));
-    status = AXIS2_CALLBACK_ON_COMPLETE(callback, env);
+    status = callback->on_complete(callback, env);
 
     return status;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_callback_report_error(
     axis2_callback_t *callback,
     const axis2_env_t *env,
     int exception)
 {
     axis2_callback_set_error(callback, env, exception);
-    return AXIS2_CALLBACK_ON_ERROR(callback, env, exception);
+    return callback->on_error(callback, env, exception);
 }
 
-axis2_bool_t AXIS2_CALL
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
 axis2_callback_get_complete(
     const axis2_callback_t *callback,
     const axis2_env_t *env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    return AXIS2_INTF_TO_IMPL(callback)->complete;
+    return callback->complete;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_callback_set_complete(
     axis2_callback_t *callback,
     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;
+    callback->complete = complete;
     return AXIS2_SUCCESS;
 }
 
-axiom_soap_envelope_t *AXIS2_CALL
+AXIS2_EXTERN axiom_soap_envelope_t *AXIS2_CALL
 axis2_callback_get_envelope(
     const axis2_callback_t *callback,
     const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return AXIS2_INTF_TO_IMPL(callback)->envelope;
+    return callback->envelope;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_callback_set_envelope(
     axis2_callback_t *callback,
     const axis2_env_t *env,
     axiom_soap_envelope_t *envelope)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_INTF_TO_IMPL(callback)->envelope = envelope;
+    callback->envelope = envelope;
     return AXIS2_SUCCESS;
 }
 
-int AXIS2_CALL
+AXIS2_EXTERN int AXIS2_CALL
 axis2_callback_get_error(
     const axis2_callback_t *callback,
     const axis2_env_t *env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    return AXIS2_INTF_TO_IMPL(callback)->error;
+    return callback->error;
 }
-axis2_status_t AXIS2_CALL
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_callback_set_error(
     axis2_callback_t *callback,
     const axis2_env_t *env,
     int error)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_INTF_TO_IMPL(callback)->error = error;
+    callback->error = error;
     return AXIS2_SUCCESS;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_callback_free(
     axis2_callback_t *callback,
     const axis2_env_t *env)
 {
-    axis2_callback_impl_t *callback_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    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)
+    if(callback->mutex)
     {
-        AXIS2_FREE(env->allocator, callback_impl->callback.ops);
-        callback_impl->callback.ops = NULL;
+        axis2_thread_mutex_destroy(callback->mutex);
     }
 
-    AXIS2_FREE(env->allocator, callback_impl);
-    callback_impl = NULL;
+    AXIS2_FREE(env->allocator, callback);
 
     return AXIS2_SUCCESS;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_callback_set_data(
     axis2_callback_t *callback,
     void *data)
 {
-    axis2_callback_impl_t *callback_impl = NULL;
-
-    callback_impl = AXIS2_INTF_TO_IMPL(callback);
-
-    callback_impl->data = (void*)data;
+    callback->data = (void*)data;
 
     return AXIS2_SUCCESS;
 }
 
-void *AXIS2_CALL
+AXIS2_EXTERN void *AXIS2_CALL
 axis2_callback_get_data(
     const axis2_callback_t *callback)
 {
-    axis2_callback_impl_t *callback_impl = NULL;
-
-    callback_impl = AXIS2_INTF_TO_IMPL(callback);
-
-    return callback_impl->data;
+    return callback->data;
 }
 
-void AXIS2_CALL
+AXIS2_EXTERN void AXIS2_CALL
 axis2_callback_set_on_complete(
     axis2_callback_t *callback,
     axis2_on_complete_func_ptr func)
 {
-    callback->ops->on_complete = func;
+    callback->on_complete = func;
 }
 
-void AXIS2_CALL
+AXIS2_EXTERN void AXIS2_CALL
 axis2_callback_set_on_error(
     axis2_callback_t *callback,
     axis2_on_error_func_ptr func)
 {
-    callback->ops->on_error = func;
+    callback->on_error = func;
 }
 
-axis2_status_t AXIS2_CALL
+static axis2_status_t AXIS2_CALL
 axis2_callback_on_complete(
     axis2_callback_t *callback,
     const axis2_env_t *env)
@@ -353,7 +236,7 @@
     return AXIS2_SUCCESS;
 }
 
-axis2_status_t AXIS2_CALL
+static axis2_status_t AXIS2_CALL
 axis2_callback_on_error(
     axis2_callback_t *callback,
     const axis2_env_t *env,

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=518623&r1=518622&r2=518623
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/callback_recv.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/callback_recv.c Thu Mar 15 06:16:07 2007
@@ -19,215 +19,151 @@
 #include <axis2_const.h>
 #include <axis2_hash.h>
 
-typedef struct axis2_callback_recv_impl
+struct axis2_callback_recv
 {
-    /** context base struct */
-    axis2_callback_recv_t callback_recv;
     /** base context struct */
     axis2_msg_recv_t *base;
     axis2_bool_t base_deep_copy;
     /** callback map */
     axis2_hash_t *callback_map;
     axis2_thread_mutex_t *mutex;
-}
-axis2_callback_recv_impl_t;
-
-/** Interface to implementation conversion macro */
-#define AXIS2_INTF_TO_IMPL(callback_recv) ((axis2_callback_recv_impl_t *)callback_recv)
-
-
-axis2_msg_recv_t *AXIS2_CALL
-axis2_callback_recv_get_base(
-    const axis2_callback_recv_t *callback_recv,
-    const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_callback_recv_free(
-    axis2_callback_recv_t *callback_recv,
-    const axis2_env_t *env);
+};
 
-axis2_status_t AXIS2_CALL
-axis2_callback_recv_add_callback(
-    axis2_callback_recv_t *callback_recv,
-    const axis2_env_t *env,
-    const axis2_char_t *msg_id,
-    axis2_callback_t *callback);
-
-axis2_status_t AXIS2_CALL
+static axis2_status_t AXIS2_CALL
 axis2_callback_recv_receive(
     axis2_msg_recv_t *msg_recv,
     const axis2_env_t *env,
     axis2_msg_ctx_t *msg_ctx,
     void *callback_recv_param);
-
-axis2_callback_recv_t *AXIS2_CALL
+    
+AXIS2_EXTERN axis2_callback_recv_t *AXIS2_CALL
 axis2_callback_recv_create(
     const axis2_env_t *env)
 {
-    axis2_callback_recv_impl_t *callback_recv_impl = NULL;
+    axis2_callback_recv_t *callback_recv = NULL;
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    callback_recv_impl =
-        AXIS2_MALLOC(env->allocator, sizeof(axis2_callback_recv_impl_t));
+    callback_recv =
+        AXIS2_MALLOC(env->allocator, sizeof(axis2_callback_recv_t));
 
-    if (!callback_recv_impl)
+    if (!callback_recv)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
 
-    callback_recv_impl->callback_recv.ops = NULL;
-    callback_recv_impl->base = NULL;
-    callback_recv_impl->base_deep_copy = AXIS2_TRUE;
-    callback_recv_impl->callback_map = NULL;
-    callback_recv_impl->mutex = NULL;
+    callback_recv->base = NULL;
+    callback_recv->base_deep_copy = AXIS2_TRUE;
+    callback_recv->callback_map = NULL;
+    callback_recv->mutex = NULL;
 
-    callback_recv_impl->base = axis2_msg_recv_create(env);
-    if (!(callback_recv_impl->base))
+    callback_recv->base = axis2_msg_recv_create(env);
+    if (!(callback_recv->base))
     {
-        axis2_callback_recv_free(&(callback_recv_impl->callback_recv), env);
+        axis2_callback_recv_free(callback_recv, env);
         return NULL;
     }
-    callback_recv_impl->base->derived = callback_recv_impl;
-    callback_recv_impl->base->ops->receive = axis2_callback_recv_receive;
+    axis2_msg_recv_set_derived(callback_recv->base, env, callback_recv);
+    axis2_msg_recv_set_receive(callback_recv->base, env, axis2_callback_recv_receive);
 
-    callback_recv_impl->callback_map = axis2_hash_make(env);
-    if (!(callback_recv_impl->callback_map))
+    callback_recv->callback_map = axis2_hash_make(env);
+    if (!(callback_recv->callback_map))
     {
-        axis2_callback_recv_free(&(callback_recv_impl->callback_recv), env);
+        axis2_callback_recv_free(callback_recv, env);
         return NULL;
     }
 
-    callback_recv_impl->mutex = axis2_thread_mutex_create(env->allocator,
+    callback_recv->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));
-
-    if (!callback_recv_impl->callback_recv.ops)
-    {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        axis2_callback_recv_free(&(callback_recv_impl->callback_recv), env);
-        return NULL;
-    }
-
-    callback_recv_impl->callback_recv.ops->get_base =
-        axis2_callback_recv_get_base;
-    callback_recv_impl->callback_recv.ops->free =
-        axis2_callback_recv_free;
-    callback_recv_impl->callback_recv.ops->add_callback =
-        axis2_callback_recv_add_callback;
-
-    return &(callback_recv_impl->callback_recv);
+    return callback_recv;
 }
 
-axis2_msg_recv_t *AXIS2_CALL
+AXIS2_EXTERN axis2_msg_recv_t *AXIS2_CALL
 axis2_callback_recv_get_base(
-    const axis2_callback_recv_t *callback_recv,
+    axis2_callback_recv_t *callback_recv,
     const axis2_env_t *env)
 {
-    AXIS2_ENV_CHECK(env, NULL);
-    AXIS2_INTF_TO_IMPL(callback_recv)->base_deep_copy = AXIS2_FALSE;
-    return AXIS2_INTF_TO_IMPL(callback_recv)->base;
+    callback_recv->base_deep_copy = AXIS2_FALSE;
+    return callback_recv->base;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_callback_recv_free(
     axis2_callback_recv_t *callback_recv,
     const axis2_env_t *env)
 {
-    axis2_callback_recv_impl_t *callback_recv_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    callback_recv_impl = AXIS2_INTF_TO_IMPL(callback_recv);
-
-    if (callback_recv_impl->callback_recv.ops)
-    {
-        AXIS2_FREE(env->allocator, callback_recv_impl->callback_recv.ops);
-        callback_recv_impl->callback_recv.ops = NULL;
-    }
-    if(NULL != callback_recv_impl->mutex)
+    if(callback_recv->mutex)
     {
-        axis2_thread_mutex_destroy(callback_recv_impl->mutex);
-        callback_recv_impl->mutex = NULL;
+        axis2_thread_mutex_destroy(callback_recv->mutex);
     }
 
-    if (callback_recv_impl->callback_map)
+    if (callback_recv->callback_map)
     {
         axis2_hash_index_t *hi = NULL;
         const void *key = NULL;
         void *val = NULL;
-        for (hi = axis2_hash_first(callback_recv_impl->callback_map, env); hi;
+        for (hi = axis2_hash_first(callback_recv->callback_map, env); hi;
                 hi = axis2_hash_next(env, hi))
         {
             axis2_hash_this(hi, &key, NULL, &val);
             if (key)
                 AXIS2_FREE(env->allocator, (char*)key);
 
-            /*if (val)
-                AXIS2_FREE(env->allocator, val);
-            */
-            val = NULL;
         }
 
-        axis2_hash_free(callback_recv_impl->callback_map, env);
-        callback_recv_impl->callback_map = NULL;
+        axis2_hash_free(callback_recv->callback_map, env);
     }
 
-    if (callback_recv_impl->base && callback_recv_impl->base_deep_copy)
+    if (callback_recv->base && callback_recv->base_deep_copy)
     {
-        AXIS2_MSG_RECV_FREE(callback_recv_impl->base, env);
+        AXIS2_MSG_RECV_FREE(callback_recv->base, env);
     }
 
-    if (callback_recv_impl)
+    if (callback_recv)
     {
-        AXIS2_FREE(env->allocator, callback_recv_impl);
-        callback_recv_impl = NULL;
+        AXIS2_FREE(env->allocator, callback_recv);
     }
 
     return AXIS2_SUCCESS;
 }
 
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_callback_recv_add_callback(
     axis2_callback_recv_t *callback_recv,
     const axis2_env_t *env,
     const axis2_char_t *msg_id,
     axis2_callback_t *callback)
 {
-    axis2_callback_recv_impl_t *callback_recv_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    callback_recv_impl = AXIS2_INTF_TO_IMPL(callback_recv);
-
     if (msg_id)
     {
         axis2_char_t *mid = AXIS2_STRDUP(msg_id, env);
-        axis2_hash_set(callback_recv_impl->callback_map,
+        axis2_hash_set(callback_recv->callback_map,
                 mid, AXIS2_HASH_KEY_STRING, callback);
     }
     return AXIS2_SUCCESS;
 }
 
-axis2_status_t AXIS2_CALL
+static axis2_status_t AXIS2_CALL
 axis2_callback_recv_receive(
     axis2_msg_recv_t *msg_recv,
     const axis2_env_t *env,
     axis2_msg_ctx_t *msg_ctx,
     void *callback_recv_param)
 {
-    axis2_callback_recv_impl_t *callback_recv_impl = NULL;
+    axis2_callback_recv_t *callback_recv = NULL;
     axis2_relates_to_t *relates_to = NULL;
     axis2_msg_info_headers_t *msg_info_headers = NULL;
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    callback_recv_impl = AXIS2_INTF_TO_IMPL(msg_recv->derived);
-
+    callback_recv = axis2_msg_recv_get_derived(msg_recv, env);
+    
     msg_info_headers =  axis2_msg_ctx_get_msg_info_headers(msg_ctx, env);
     if (msg_info_headers)
     {
@@ -239,7 +175,7 @@
             {
                 axis2_async_result_t *result = NULL;
                 axis2_callback_t *callback = (axis2_callback_t*)
-                        axis2_hash_get(callback_recv_impl->callback_map, msg_id, AXIS2_HASH_KEY_STRING);
+                        axis2_hash_get(callback_recv->callback_map, msg_id, AXIS2_HASH_KEY_STRING);
 
                 result = axis2_async_result_create(env, msg_ctx);
                 if (callback && result)
@@ -258,3 +194,5 @@
 
     return AXIS2_FAILURE;
 }
+
+

Modified: webservices/axis2/trunk/c/modules/core/clientapi/listener_manager.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/clientapi/listener_manager.c?view=diff&rev=518623&r1=518622&r2=518623
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/listener_manager.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/listener_manager.c Thu Mar 15 06:16:07 2007
@@ -29,138 +29,72 @@
 
     axis2_transport_receiver_t *listener;
 
-}
-axis2_transport_listener_state_t;
+}axis2_transport_listener_state_t;
 
 
-typedef struct axis2_listener_manager_impl
+struct axis2_listener_manager
 {
-    /** context base struct */
-    axis2_listener_manager_t listener_manager;
     /** hash map of listeners */
     axis2_transport_listener_state_t *listener_map[AXIS2_TRANSPORT_ENUM_MAX];
     /** configuration context */
     axis2_conf_ctx_t *conf_ctx;
-}
-axis2_listener_manager_impl_t;
-
+};
 
 typedef struct axis2_listener_manager_worker_func_args
 {
     const axis2_env_t *env;
-    axis2_listener_manager_impl_t *listner_manager;
+    axis2_listener_manager_t *listner_manager;
     axis2_transport_receiver_t *listener;
-}
-axis2_listener_manager_worker_func_args_t;
+}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)
-
-
-axis2_status_t AXIS2_CALL
-axis2_listener_manager_make_sure_started(
-    axis2_listener_manager_t *listener_manager,
-    const axis2_env_t *env,
-    const AXIS2_TRANSPORT_ENUMS transport,
-    axis2_conf_ctx_t *conf_ctx);
-
-axis2_status_t AXIS2_CALL
-axis2_listener_manager_stop(
-    axis2_listener_manager_t *listener_manager,
-    const axis2_env_t *env,
-    const AXIS2_TRANSPORT_ENUMS transport);
-
-axis2_endpoint_ref_t *AXIS2_CALL
-axis2_listener_manager_get_reply_to_epr(
-    const axis2_listener_manager_t *listener_manager,
-    const axis2_env_t *env,
-    const axis2_char_t *svc_name,
-    const AXIS2_TRANSPORT_ENUMS transport);
-
-axis2_status_t AXIS2_CALL
-axis2_listener_manager_free(
-    axis2_listener_manager_t *listener_manager,
-    const axis2_env_t *env);
-
-axis2_conf_ctx_t *AXIS2_CALL
-axis2_listener_manager_get_conf_ctx(
-    const axis2_listener_manager_t *listener_manager,
-    const axis2_env_t *env);
-
-axis2_listener_manager_t *AXIS2_CALL
+AXIS2_EXTERN axis2_listener_manager_t *AXIS2_CALL
 axis2_listener_manager_create(
     const axis2_env_t *env)
 {
-    axis2_listener_manager_impl_t *listener_manager_impl = NULL;
+    axis2_listener_manager_t *listener_manager = NULL;
     int i = 0;
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    listener_manager_impl =
-        AXIS2_MALLOC(env->allocator, sizeof(axis2_listener_manager_impl_t));
+    listener_manager =
+        AXIS2_MALLOC(env->allocator, sizeof(axis2_listener_manager_t));
 
-    if (!listener_manager_impl)
+    if (!listener_manager)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
 
-    listener_manager_impl->listener_manager.ops = NULL;
-    listener_manager_impl->conf_ctx = NULL;
+    listener_manager->conf_ctx = NULL;
     
     for (i = 0; i < AXIS2_TRANSPORT_ENUM_MAX; i++)
     {
-        listener_manager_impl->listener_map[i] = NULL;
+        listener_manager->listener_map[i] = NULL;
     }
 
-    /* initialize ops */
-    listener_manager_impl->listener_manager.ops =
-        AXIS2_MALLOC(env->allocator, sizeof(axis2_listener_manager_ops_t));
-
-    if (!listener_manager_impl->listener_manager.ops)
-    {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        axis2_listener_manager_free(&(listener_manager_impl->listener_manager), env);
-        return NULL;
-    }
-
-    listener_manager_impl->listener_manager.ops->make_sure_started =
-        axis2_listener_manager_make_sure_started;
-    listener_manager_impl->listener_manager.ops->stop =
-        axis2_listener_manager_stop;
-    listener_manager_impl->listener_manager.ops->get_reply_to_epr =
-        axis2_listener_manager_get_reply_to_epr;
-    listener_manager_impl->listener_manager.ops->get_conf_ctx =
-        axis2_listener_manager_get_conf_ctx;
-    listener_manager_impl->listener_manager.ops->free =
-        axis2_listener_manager_free;
-
-    return &(listener_manager_impl->listener_manager);
+    return listener_manager;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_listener_manager_make_sure_started(
     axis2_listener_manager_t *listener_manager,
     const axis2_env_t *env,
     const AXIS2_TRANSPORT_ENUMS transport,
     axis2_conf_ctx_t *conf_ctx)
 {
-    axis2_listener_manager_impl_t *listener_manager_impl = NULL;
     axis2_transport_listener_state_t *tl_state = NULL;
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, conf_ctx, AXIS2_FAILURE);
 
-    listener_manager_impl = AXIS2_INTF_TO_IMPL(listener_manager);
-
-    if (listener_manager_impl->conf_ctx)
+    if (listener_manager->conf_ctx)
     {
-        if (conf_ctx != listener_manager_impl->conf_ctx)
+        if (conf_ctx != listener_manager->conf_ctx)
         {
             AXIS2_ERROR_SET(env->error,
                     AXIS2_ERROR_CLIENT_SIDE_SUPPORT_ONLY_ONE_CONF_CTX, AXIS2_FAILURE);
@@ -169,11 +103,11 @@
     }
     else
     {
-        listener_manager_impl->conf_ctx = conf_ctx;
+        listener_manager->conf_ctx = conf_ctx;
     }
 
 
-    tl_state = listener_manager_impl->listener_map[transport];
+    tl_state = listener_manager->listener_map[transport];
 
     if (!tl_state)
     {
@@ -200,7 +134,7 @@
                         return AXIS2_FAILURE;
                     }
                     arg_list->env = env;
-                    arg_list->listner_manager = listener_manager_impl;
+                    arg_list->listner_manager = listener_manager;
                     arg_list->listener = listener;
 #ifdef AXIS2_SVR_MULTI_THREADED
                     if (env->thread_pool)
@@ -239,7 +173,7 @@
                     {
                         tl_state->listener = listener;
                         tl_state->waiting_calls = 0;
-                        listener_manager_impl->listener_map[transport] = tl_state;
+                        listener_manager->listener_map[transport] = tl_state;
                     }
                 }
             }
@@ -255,21 +189,18 @@
         return AXIS2_FAILURE;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_listener_manager_stop(
     axis2_listener_manager_t *listener_manager,
     const axis2_env_t *env,
     const AXIS2_TRANSPORT_ENUMS transport)
 {
-    axis2_listener_manager_impl_t *listener_manager_impl = NULL;
     axis2_transport_listener_state_t *tl_state = NULL;
     axis2_status_t status = AXIS2_FAILURE;
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    listener_manager_impl = AXIS2_INTF_TO_IMPL(listener_manager);
-
-    tl_state = listener_manager_impl->listener_map[transport];
+    tl_state = listener_manager->listener_map[transport];
 
     if (tl_state)
     {
@@ -280,28 +211,25 @@
             if (status != AXIS2_SUCCESS)
                 return status;
 
-            listener_manager_impl->listener_map[transport] = NULL;
+            listener_manager->listener_map[transport] = NULL;
         }
     }
 
     return status;
 }
 
-axis2_endpoint_ref_t *AXIS2_CALL
+AXIS2_EXTERN axis2_endpoint_ref_t *AXIS2_CALL
 axis2_listener_manager_get_reply_to_epr(
     const axis2_listener_manager_t *listener_manager,
     const axis2_env_t *env,
     const axis2_char_t *svc_name,
     const AXIS2_TRANSPORT_ENUMS transport)
 {
-    axis2_listener_manager_impl_t *listener_manager_impl = NULL;
     axis2_transport_listener_state_t *tl_state = NULL;
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    listener_manager_impl = AXIS2_INTF_TO_IMPL(listener_manager);
-
-    tl_state = listener_manager_impl->listener_map[transport];
+    tl_state = listener_manager->listener_map[transport];
     if (tl_state)
     {
         return AXIS2_TRANSPORT_RECEIVER_GET_REPLY_TO_EPR(tl_state->listener, env, svc_name);
@@ -309,43 +237,32 @@
     return NULL;
 }
 
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_listener_manager_free(
     axis2_listener_manager_t *listener_manager,
     const axis2_env_t *env)
 {
-    axis2_listener_manager_impl_t *listener_manager_impl = NULL;
     int i = 0;
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    listener_manager_impl = AXIS2_INTF_TO_IMPL(listener_manager);
-
-    if (listener_manager_impl->listener_manager.ops)
-    {
-        AXIS2_FREE(env->allocator, listener_manager_impl->listener_manager.ops);
-        listener_manager_impl->listener_manager.ops = NULL;
-    }
-
     for (i = 0; i < AXIS2_TRANSPORT_ENUM_MAX; i++)
     {
-        if (listener_manager_impl->listener_map[i])
-            AXIS2_FREE(env->allocator, listener_manager_impl->listener_map[i]);
+        if (listener_manager->listener_map[i])
+            AXIS2_FREE(env->allocator, listener_manager->listener_map[i]);
     }
 
-    AXIS2_FREE(env->allocator, listener_manager_impl);
-    listener_manager_impl = NULL;
+    AXIS2_FREE(env->allocator, listener_manager);
 
     return AXIS2_SUCCESS;
 }
 
-axis2_conf_ctx_t *AXIS2_CALL
+AXIS2_EXTERN axis2_conf_ctx_t *AXIS2_CALL
 axis2_listener_manager_get_conf_ctx(
     const axis2_listener_manager_t *listener_manager,
     const axis2_env_t *env)
 {
-    AXIS2_ENV_CHECK(env, NULL);
-    return AXIS2_INTF_TO_IMPL(listener_manager)->conf_ctx;
+    return listener_manager->conf_ctx;
 }
 
 void *AXIS2_THREAD_FUNC
@@ -368,3 +285,5 @@
     }
     return NULL;
 }
+
+



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


Mime
View raw message