You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by da...@apache.org on 2006/02/06 03:05:21 UTC
svn commit: r375153 - in /webservices/axis2/trunk/c: include/
modules/core/deployment/ modules/core/description/ modules/core/engine/
modules/core/receivers/ modules/util/
Author: damitha
Date: Sun Feb 5 18:05:19 2006
New Revision: 375153
URL: http://svn.apache.org/viewcvs?rev=375153&view=rev
Log:
Added asynchronous support to msg_recv. This will be completed
once the threading is available.
Fixed some memory leaks in deployment module
Added:
webservices/axis2/trunk/c/include/axis2_svr_callback.h
webservices/axis2/trunk/c/modules/core/receivers/svr_callback.c
Modified:
webservices/axis2/trunk/c/include/axis2_dep_engine.h
webservices/axis2/trunk/c/include/axis2_msg_recv.h
webservices/axis2/trunk/c/modules/core/deployment/arch_file_data.c
webservices/axis2/trunk/c/modules/core/deployment/conf_builder.c
webservices/axis2/trunk/c/modules/core/deployment/conf_init.c
webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c
webservices/axis2/trunk/c/modules/core/deployment/desc_builder.c
webservices/axis2/trunk/c/modules/core/deployment/repos_listener.c
webservices/axis2/trunk/c/modules/core/deployment/ws_info_list.c
webservices/axis2/trunk/c/modules/core/description/transport_in_desc.c
webservices/axis2/trunk/c/modules/core/description/transport_out_desc.c
webservices/axis2/trunk/c/modules/core/engine/conf.c
webservices/axis2/trunk/c/modules/core/receivers/Makefile.am
webservices/axis2/trunk/c/modules/core/receivers/msg_recv.c
webservices/axis2/trunk/c/modules/core/receivers/raw_xml_in_out_msg_recv.c
webservices/axis2/trunk/c/modules/util/dir_handler.c
Modified: webservices/axis2/trunk/c/include/axis2_dep_engine.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_dep_engine.h?rev=375153&r1=375152&r2=375153&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_dep_engine.h (original)
+++ webservices/axis2/trunk/c/include/axis2_dep_engine.h Sun Feb 5 18:05:19 2006
@@ -267,12 +267,6 @@
#define AXIS2_DEP_ENGINE_GET_HANDLER_DLL(dep_engine, env, dll_name) \
((dep_engine)->ops->get_handler_dll (dep_engine, env, dll_name))
-#define AXIS2_DEP_ENGINE_DO_DEPLOY(dep_engine, env) \
- ((dep_engine)->ops->do_deploy (dep_engine, env))
-
-#define AXIS2_DEP_ENGINE_UNDEPLOY(dep_engine, env) \
- ((dep_engine)->ops->undeploy (dep_engine, env))
-
#define AXIS2_DEP_ENGINE_IS_HOT_UPDATE(dep_engine, env) \
((dep_engine)->ops->is_hot_update (dep_engine, env))
Modified: webservices/axis2/trunk/c/include/axis2_msg_recv.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_msg_recv.h?rev=375153&r1=375152&r2=375153&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_msg_recv.h (original)
+++ webservices/axis2/trunk/c/include/axis2_msg_recv.h Sun Feb 5 18:05:19 2006
@@ -19,7 +19,8 @@
/**
* @file axis2_msg_recv.h
- * @brief axis Message Receiver interface
+ * @brief Axis Message Receiver interface. Message Receiver struct.
+ * This interface is extended by custom message receivers
*/
#ifdef __cplusplus
@@ -28,7 +29,7 @@
#endif
/** @defgroup axis2_msg_recv Message Receiver
- * @ingroup axis2_core_engine
+ * @ingroup axis2_core_receivers
* @{
*/
@@ -37,6 +38,7 @@
#include <axis2_svc_skeleton.h>
#include <axis2_msg_ctx.h>
#include <axis2_op_ctx.h>
+#include <axis2_svr_callback.h>
#define AXIS2_SUCCESS 1
#define AXIS2_FAILURE 0
@@ -46,7 +48,7 @@
typedef struct axis2_msg_recv_ops axis2_msg_recv_ops_t;
/**
- * @brief Message Receiver ops struct
+ * @brief Message Receiver ops struct.
* Encapsulator struct for ops of axis2_msg_recv
*/
struct axis2_msg_recv_ops
@@ -59,27 +61,95 @@
free) (axis2_msg_recv_t *msg_recv,
axis2_env_t **env);
+ /**
+ * This method is called from axis2_engine_receive method. This method's
+ * actual implementation is decided from the create method of the
+ * extended message receiver object. There depending on the synchronous or
+ * asynchronous type, receive metho is assigned with the synchronous or
+ * asynchronous implementation of receive.
+ * @see raw_xml_in_out_msg_recv_create method where receive is assigned
+ * to receive_sync
+ * @ param in_msg_ctx
+ * @return status code
+ */
axis2_status_t (AXIS2_CALL *
receive) (axis2_msg_recv_t *msg_recv,
axis2_env_t **env,
struct axis2_msg_ctx *in_msg_ctx);
+
+ /**
+ * This contain synchronous receiving logic.
+ * @param in_msg_ctx
+ * @return status code
+ */
+ axis2_status_t (AXIS2_CALL *
+ receive_sync) (axis2_msg_recv_t *msg_recv,
+ axis2_env_t **env,
+ struct axis2_msg_ctx *in_msg_ctx);
+
+ /**
+ * This contain asynchronous receiving logic.
+ * @param in_msg_ctx
+ * @return status code
+ */
+ axis2_status_t (AXIS2_CALL *
+ receive_async) (axis2_msg_recv_t *msg_recv,
+ axis2_env_t **env,
+ struct axis2_msg_ctx *in_msg_ctx);
+ /**
+ * This contain in only synchronous business invoke logic
+ * @param in_msg_ctx
+ * @return status code
+ */
axis2_status_t (AXIS2_CALL *
- invoke_in_business_logic) (axis2_msg_recv_t *msg_recv,
+ invoke_in_business_logic_sync) (axis2_msg_recv_t *msg_recv,
axis2_env_t **env,
struct axis2_msg_ctx *in_msg_ctx);
+
+ /**
+ * This contain in only asynchronous business invoke logic
+ * @param in_msg_ctx
+ * @param svr_callback
+ * @return status code
+ */
+ axis2_status_t (AXIS2_CALL *
+ invoke_in_business_logic_async) (axis2_msg_recv_t *msg_recv,
+ axis2_env_t **env,
+ struct axis2_msg_ctx *in_msg_ctx,
+ struct axis2_svr_callback *svr_callback);
+
+ /**
+ * This contain in out synchronous business invoke logic
+ * @param in_msg_ctx
+ * @param out_msg_ctx
+ * @return status code
+ */
axis2_status_t (AXIS2_CALL *
- invoke_in_out_business_logic) (axis2_msg_recv_t *msg_recv,
+ invoke_in_out_business_logic_sync) (axis2_msg_recv_t *msg_recv,
axis2_env_t **env,
struct axis2_msg_ctx *in_msg_ctx,
struct axis2_msg_ctx *out_msg_ctx);
+ /**
+ * This contain in out asynchronous business invoke logic
+ * @param in_msg_ctx
+ * @param out_msg_ctx
+ * @param callback
+ * @return status code
+ */
+ axis2_status_t (AXIS2_CALL *
+ invoke_in_out_business_logic_async) (axis2_msg_recv_t *msg_recv,
+ axis2_env_t **env,
+ struct axis2_msg_ctx *in_msg_ctx,
+ struct axis2_msg_ctx *out_msg_ctx,
+ struct axis2_svr_callback *callback);
+
/**
- * Method makeNewServiceObject
- *
- * @param msgContext
- * @return
+ * this will create a new service skeleton object
+ * @param msg_ctx
+ * @return service skeleton object
*/
axis2_svc_skeleton_t * (AXIS2_CALL *
make_new_svc_obj) (axis2_msg_recv_t *msg_recv,
@@ -87,26 +157,40 @@
struct axis2_msg_ctx *msg_ctx);
/**
- * Method getTheImplementationObject
- *
- * @param msgContext
- * @return
+ * This will return the service skeleton object
+ * @param msg_ctx
+ * @return service skeleton object
*/
axis2_svc_skeleton_t * (AXIS2_CALL *
get_impl_obj) (axis2_msg_recv_t *msg_recv,
axis2_env_t **env,
struct axis2_msg_ctx *msg_ctx);
+ /**
+ * Set the application scope
+ * @param scope
+ * @return status code
+ */
axis2_status_t (AXIS2_CALL *
set_scope) (axis2_msg_recv_t *msg_recv,
axis2_env_t **env,
axis2_char_t *scope);
-
+
+ /**
+ * Get the application scope
+ * @param scope
+ * @return scope
+ */
axis2_char_t * (AXIS2_CALL *
get_scope) (axis2_msg_recv_t *msg_recv,
axis2_env_t **env);
-
+
+ /**
+ * Delete the service skeleton object created by make_new_svc_obj
+ * @param msg_ctx
+ * @return status code
+ */
axis2_status_t (AXIS2_CALL *
delete_svc_obj) (axis2_msg_recv_t *msg_recv,
axis2_env_t **env,
@@ -114,16 +198,24 @@
};
/**
- * @brief Message Receiver struct
- * Axis2 Message Receiver
- */
+ * @brief Message Receiver struct.
+ * This is the base message receiver struct extended by other message receiver
+ * structs.
+ * @see axis2_raw_xml_in_out_msg_recv struct
+ */
struct axis2_msg_recv
{
axis2_msg_recv_ops_t *ops;
};
+/**
+ * Create new message receiver object. usually this will be called from the
+ * extended message receiver object.
+ * @see create method of raw_xml_in_out_msg_recv
+ * @return newly created message receiver object
+ **/
AXIS2_DECLARE(axis2_msg_recv_t *)
-axis2_msg_recv_create ();
+axis2_msg_recv_create (axis2_env_t **env);
/************************** Start of function macros **************************/
@@ -132,12 +224,29 @@
#define AXIS2_MSG_RECV_RECEIVE(msg_recv, env, msg_ctx) \
((msg_recv)->ops->receive (msg_recv, env, msg_ctx))
-#define AXIS2_MSG_RECV_INVOKE_IN_BUSINESS_LOGIC(msg_recv, env, in_msg_ctx) \
- ((msg_recv)->ops->invoke_in_business_logic(msg_recv, env, in_msg_ctx))
+#define AXIS2_MSG_RECV_RECEIVE_SYNC(msg_recv, env, msg_ctx) \
+ ((msg_recv)->ops->receive_sync (msg_recv, env, msg_ctx))
+
+#define AXIS2_MSG_RECV_RECEIVE_ASYNC(msg_recv, env, msg_ctx) \
+ ((msg_recv)->ops->receive_async (msg_recv, env, msg_ctx))
-#define AXIS2_MSG_RECV_INVOKE_IN_OUT_BUSINESS_LOGIC(msg_recv, env, in_msg_ctx, \
- out_msg_ctx) ((msg_recv)->ops->invoke_in_out_business_logic(msg_recv, \
- env, in_msg_ctx, out_msg_ctx))
+#define AXIS2_MSG_RECV_INVOKE_IN_BUSINESS_LOGIC_SYNC(msg_recv, env, in_msg_ctx) \
+ ((msg_recv)->ops->invoke_in_business_logic_sync(msg_recv, env, in_msg_ctx))
+
+#define AXIS2_MSG_RECV_INVOKE_IN_BUSINESS_LOGIC_ASYNC(msg_recv, env, \
+ in_msg_ctx, callback) \
+ ((msg_recv)->ops->invoke_in_business_logic_async(msg_recv, env, \
+ in_msg_ctx, callback))
+
+#define AXIS2_MSG_RECV_INVOKE_IN_OUT_BUSINESS_LOGIC_SYNC(msg_recv, env, \
+ in_msg_ctx, out_msg_ctx) \
+ ((msg_recv)->ops->invoke_in_out_business_logic_sync (msg_recv, env, \
+ in_msg_ctx, out_msg_ctx))
+
+#define AXIS2_MSG_RECV_INVOKE_IN_OUT_BUSINESS_LOGIC_ASYNC(msg_recv, env, \
+ in_msg_ctx, out_msg_ctx, callback) \
+ ((msg_recv)->ops->invoke_in_out_business_logic_async(msg_recv, env, \
+ in_msg_ctx, out_msg_ctx, callback))
#define AXIS2_MSG_RECV_MAKE_NEW_SVC_OBJ(msg_recv, env, msg_ctx) \
((msg_recv)->ops->make_new_svc_obj(msg_recv, env, msg_ctx))
@@ -161,4 +270,4 @@
}
#endif
-#endif /* AXIS2_MSG_RECV_H */
+#endif /* AXIS2_MSG_RECV_H */
Added: webservices/axis2/trunk/c/include/axis2_svr_callback.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_svr_callback.h?rev=375153&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_svr_callback.h (added)
+++ webservices/axis2/trunk/c/include/axis2_svr_callback.h Sun Feb 5 18:05:19 2006
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_SVR_CALLBACK_H
+#define AXIS2_SVR_CALLBACK_H
+
+/**
+ * @file axis2_svr_callback.h
+ * @brief axis Server Callback interface
+ */
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** @defgroup axis2_svr_callback Server Callback
+ * @ingroup axis2_core_receivers
+ * @{
+ */
+
+#include <axis2_defines.h>
+#include <axis2.h>
+#include <axis2_msg_ctx.h>
+
+typedef struct axis2_svr_callback axis2_svr_callback_t;
+typedef struct axis2_svr_callback_ops axis2_svr_callback_ops_t;
+
+/**
+ * @brief Message Receiver ops struct
+ * Encapsulator struct for ops of axis2_svr_callback
+ */
+struct axis2_svr_callback_ops
+{
+ /**
+ * Deallocate memory
+ * @return status code
+ */
+ axis2_status_t (AXIS2_CALL *
+ free) (axis2_svr_callback_t *svr_callback,
+ axis2_env_t **env);
+
+ /**
+ * Handle result
+ * @param msg_ctx
+ * @return status code
+ */
+ axis2_status_t (AXIS2_CALL *
+ handle_result) (axis2_svr_callback_t *svr_callback,
+ axis2_env_t **env,
+ axis2_msg_ctx_t *msg_ctx);
+
+ /**
+ * Handle fault
+ * @param msg_ctx
+ * @return status code
+ */
+ axis2_status_t (AXIS2_CALL *
+ handle_fault) (axis2_svr_callback_t *svr_callback,
+ axis2_env_t **env,
+ axis2_msg_ctx_t *msg_ctx);
+};
+
+/**
+ * @brief Server Callback struct
+ * Axis2 Server Callback
+ */
+struct axis2_svr_callback
+{
+ axis2_svr_callback_ops_t *ops;
+};
+
+/**
+ * Create Server Callback struct
+ * @return newly created server callback object
+ */
+AXIS2_DECLARE(axis2_svr_callback_t *)
+axis2_svr_callback_create (axis2_env_t **env);
+
+/************************** Start of function macros **************************/
+
+#define AXIS2_SVR_CALLBACK_FREE(svr_callback, env) \
+ ((svr_callback)->ops->free (svr_callback, env))
+
+#define AXIS2_SVR_CALLBACK_HANDLER_RESULT(svr_callback, env, msg_ctx) \
+ ((svr_callback)->ops->handle_result (svr_callback, env, msg_ctx))
+
+#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 ****************************/
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* AXIS2_SVR_CALLBACK_H */
Modified: webservices/axis2/trunk/c/modules/core/deployment/arch_file_data.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/arch_file_data.c?rev=375153&r1=375152&r2=375153&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/arch_file_data.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/arch_file_data.c Sun Feb 5 18:05:19 2006
@@ -136,7 +136,7 @@
arch_file_data_impl->deployable_svcs = NULL;
arch_file_data_impl->arch_file_data.ops = NULL;
- arch_file_data_impl->deployable_svcs = axis2_array_list_create(env, 20);
+ arch_file_data_impl->deployable_svcs = axis2_array_list_create(env, 0);
if(!arch_file_data_impl->deployable_svcs)
{
axis2_arch_file_data_free(&(arch_file_data_impl->arch_file_data), env);
Modified: webservices/axis2/trunk/c/modules/core/deployment/conf_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/conf_builder.c?rev=375153&r1=375152&r2=375153&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/conf_builder.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/conf_builder.c Sun Feb 5 18:05:19 2006
@@ -684,6 +684,8 @@
impl_info_param = axis2_param_create(env, NULL, NULL);
AXIS2_PARAM_SET_VALUE(impl_info_param, env, dll_desc);
+ impl_info_param->ops->value_free =
+ axis2_dll_desc_as_param_value_free;
transport_sender = (axis2_transport_sender_t *)
axis2_class_loader_create_dll(env, impl_info_param);
AXIS2_TRANSPORT_OUT_DESC_SET_SENDER(transport_out, env,
@@ -786,13 +788,14 @@
qattname = axis2_qname_create(env, AXIS2_ATTNAME, NULL, NULL);
trs_name = AXIS2_OM_ELEMENT_GET_ATTRIBUTE(transport_element, env,
qattname);
+ AXIS2_QNAME_FREE(qattname, env);
if(NULL != trs_name)
{
axis2_char_t *name = NULL;
axis2_om_attribute_t *trs_dll_name = NULL;
axis2_om_children_qname_iterator_t *itr = NULL;
- axis2_qname_t *qname = NULL;
+ axis2_qname_t *transport_in_desc_qname = NULL;
axis2_qname_t *qdllname = NULL;
axis2_qname_t *qparamst = NULL;
axis2_qname_t *qinflowst = NULL;
@@ -810,13 +813,16 @@
name = AXIS2_OM_ATTRIBUTE_GET_VALUE(trs_name, env);
- qname = axis2_qname_create(env, name, NULL, NULL);
- transport_in = axis2_transport_in_desc_create_with_qname(env, qname);
+ transport_in_desc_qname = axis2_qname_create(env, name, NULL, NULL);
+ transport_in = axis2_transport_in_desc_create_with_qname(env,
+ transport_in_desc_qname);
+ AXIS2_QNAME_FREE(transport_in_desc_qname, env);
/* transport impl class */
qdllname = axis2_qname_create(env, AXIS2_CLASSNAME, NULL, NULL);
trs_dll_name = AXIS2_OM_ELEMENT_GET_ATTRIBUTE(transport_element, env,
qdllname);
+ AXIS2_QNAME_FREE(qdllname, env);
if(NULL != trs_dll_name)
{
@@ -834,6 +840,8 @@
impl_info_param = axis2_param_create(env, NULL, NULL);
AXIS2_PARAM_SET_VALUE(impl_info_param, env, dll_desc);
+ impl_info_param->ops->value_free =
+ axis2_dll_desc_as_param_value_free;
recv = (axis2_transport_receiver_t *)
axis2_class_loader_create_dll(env, impl_info_param);
stat = AXIS2_TRANSPORT_IN_DESC_SET_RECV(transport_in, env,
@@ -846,6 +854,7 @@
qparamst = axis2_qname_create(env, AXIS2_PARAMETERST, NULL, NULL);
itr = AXIS2_OM_ELEMENT_GET_CHILDREN_WITH_QNAME(transport_element,
env, qparamst, transport_node);
+ AXIS2_QNAME_FREE(qparamst, env);
AXIS2_DESC_BUILDER_PROCESS_PARAMS(conf_builder->desc_builder, env,
itr, transport_in->param_container,
builder_impl->conf->param_container);
@@ -854,6 +863,7 @@
qinflowst = axis2_qname_create(env, AXIS2_INFLOWST, NULL, NULL);
in_flow_element = AXIS2_OM_ELEMENT_GET_FIRST_CHILD_WITH_QNAME(
transport_element, env, qinflowst, transport_node, &in_flow_node);
+ AXIS2_QNAME_FREE(qinflowst, env);
if(NULL != in_flow_element)
{
AXIS2_ERROR_SET((*env)->error,
@@ -864,6 +874,7 @@
qoutflowst = axis2_qname_create(env, AXIS2_OUTFLOWST, NULL, NULL);
out_flow_element = AXIS2_OM_ELEMENT_GET_FIRST_CHILD_WITH_QNAME(
transport_element, env, qoutflowst, transport_node, &out_flow_node);
+ AXIS2_QNAME_FREE(qoutflowst, env);
if(NULL != out_flow_element)
{
axis2_flow_t *flow = NULL;
@@ -879,6 +890,7 @@
in_fault_flow_element = AXIS2_OM_ELEMENT_GET_FIRST_CHILD_WITH_QNAME(
transport_element, env, qinfaultflowst, transport_node,
&in_fault_flow_node);
+ AXIS2_QNAME_FREE(qinfaultflowst, env);
if(NULL != in_fault_flow_element)
{
axis2_flow_t *flow = NULL;
@@ -904,16 +916,9 @@
/* adding to axis config */
AXIS2_CONF_ADD_TRANSPORT_IN(builder_impl->conf, env, transport_in);
- AXIS2_QNAME_FREE(qname, env);
- AXIS2_QNAME_FREE(qdllname, env);
- AXIS2_QNAME_FREE(qparamst, env);
- AXIS2_QNAME_FREE(qinflowst, env);
- AXIS2_QNAME_FREE(qoutflowst, env);
- AXIS2_QNAME_FREE(qinfaultflowst, env);
AXIS2_QNAME_FREE(qoutfaultflowst, env);
}
- AXIS2_QNAME_FREE(qattname, env);
}
return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/modules/core/deployment/conf_init.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/conf_init.c?rev=375153&r1=375152&r2=375153&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/conf_init.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/conf_init.c Sun Feb 5 18:05:19 2006
@@ -76,6 +76,7 @@
}
conf = AXIS2_DEP_ENGINE_LOAD_CLIENT(dep_engine, env, axis2_home);
+ AXIS2_DEP_ENGINE_FREE(dep_engine, env);
if (!conf)
{
return NULL;
Modified: webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c?rev=375153&r1=375152&r2=375153&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c Sun Feb 5 18:05:19 2006
@@ -463,11 +463,35 @@
}
if(engine_impl->ws_to_deploy)
{
+ int i = 0;
+ int size = 0;
+
+ size = AXIS2_ARRAY_LIST_SIZE(engine_impl->ws_to_deploy, env);
+ for(i = 0; i < size; i++)
+ {
+ axis2_arch_file_data_t *file_data = NULL;
+
+ file_data = (axis2_arch_file_data_t *)
+ AXIS2_ARRAY_LIST_GET(engine_impl->ws_to_deploy, env, i);
+ AXIS2_ARCH_FILE_DATA_FREE(file_data, env);
+ }
AXIS2_ARRAY_LIST_FREE(engine_impl->ws_to_deploy, env);
engine_impl->ws_to_deploy = NULL;
}
if(engine_impl->ws_to_undeploy)
{
+ int i = 0;
+ int size = 0;
+
+ size = AXIS2_ARRAY_LIST_SIZE(engine_impl->ws_to_undeploy, env);
+ for(i = 0; i < size; i++)
+ {
+ axis2_arch_file_data_t *file_data = NULL;
+
+ file_data = (axis2_arch_file_data_t *)
+ AXIS2_ARRAY_LIST_GET(engine_impl->ws_to_undeploy, env, i);
+ AXIS2_ARCH_FILE_DATA_FREE(file_data, env);
+ }
AXIS2_ARRAY_LIST_FREE(engine_impl->ws_to_undeploy, env);
engine_impl->ws_to_undeploy = NULL;
}
@@ -568,7 +592,7 @@
axis2_arch_file_data_t *file)
{
axis2_dep_engine_impl_t *dep_engine_impl = NULL;
- AXIS2_FUNC_PARAM_CHECK(dep_engine, env, AXIS2_FAILURE);
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, file, AXIS2_FAILURE);
dep_engine_impl = AXIS2_INTF_TO_IMPL(dep_engine);
@@ -1352,7 +1376,6 @@
}
}
}
- AXIS2_ARRAY_LIST_FREE(engine_impl->ws_to_deploy, env);
return AXIS2_SUCCESS;
}
@@ -1388,8 +1411,7 @@
svc_name = axis2_dep_engine_get_axis_svc_name(dep_engine, env,
file_name);
- /* todo */
- /* axisConfig.removeService(new QName(serviceName)); */
+ AXIS2_CONF_REMOVE_SVC(engine_impl->conf, env, svc_name);
/*log.info(Messages.getMessage(DeploymentErrorMsgs.SERVICE_REMOVED,
wsInfo.getFilename()));*/
}
Modified: webservices/axis2/trunk/c/modules/core/deployment/desc_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/desc_builder.c?rev=375153&r1=375152&r2=375153&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/desc_builder.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/desc_builder.c Sun Feb 5 18:05:19 2006
@@ -223,12 +223,12 @@
desc_builder_impl = AXIS2_INTF_TO_IMPL(desc_builder);
- if(!desc_builder_impl->file_name)
+ if(desc_builder_impl->file_name)
{
AXIS2_FREE((*env)->allocator, desc_builder_impl->file_name);
desc_builder_impl->file_name = NULL;
}
- /* we should not free deployment engine here */
+ /* we cannot free deployment engine here */
desc_builder->engine = NULL;
if(NULL != desc_builder->ops)
@@ -679,6 +679,7 @@
att_locked = axis2_qname_create(env, AXIS2_ATTLOCKED, NULL, NULL);
para_locked = AXIS2_OM_ELEMENT_GET_ATTRIBUTE(param_element, env,
att_locked);
+ AXIS2_QNAME_FREE(att_locked, env);
if(NULL != parent)
{
parent_para = AXIS2_PARAM_CONTAINER_GET_PARAM(parent, env,
Modified: webservices/axis2/trunk/c/modules/core/deployment/repos_listener.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/repos_listener.c?rev=375153&r1=375152&r2=375153&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/repos_listener.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/repos_listener.c Sun Feb 5 18:05:19 2006
@@ -196,6 +196,12 @@
listener_impl->folder_name = NULL;
}
+ if(listener_impl->info_list)
+ {
+ AXIS2_WS_INFO_LIST_FREE(listener_impl->info_list, env);
+ listener_impl->info_list = NULL;
+ }
+
if(NULL != repos_listener->ops)
{
AXIS2_FREE((*env)->allocator, repos_listener->ops);
@@ -308,6 +314,7 @@
int size = 0;
int i = 0;
axis2_array_list_t *current_info_list = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
AXIS2_FUNC_PARAM_CHECK(listener, env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, folder_name, AXIS2_FAILURE);
@@ -323,8 +330,36 @@
{
axis2_file_t *file = NULL;
file = AXIS2_ARRAY_LIST_GET(current_info_list, env, i);
- AXIS2_WS_INFO_LIST_ADD_WS_INFO_ITEM(listener_impl->info_list, env,
+ status = AXIS2_WS_INFO_LIST_ADD_WS_INFO_ITEM(listener_impl->info_list, env,
file, type);
+ if(AXIS2_SUCCESS != status)
+ {
+ int size_j = NULL;
+ int j = 0;
+
+ size_j = AXIS2_ARRAY_LIST_SIZE(current_info_list, env);
+ for(j = 0; j < size_j; j++)
+ {
+ axis2_file_t *del_file = NULL;
+
+ del_file = AXIS2_ARRAY_LIST_GET(current_info_list, env, j);
+ AXIS2_FILE_FREE(del_file, env);
+ }
+ AXIS2_ARRAY_LIST_FREE(current_info_list, env);
+ current_info_list = NULL;
+ return status;
+ }
+ }
+
+ size = AXIS2_ARRAY_LIST_SIZE(current_info_list, env);
+ for(i = 0; i < size; i++)
+ {
+ axis2_file_t *del_file = NULL;
+
+ del_file = AXIS2_ARRAY_LIST_GET(current_info_list, env, i);
+ AXIS2_FILE_FREE(del_file, env);
}
+ AXIS2_ARRAY_LIST_FREE(current_info_list, env);
+ current_info_list = NULL;
return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/modules/core/deployment/ws_info_list.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/ws_info_list.c?rev=375153&r1=375152&r2=375153&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/ws_info_list.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/ws_info_list.c Sun Feb 5 18:05:19 2006
@@ -116,7 +116,7 @@
ws_info_list_impl->deployer = dep_engine;
- ws_info_list_impl->info_list = axis2_array_list_create(env, 10);
+ ws_info_list_impl->info_list = axis2_array_list_create(env, 0);
if (!(ws_info_list_impl->info_list))
{
axis2_ws_info_list_free(&(ws_info_list_impl->ws_info_list), env);
@@ -124,7 +124,7 @@
return NULL;
}
- ws_info_list_impl->current_info_lists = axis2_array_list_create(env, 10);
+ ws_info_list_impl->current_info_lists = axis2_array_list_create(env, 0);
if (!(ws_info_list_impl->current_info_lists))
{
axis2_ws_info_list_free(&(ws_info_list_impl->ws_info_list), env);
@@ -172,11 +172,34 @@
if(info_list_impl->current_info_lists)
{
+ int list_size = 0;
+ int i = 0;
+
+ list_size = AXIS2_ARRAY_LIST_SIZE(info_list_impl->current_info_lists, env);
+ for (i = 0; i < list_size; i++)
+ {
+ axis2_char_t *file_name = NULL;
+ file_name = (axis2_char_t *) AXIS2_ARRAY_LIST_GET(info_list_impl->
+ current_info_lists, env, i);
+ AXIS2_FREE((*env)->allocator, file_name);
+ }
AXIS2_ARRAY_LIST_FREE(info_list_impl->current_info_lists, env);
info_list_impl->current_info_lists = NULL;
}
if(info_list_impl->info_list)
{
+ int list_size = 0;
+ int i = 0;
+
+ list_size = AXIS2_ARRAY_LIST_SIZE(info_list_impl->info_list, env);
+ for(i = 0; i < list_size; i++)
+ {
+ axis2_ws_info_t *ws_info = NULL;
+
+ ws_info = (axis2_ws_info_t *) AXIS2_ARRAY_LIST_GET(info_list_impl->
+ info_list, env, i);
+ AXIS2_WS_INFO_FREE(ws_info, env);
+ }
AXIS2_ARRAY_LIST_FREE(info_list_impl->info_list, env);
info_list_impl->info_list = NULL;
}
@@ -229,10 +252,18 @@
axis2_ws_info_list_impl_t *info_list_impl = NULL;
axis2_status_t status = AXIS2_FAILURE;
axis2_char_t *info_list_name = NULL;
+ axis2_char_t *temp_name = NULL;
AXIS2_FUNC_PARAM_CHECK(info_list, env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, file, AXIS2_FAILURE);
+ temp_name = AXIS2_FILE_GET_NAME(file, env);
+ info_list_name = AXIS2_STRDUP(temp_name, env);
+ if(!info_list_name)
+ {
+ return AXIS2_FAILURE;
+ }
+
info_list_impl = AXIS2_INTF_TO_IMPL(info_list);
switch (type)
{
@@ -248,14 +279,24 @@
last_modified_date = AXIS2_FILE_GET_TIMESTAMP(file, env);
ws_info =
- axis2_ws_info_create_with_file_name_and_last_modified_date_and_type(
- env, AXIS2_FILE_GET_NAME(file, env), last_modified_date, AXIS2_SVC);
- AXIS2_ARRAY_LIST_ADD(info_list_impl->info_list, env, ws_info);
+ axis2_ws_info_create_with_file_name_and_last_modified_date_and_type(
+ env, info_list_name, last_modified_date, AXIS2_SVC);
+ status = AXIS2_ARRAY_LIST_ADD(info_list_impl->info_list, env, ws_info);
+ if(AXIS2_SUCCESS != status)
+ {
+ AXIS2_FILE_FREE(file, env);
+ return AXIS2_FAILURE;
+ }
file_data = axis2_arch_file_data_create_with_type_and_file(env,
AXIS2_SVC, file);
/* to inform that new web service is deployed */
- AXIS2_DEP_ENGINE_ADD_WS_TO_DEPLOY(info_list_impl->deployer,
+ status = AXIS2_DEP_ENGINE_ADD_WS_TO_DEPLOY(info_list_impl->deployer,
env, file_data);
+ if(AXIS2_SUCCESS != status)
+ {
+ AXIS2_FILE_FREE(file, env);
+ return AXIS2_FAILURE;
+ }
/*}*/
@@ -273,27 +314,32 @@
last_modified_date = AXIS2_FILE_GET_TIMESTAMP(file, env);
ws_info =
- axis2_ws_info_create_with_file_name_and_last_modified_date_and_type(
- env, AXIS2_FILE_GET_NAME(file, env), last_modified_date, AXIS2_MODULE);
- AXIS2_ARRAY_LIST_ADD(info_list_impl->info_list, env, ws_info);
+ axis2_ws_info_create_with_file_name_and_last_modified_date_and_type(
+ env, info_list_name, last_modified_date, AXIS2_MODULE);
+ status = AXIS2_ARRAY_LIST_ADD(info_list_impl->info_list, env, ws_info);
+ if(AXIS2_SUCCESS != status)
+ {
+ AXIS2_FILE_FREE(file, env);
+ return AXIS2_FAILURE;
+ }
file_data = axis2_arch_file_data_create_with_type_and_file(env,
AXIS2_MODULE, file);
/* to inform that new web service is deployed */
- AXIS2_DEP_ENGINE_ADD_WS_TO_DEPLOY(info_list_impl->deployer, env, file_data);
+ status = AXIS2_DEP_ENGINE_ADD_WS_TO_DEPLOY(info_list_impl->deployer,
+ env, file_data);
+ if(AXIS2_SUCCESS != status)
+ {
+ AXIS2_FILE_FREE(file, env);
+ return AXIS2_FAILURE;
+ }
/*}*/
break;
}
}
- info_list_name = AXIS2_FILE_GET_NAME(file, env);
- if(!info_list_name)
- {
- return AXIS2_FAILURE;
- }
- status = AXIS2_ARRAY_LIST_ADD(info_list_impl->current_info_lists, env,
+ return AXIS2_ARRAY_LIST_ADD(info_list_impl->current_info_lists, env,
info_list_name);
- return status;
}
axis2_ws_info_t *AXIS2_CALL
@@ -367,7 +413,7 @@
info_list_impl = AXIS2_INTF_TO_IMPL(info_list);
/* create temp list*/
- temp_list = axis2_array_list_create(env, 16);
+ temp_list = axis2_array_list_create(env, 0);
if (!temp_list)
{
return AXIS2_FAILURE;
@@ -427,6 +473,14 @@
AXIS2_ARRAY_LIST_REMOVE(info_list_impl->info_list, env, index);
}
AXIS2_ARRAY_LIST_FREE(temp_list, env);
+ list_size = AXIS2_ARRAY_LIST_SIZE(info_list_impl->current_info_lists, env);
+ for (i = 0; i < list_size; i++)
+ {
+ axis2_char_t *file_name = NULL;
+ file_name = (axis2_char_t *) AXIS2_ARRAY_LIST_GET(info_list_impl->
+ current_info_lists, env, i);
+ AXIS2_FREE((*env)->allocator, file_name);
+ }
AXIS2_ARRAY_LIST_FREE(info_list_impl->current_info_lists, env);
return AXIS2_SUCCESS;
}
@@ -448,8 +502,10 @@
}
/* TODO uncomment when hot deployment supported */
/*
- if (deployer.isHotUpdate()) {
- deployer.unDeploy();
+ if(AXIS2_TRUE == AXIS2_DEP_ENGINE_IS_HOT_UPDATE(info_list_impl->deployer,
+ env))
+ {
+ AXIS2_DEP_ENGINE_UNDEPLOY(info_list_impl->deployer, env);
}
*/
Modified: webservices/axis2/trunk/c/modules/core/description/transport_in_desc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/transport_in_desc.c?rev=375153&r1=375152&r2=375153&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/transport_in_desc.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/transport_in_desc.c Sun Feb 5 18:05:19 2006
@@ -158,7 +158,7 @@
return NULL;
}
- transport_in_impl->qname = qname;
+ transport_in_impl->qname = AXIS2_QNAME_CLONE(qname, env);
transport_in_impl->transport_in.ops =
AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_transport_in_desc_ops_t));
@@ -285,7 +285,7 @@
AXIS2_QNAME_FREE(transport_in_impl->qname, env);
transport_in_impl->qname = NULL;
}
- transport_in_impl->qname = qname;
+ transport_in_impl->qname = AXIS2_QNAME_CLONE(qname, env);
return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/modules/core/description/transport_out_desc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/transport_out_desc.c?rev=375153&r1=375152&r2=375153&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/transport_out_desc.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/transport_out_desc.c Sun Feb 5 18:05:19 2006
@@ -157,7 +157,7 @@
return NULL;
}
- transport_out_impl->qname = qname;
+ transport_out_impl->qname = AXIS2_QNAME_CLONE(qname, env);
transport_out_impl->transport_out.ops =
AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_transport_out_desc_ops_t));
@@ -281,7 +281,7 @@
AXIS2_PHASE_FREE(transport_out_impl->qname, env);
transport_out_impl->qname = NULL;
}
- transport_out_impl->qname = qname;
+ transport_out_impl->qname = AXIS2_QNAME_CLONE(qname, env);
return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/modules/core/engine/conf.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/engine/conf.c?rev=375153&r1=375152&r2=375153&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/conf.c (original)
+++ webservices/axis2/trunk/c/modules/core/engine/conf.c Sun Feb 5 18:05:19 2006
@@ -652,7 +652,7 @@
axis2_hash_this (hi, NULL, NULL, &val);
transport_out = (axis2_transport_out_desc_t *) val;
if (transport_out)
- AXIS2_TRANSPORT_IN_DESC_FREE (transport_out, env);
+ AXIS2_TRANSPORT_OUT_DESC_FREE (transport_out, env);
val = NULL;
transport_out = NULL;
Modified: webservices/axis2/trunk/c/modules/core/receivers/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/receivers/Makefile.am?rev=375153&r1=375152&r2=375153&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/receivers/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/core/receivers/Makefile.am Sun Feb 5 18:05:19 2006
@@ -2,7 +2,8 @@
AM_CPPFLAGS = $(CPPFLAGS)
libaxis2_receivers_la_SOURCES = msg_recv.c \
- raw_xml_in_out_msg_recv.c
+ raw_xml_in_out_msg_recv.c \
+ svr_callback.c
libaxis2_receivers_la_LIBADD =
INCLUDES = -I$(top_builddir)/include \
Modified: webservices/axis2/trunk/c/modules/core/receivers/msg_recv.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/receivers/msg_recv.c?rev=375153&r1=375152&r2=375153&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/receivers/msg_recv.c (original)
+++ webservices/axis2/trunk/c/modules/core/receivers/msg_recv.c Sun Feb 5 18:05:19 2006
@@ -19,10 +19,9 @@
#include <axis2_msg_recv.h>
#include <axis2_param.h>
#include <axis2_description.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <axis2_class_loader.h>
+#include <axis2_engine.h>
+#include <axis2_core_utils.h>
/**
* @brief Message Receiver struct impl
@@ -46,6 +45,16 @@
axis2_msg_recv_receive (axis2_msg_recv_t *msg_recv,
axis2_env_t **env,
struct axis2_msg_ctx *in_msg_ctx);
+
+axis2_status_t AXIS2_CALL
+axis2_raw_xml_in_out_msg_recv_receive_sync(axis2_msg_recv_t *msg_recv,
+ axis2_env_t **env,
+ axis2_msg_ctx_t *msg_ctx);
+
+axis2_status_t AXIS2_CALL
+axis2_raw_xml_in_out_msg_recv_receive_async(axis2_msg_recv_t *msg_recv,
+ axis2_env_t **env,
+ axis2_msg_ctx_t *msg_ctx);
axis2_svc_skeleton_t * AXIS2_CALL
axis2_msg_recv_make_new_svc_obj(axis2_msg_recv_t *msg_recv,
@@ -89,10 +98,11 @@
}
/*msg_recv_impl->scope = AXIS2_STRDUP(AXIS2_APPLICATION_SCOPE, env);*/
- msg_recv_impl->scope = AXIS2_STRDUP("app*", env);;
+ msg_recv_impl->scope = AXIS2_STRDUP("app*", env);
msg_recv_impl->msg_recv.ops = NULL;
- msg_recv_impl->msg_recv.ops = (axis2_msg_recv_ops_t *) malloc(sizeof(axis2_msg_recv_ops_t));
+ msg_recv_impl->msg_recv.ops = (axis2_msg_recv_ops_t *)
+ AXIS2_MALLOC( (*env)->allocator, sizeof(axis2_msg_recv_ops_t));
if(NULL == msg_recv_impl->msg_recv.ops)
{
@@ -109,7 +119,11 @@
msg_recv_impl->msg_recv.ops->set_scope = axis2_msg_recv_set_scope;
msg_recv_impl->msg_recv.ops->get_scope = axis2_msg_recv_get_scope;
msg_recv_impl->msg_recv.ops->delete_svc_obj = axis2_msg_recv_delete_svc_obj;
-
+ msg_recv_impl->msg_recv.ops->receive_sync =
+ axis2_raw_xml_in_out_msg_recv_receive_sync;
+ msg_recv_impl->msg_recv.ops->receive_async =
+ axis2_raw_xml_in_out_msg_recv_receive_async;
+
return &(msg_recv_impl->msg_recv);
}
@@ -147,7 +161,7 @@
axis2_status_t AXIS2_CALL
axis2_msg_recv_receive (axis2_msg_recv_t *msg_recv,
axis2_env_t **env,
- struct axis2_msg_ctx *in_msg_ctx)
+ axis2_msg_ctx_t *in_msg_ctx)
{
return AXIS2_SUCCESS;
}
@@ -339,4 +353,97 @@
return AXIS2_FAILURE;
}
return axis2_class_loader_delete_dll(env, impl_info_param);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_raw_xml_in_out_msg_recv_receive_sync(axis2_msg_recv_t *msg_recv,
+ axis2_env_t **env,
+ axis2_msg_ctx_t *msg_ctx)
+{
+ axis2_msg_ctx_t *out_msg_ctx = NULL;
+ axis2_engine_t *engine = NULL;
+ axis2_conf_ctx_t *conf_ctx = NULL;
+ axis2_op_ctx_t *op_ctx = NULL;
+ axis2_svc_ctx_t *svc_ctx = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+
+ AXIS2_FUNC_PARAM_CHECK(msg_recv, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, msg_ctx, AXIS2_FAILURE);
+
+ out_msg_ctx = axis2_core_utils_create_out_msg_ctx(env, msg_ctx);
+ if(!out_msg_ctx)
+ {
+ return AXIS2_FAILURE;
+ }
+ op_ctx = AXIS2_MSG_CTX_GET_OP_CTX(out_msg_ctx, env);
+ if(!op_ctx)
+ {
+ AXIS2_MSG_CTX_FREE(out_msg_ctx, env);
+ return AXIS2_FAILURE;
+ }
+ status = AXIS2_OP_CTX_ADD_MSG_CTX(op_ctx, env, out_msg_ctx);
+ if(AXIS2_SUCCESS != status)
+ {
+ AXIS2_MSG_CTX_FREE(out_msg_ctx, env);
+ return status;
+ }
+ status = AXIS2_MSG_RECV_INVOKE_IN_OUT_BUSINESS_LOGIC_SYNC(msg_recv, env,
+ msg_ctx, out_msg_ctx);
+ if(AXIS2_SUCCESS != status)
+ {
+ AXIS2_MSG_CTX_FREE(out_msg_ctx, env);
+ return status;
+ }
+ svc_ctx = AXIS2_OP_CTX_GET_PARENT(op_ctx, env);
+ conf_ctx = AXIS2_SVC_CTX_GET_CONF_CTX(svc_ctx, env);
+ engine = axis2_engine_create(env, conf_ctx);
+ if(!engine)
+ {
+ AXIS2_MSG_CTX_FREE(out_msg_ctx, env);
+ return AXIS2_FAILURE;
+ }
+ return AXIS2_ENGINE_SEND(engine, env, out_msg_ctx);
+
+}
+
+axis2_status_t AXIS2_CALL
+axis2_raw_xml_in_out_msg_recv_receive_async(axis2_msg_recv_t *msg_recv,
+ axis2_env_t **env,
+ axis2_msg_ctx_t *msg_ctx)
+{
+ axis2_svr_callback_t *callback = NULL;
+ axis2_msg_ctx_t *new_msg_ctx = NULL;
+ axis2_op_ctx_t *op_ctx = NULL;
+ axis2_conf_ctx_t *conf_ctx = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, msg_ctx, AXIS2_FAILURE);
+
+ callback = axis2_svr_callback_create(env);
+ if(!callback)
+ {
+ return AXIS2_FAILURE;
+ }
+ /* TODO run this code in a thread */
+
+ new_msg_ctx = axis2_core_utils_create_out_msg_ctx(env, msg_ctx);
+ if(!new_msg_ctx)
+ {
+ return AXIS2_FAILURE;
+ }
+ op_ctx = AXIS2_MSG_CTX_GET_OP_CTX(new_msg_ctx, env);
+ if(!op_ctx)
+ {
+ AXIS2_MSG_CTX_FREE(new_msg_ctx, env);
+ return AXIS2_FAILURE;
+ }
+ AXIS2_OP_CTX_ADD_MSG_CTX(op_ctx, env, new_msg_ctx);
+ status = AXIS2_MSG_RECV_INVOKE_IN_OUT_BUSINESS_LOGIC_ASYNC(msg_recv, env,
+ msg_ctx, new_msg_ctx, callback);
+ /* end of code that run in a thread */
+ conf_ctx = AXIS2_MSG_CTX_GET_CONF_CTX(msg_ctx, env);
+ /* get thread pool from conf_ctx and execute the thread task */
+ /*messageCtx.getConfigurationContext().getThreadPool().execute(theadedTask);*/
+ return status;
}
Modified: webservices/axis2/trunk/c/modules/core/receivers/raw_xml_in_out_msg_recv.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/receivers/raw_xml_in_out_msg_recv.c?rev=375153&r1=375152&r2=375153&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/receivers/raw_xml_in_out_msg_recv.c (original)
+++ webservices/axis2/trunk/c/modules/core/receivers/raw_xml_in_out_msg_recv.c Sun Feb 5 18:05:19 2006
@@ -20,21 +20,15 @@
#include <axis2_soap_envelope.h>
#include <axis2_soap_body.h>
#include <axis2_soap_fault.h>
-#include <axis2_core_utils.h>
-#include <axis2_engine.h>
+
/************************* Function prototypes ********************************/
axis2_status_t AXIS2_CALL
-axis2_raw_xml_in_out_msg_recv_invoke_business_logic(axis2_msg_recv_t *msg_recv,
+axis2_raw_xml_in_out_msg_recv_invoke_business_logic_sync(axis2_msg_recv_t *msg_recv,
axis2_env_t **env,
axis2_msg_ctx_t *msg_ctx,
axis2_msg_ctx_t *new_msg_ctx);
-
-axis2_status_t AXIS2_CALL
-axis2_raw_xml_in_out_msg_recv_receive(axis2_msg_recv_t *msg_recv,
- axis2_env_t **env,
- axis2_msg_ctx_t *msg_ctx);
/************************** End of function prototypes ************************/
@@ -57,16 +51,16 @@
AXIS2_MSG_RECV_FREE(msg_recv, env);
return NULL;
}
- msg_recv->ops->invoke_in_out_business_logic =
- axis2_raw_xml_in_out_msg_recv_invoke_business_logic;
- msg_recv->ops->receive = axis2_raw_xml_in_out_msg_recv_receive;
+ msg_recv->ops->invoke_in_out_business_logic_sync =
+ axis2_raw_xml_in_out_msg_recv_invoke_business_logic_sync;
+ msg_recv->ops->receive = msg_recv->ops->receive_sync;
return msg_recv;
}
/***************************Function implementation****************************/
axis2_status_t AXIS2_CALL
-axis2_raw_xml_in_out_msg_recv_invoke_business_logic(axis2_msg_recv_t *msg_recv,
+axis2_raw_xml_in_out_msg_recv_invoke_business_logic_sync(axis2_msg_recv_t *msg_recv,
axis2_env_t **env,
axis2_msg_ctx_t *msg_ctx,
axis2_msg_ctx_t *new_msg_ctx)
@@ -297,34 +291,7 @@
return status;
}
-axis2_status_t AXIS2_CALL
-axis2_raw_xml_in_out_msg_recv_receive(axis2_msg_recv_t *msg_recv,
- axis2_env_t **env,
- axis2_msg_ctx_t *msg_ctx)
-{
- axis2_msg_ctx_t *out_msg_ctx = NULL;
- axis2_engine_t *engine = NULL;
- axis2_conf_ctx_t *conf_ctx = NULL;
- axis2_op_ctx_t *op_ctx = NULL;
- axis2_svc_ctx_t *svc_ctx = NULL;
-
- AXIS2_FUNC_PARAM_CHECK(msg_recv, env, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, msg_ctx, AXIS2_FAILURE);
-
- out_msg_ctx = axis2_core_utils_create_out_msg_ctx(env, msg_ctx);
- axis2_raw_xml_in_out_msg_recv_invoke_business_logic(msg_recv, env, msg_ctx,
- out_msg_ctx);
- op_ctx = AXIS2_MSG_CTX_GET_OP_CTX(msg_ctx, env);
- svc_ctx = AXIS2_OP_CTX_GET_PARENT(op_ctx, env);
- conf_ctx = AXIS2_SVC_CTX_GET_CONF_CTX(svc_ctx, env);
- engine = axis2_engine_create(env, conf_ctx);
- if(!engine)
- {
- return AXIS2_FAILURE;
- }
- return AXIS2_ENGINE_SEND(engine, env, out_msg_ctx);
-
-}
+
/*
public Method findOperation(AxisOperation op, Class ImplClass) {
Added: webservices/axis2/trunk/c/modules/core/receivers/svr_callback.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/receivers/svr_callback.c?rev=375153&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/core/receivers/svr_callback.c (added)
+++ webservices/axis2/trunk/c/modules/core/receivers/svr_callback.c Sun Feb 5 18:05:19 2006
@@ -0,0 +1,164 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <axis2_svr_callback.h>
+#include <axis2_engine.h>
+
+/**
+ * @brief Message Receiver struct impl
+ * Axis2 Message Receiver impl
+ */
+typedef struct axis2_svr_callback_impl
+{
+ axis2_svr_callback_t svr_callback;
+ axis2_char_t *scope;
+} axis2_svr_callback_impl_t;
+
+#define AXIS2_INTF_TO_IMPL(svr_callback) ((axis2_svr_callback_impl_t *) svr_callback)
+
+/*************************** Function headers *********************************/
+
+axis2_status_t AXIS2_CALL
+axis2_svr_callback_free (axis2_svr_callback_t *svr_callback,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_svr_callback_handle_result(axis2_svr_callback_t *svr_callback,
+ axis2_env_t **env,
+ axis2_msg_ctx_t *msg_ctx);
+
+axis2_status_t AXIS2_CALL
+axis2_svr_callback_handle_fault(axis2_svr_callback_t *svr_callback,
+ axis2_env_t **env,
+ axis2_msg_ctx_t *msg_ctx);
+
+/************************* End of function headers ****************************/
+
+axis2_svr_callback_t * AXIS2_CALL
+axis2_svr_callback_create (axis2_env_t **env)
+{
+ axis2_svr_callback_impl_t *svr_callback_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ svr_callback_impl = (axis2_svr_callback_impl_t *) malloc (sizeof (axis2_svr_callback_impl_t));
+
+ if(NULL == svr_callback_impl)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ svr_callback_impl->svr_callback.ops = NULL;
+
+ svr_callback_impl->svr_callback.ops = (axis2_svr_callback_ops_t *)
+ AXIS2_MALLOC( (*env)->allocator, sizeof(axis2_svr_callback_ops_t));
+
+ if(NULL == svr_callback_impl->svr_callback.ops)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ axis2_svr_callback_free(&(svr_callback_impl->svr_callback), env);
+
+ return NULL;
+ }
+
+ svr_callback_impl->svr_callback.ops->free = axis2_svr_callback_free;
+ svr_callback_impl->svr_callback.ops->handle_result =
+ axis2_svr_callback_handle_result;
+ svr_callback_impl->svr_callback.ops->handle_fault =
+ axis2_svr_callback_handle_fault;
+
+ return &(svr_callback_impl->svr_callback);
+}
+
+/******************************************************************************/
+
+axis2_status_t AXIS2_CALL
+axis2_svr_callback_free (axis2_svr_callback_t *svr_callback,
+ axis2_env_t **env)
+{
+ axis2_svr_callback_impl_t *svr_callback_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ svr_callback_impl = AXIS2_INTF_TO_IMPL(svr_callback);
+
+ if(NULL != svr_callback->ops)
+ {
+ AXIS2_FREE((*env)->allocator, svr_callback->ops);
+ svr_callback->ops = NULL;
+ }
+
+ if(svr_callback_impl)
+ {
+ AXIS2_FREE((*env)->allocator, svr_callback_impl);
+ svr_callback_impl = NULL;
+ }
+
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_svr_callback_handle_result(axis2_svr_callback_t *svr_callback,
+ axis2_env_t **env,
+ axis2_msg_ctx_t *msg_ctx)
+{
+ axis2_engine_t *engine = NULL;
+ axis2_conf_ctx_t *conf_ctx = NULL;
+ axis2_svc_ctx_t *svc_ctx = NULL;
+ axis2_op_ctx_t *op_ctx = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, msg_ctx, AXIS2_FAILURE);
+
+ op_ctx = AXIS2_MSG_CTX_GET_OP_CTX(msg_ctx, env);
+ svc_ctx = AXIS2_OP_CTX_GET_PARENT(op_ctx, env);
+ conf_ctx = AXIS2_SVC_CTX_GET_CONF_CTX(svc_ctx, env);
+ engine = axis2_engine_create(env, conf_ctx);
+ if(!engine)
+ {
+ return AXIS2_FAILURE;
+ }
+ return AXIS2_ENGINE_SEND(engine, env, msg_ctx);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_svr_callback_handle_fault(axis2_svr_callback_t *svr_callback,
+ axis2_env_t **env,
+ axis2_msg_ctx_t *msg_ctx)
+{
+ axis2_engine_t *engine = NULL;
+ axis2_conf_ctx_t *conf_ctx = NULL;
+ axis2_svc_ctx_t *svc_ctx = NULL;
+ axis2_op_ctx_t *op_ctx = NULL;
+ axis2_msg_ctx_t *fault_ctx = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, msg_ctx, AXIS2_FAILURE);
+
+ op_ctx = AXIS2_MSG_CTX_GET_OP_CTX(msg_ctx, env);
+ svc_ctx = AXIS2_OP_CTX_GET_PARENT(op_ctx, env);
+ conf_ctx = AXIS2_SVC_CTX_GET_CONF_CTX(svc_ctx, env);
+ engine = axis2_engine_create(env, conf_ctx);
+ if(!engine)
+ {
+ return AXIS2_FAILURE;
+ }
+
+ fault_ctx = AXIS2_ENGINE_CREATE_FAULT_MSG_CTX(engine, env, msg_ctx);
+ return AXIS2_ENGINE_SEND_FAULT(engine, env, fault_ctx);
+}
Modified: webservices/axis2/trunk/c/modules/util/dir_handler.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/dir_handler.c?rev=375153&r1=375152&r2=375153&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/dir_handler.c (original)
+++ webservices/axis2/trunk/c/modules/util/dir_handler.c Sun Feb 5 18:05:19 2006
@@ -44,6 +44,8 @@
/* If no files found, make a non-selectable menu item */
if (count <= 0)
{
+ AXIS2_ARRAY_LIST_FREE(file_list, env);
+ file_list = NULL;
printf("No files in this directory:%s\n", pathname);
return NULL;
}
@@ -59,14 +61,43 @@
arch_file = (axis2_file_t *) axis2_file_create(env);
if(!arch_file)
{
+ int size = 0;
+ int j = 0;
+ axis2_file_t *del_file = NULL;
+
+ size = AXIS2_ARRAY_LIST_SIZE(file_list, env);
+ for(j = 0; j < size; j++)
+ {
+ del_file = AXIS2_ARRAY_LIST_GET(file_list, env, j);
+ AXIS2_FILE_FREE(del_file, env);
+ del_file = NULL;
+ }
+ AXIS2_ARRAY_LIST_FREE(file_list, env);
+ file_list = NULL;
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
AXIS2_FILE_SET_NAME(arch_file, env, fname);
temp_path = AXIS2_STRACAT(pathname, AXIS2_PATH_SEP_STR, env);
path = AXIS2_STRACAT(temp_path, fname, env);
+ AXIS2_FREE((*env)->allocator, temp_path);
if(!path)
{
+ int size = 0;
+ int j = 0;
+ axis2_file_t *del_file = NULL;
+
+ AXIS2_FILE_FREE(arch_file, env);
+ arch_file = NULL;
+ size = AXIS2_ARRAY_LIST_SIZE(file_list, env);
+ for(j = 0; j < size; j++)
+ {
+ del_file = AXIS2_ARRAY_LIST_GET(file_list, env, j);
+ AXIS2_FILE_FREE(del_file, env);
+ del_file = NULL;
+ }
+ AXIS2_ARRAY_LIST_FREE(file_list, env);
+ file_list = NULL;
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
@@ -74,17 +105,54 @@
buf = AXIS2_MALLOC((*env)->allocator, sizeof(struct stat));
if(!buf)
{
+ int size = 0;
+ int j = 0;
+ axis2_file_t *del_file = NULL;
+
+ AXIS2_FREE((*env)->allocator, path);
+ path = NULL;
+ AXIS2_FILE_FREE(arch_file, env);
+ arch_file = NULL;
+ size = AXIS2_ARRAY_LIST_SIZE(file_list, env);
+ for(j = 0; j < size; j++)
+ {
+ del_file = AXIS2_ARRAY_LIST_GET(file_list, env, j);
+ AXIS2_FILE_FREE(del_file, env);
+ del_file = NULL;
+ }
+ AXIS2_ARRAY_LIST_FREE(file_list, env);
+ file_list = NULL;
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
stat(path, buf);
AXIS2_FILE_SET_TIMESTAMP(arch_file, env, (time_t) buf->st_ctime);
status = AXIS2_ARRAY_LIST_ADD(file_list, env, arch_file);
- if(path)
+ if(AXIS2_SUCCESS != status)
{
+ int size = 0;
+ int j = 0;
+ axis2_file_t *del_file = NULL;
+
+ AXIS2_FILE_FREE(arch_file, env);
+ arch_file = NULL;
AXIS2_FREE((*env)->allocator, path);
path = NULL;
+ AXIS2_FREE((*env)->allocator, buf);
+ size = AXIS2_ARRAY_LIST_SIZE(file_list, env);
+ for(j = 0; j < size; j++)
+ {
+ del_file = AXIS2_ARRAY_LIST_GET(file_list, env, j);
+ AXIS2_FILE_FREE(del_file, env);
+ del_file = NULL;
+ }
+ AXIS2_ARRAY_LIST_FREE(file_list, env);
+ file_list = NULL;
+ return NULL;
}
+ AXIS2_FREE((*env)->allocator, path);
+ path = NULL;
+ AXIS2_FREE((*env)->allocator, buf);
buf = NULL;
arch_file = NULL;
fname = NULL;
@@ -119,11 +187,12 @@
printf("Path Name does not exist:%s\n",pathname);
return NULL;
}*/
- file_list = axis2_array_list_create(env, 100);
+ file_list = axis2_array_list_create(env, 0);
count = AXIS2_SCANDIR(pathname, &files, dir_select, AXIS2_ALPHASORT);
/* If no files found, make a non-selectable menu item */
if (count <= 0)
{
+ AXIS2_ARRAY_LIST_FREE(file_list, env);
printf("No files in this directory:%s\n", pathname);
return NULL;
}
@@ -139,6 +208,19 @@
arch_file = (axis2_file_t *) axis2_file_create(env);
if(!arch_file)
{
+ int size = 0;
+ int j = 0;
+ axis2_file_t *del_file = NULL;
+
+ size = AXIS2_ARRAY_LIST_SIZE(file_list, env);
+ for(j = 0; j < size; j++)
+ {
+ del_file = AXIS2_ARRAY_LIST_GET(file_list, env, j);
+ AXIS2_FILE_FREE(del_file, env);
+ del_file = NULL;
+ }
+ AXIS2_ARRAY_LIST_FREE(file_list, env);
+ file_list = NULL;
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
@@ -148,6 +230,21 @@
path = AXIS2_STRACAT(temp_path, fname, env);
if(!path)
{
+ int size = 0;
+ int j = 0;
+ axis2_file_t *del_file = NULL;
+
+ AXIS2_FILE_FREE(arch_file, env);
+ arch_file = NULL;
+ size = AXIS2_ARRAY_LIST_SIZE(file_list, env);
+ for(j = 0; j < size; j++)
+ {
+ del_file = AXIS2_ARRAY_LIST_GET(file_list, env, j);
+ AXIS2_FILE_FREE(del_file, env);
+ del_file = NULL;
+ }
+ AXIS2_ARRAY_LIST_FREE(file_list, env);
+ file_list = NULL;
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
@@ -157,17 +254,55 @@
buf = AXIS2_MALLOC((*env)->allocator, sizeof(struct stat));
if(!buf)
{
+ int size = 0;
+ int j = 0;
+ axis2_file_t *del_file = NULL;
+
+ AXIS2_FILE_FREE(arch_file, env);
+ arch_file = NULL;
+ AXIS2_FREE((*env)->allocator, path);
+ path = NULL;
+ size = AXIS2_ARRAY_LIST_SIZE(file_list, env);
+ for(j = 0; j < size; j++)
+ {
+ del_file = AXIS2_ARRAY_LIST_GET(file_list, env, j);
+ AXIS2_FILE_FREE(del_file, env);
+ del_file = NULL;
+ }
+ AXIS2_ARRAY_LIST_FREE(file_list, env);
+ file_list = NULL;
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
stat(path, buf);
AXIS2_FILE_SET_TIMESTAMP(arch_file, env, (time_t) buf->st_ctime);
status = AXIS2_ARRAY_LIST_ADD(file_list, env, arch_file);
- if(path)
+ if(AXIS2_SUCCESS != status)
{
+ int size = 0;
+ int j = 0;
+ axis2_file_t *del_file = NULL;
+
+ AXIS2_FILE_FREE(arch_file, env);
+ arch_file = NULL;
AXIS2_FREE((*env)->allocator, path);
path = NULL;
+ AXIS2_FREE((*env)->allocator, buf);
+ buf = NULL;
+ size = AXIS2_ARRAY_LIST_SIZE(file_list, env);
+ for(j = 0; j < size; j++)
+ {
+ del_file = AXIS2_ARRAY_LIST_GET(file_list, env, j);
+ AXIS2_FILE_FREE(del_file, env);
+ del_file = NULL;
+ }
+ AXIS2_ARRAY_LIST_FREE(file_list, env);
+ file_list = NULL;
+
}
+ AXIS2_FREE((*env)->allocator, path);
+ path = NULL;
+ AXIS2_FREE((*env)->allocator, buf);
buf = NULL;
arch_file = NULL;
fname = NULL;