You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by da...@apache.org on 2006/01/04 03:02:45 UTC
svn commit: r365798 - in /webservices/axis2/trunk/c: include/
modules/core/deployment/ modules/core/description/ modules/core/engine/
Author: damitha
Date: Tue Jan 3 18:02:26 2006
New Revision: 365798
URL: http://svn.apache.org/viewcvs?rev=365798&view=rev
Log:
conf builder is done
Added:
webservices/axis2/trunk/c/include/axis2_module_builder.h
webservices/axis2/trunk/c/modules/core/deployment/module_builder.c
Modified:
webservices/axis2/trunk/c/include/axis2_conf.h
webservices/axis2/trunk/c/include/axis2_dep_engine.h
webservices/axis2/trunk/c/include/axis2_disp.h
webservices/axis2/trunk/c/include/axis2_error.h
webservices/axis2/trunk/c/include/axis2_phase.h
webservices/axis2/trunk/c/modules/core/deployment/Makefile.am
webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c
webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c
webservices/axis2/trunk/c/modules/core/description/dll_desc.c
webservices/axis2/trunk/c/modules/core/engine/conf.c
Modified: webservices/axis2/trunk/c/include/axis2_conf.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_conf.h?rev=365798&r1=365797&r2=365798&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_conf.h (original)
+++ webservices/axis2/trunk/c/include/axis2_conf.h Tue Jan 3 18:02:26 2006
@@ -32,6 +32,8 @@
#include <axis2_hash.h>
#include <axis2_phases_info.h>
#include <axis2_msg_recv.h>
+#include <axis2_disp.h>
+#include <axis2_disp_checker.h>
#ifdef __cplusplus
extern "C"
@@ -270,6 +272,22 @@
add_module) (axis2_conf_t *conf,
axis2_env_t **env,
struct axis2_module_desc *module);
+
+ /**
+ * setting the default dispatching order
+ */
+ axis2_status_t (AXIS2_CALL *
+ set_default_dispatchers) (axis2_conf_t *conf,
+ axis2_env_t **env);
+
+ /**
+ * Setting the custom dispatching order
+ * @param dispatch
+ */
+ axis2_status_t (AXIS2_CALL *
+ set_dispatch_phase) (axis2_conf_t *conf,
+ axis2_env_t **env,
+ axis2_phase_t *dispatch);
};
@@ -406,6 +424,13 @@
#define AXIS2_CONF_ADD_MODULE(conf, env, module) \
(conf->ops->add_module(conf , env, module))
+
+#define AXIS2_CONF_SET_DEFAULT_DISPATCHERS(conf, env) \
+ (conf->ops->set_default_dispatchers(conf , env))
+
+#define AXIS2_CONF_SET_DISPATCH_PHASE(conf, env, dispatch) \
+ (conf->ops->set_dispatch_phase(conf , env, dispatch))
+
/************************* End of function macros *****************************/
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=365798&r1=365797&r2=365798&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_dep_engine.h (original)
+++ webservices/axis2/trunk/c/include/axis2_dep_engine.h Tue Jan 3 18:02:26 2006
@@ -60,10 +60,21 @@
free)(axis2_dep_engine_t *dep_engine,
axis2_env_t **env);
+ /**
+ * while parsing the axis2.xml the module refferences have to be stored some
+ * where , since at that time none of module availble (they load after parsing
+ * the document)
+ * @param module_qname <code>QName</code>
+ */
+ axis2_status_t (AXIS2_CALL *
+ add_module) (axis2_dep_engine_t *dep_engine,
+ axis2_env_t **env,
+ axis2_qname_t *module_qname);
+
axis2_module_desc_t *(AXIS2_CALL *
get_module) (axis2_dep_engine_t *dep_engine,
axis2_env_t **env,
- axis2_qname_t *module_name);
+ axis2_qname_t *module_qname);
struct axis2_arch_file_data *(AXIS2_CALL *
get_current_file_item)(axis2_dep_engine_t *dep_engine,
@@ -135,8 +146,11 @@
#define AXIS2_DEP_ENGINE_FREE(dep_engine, env) \
((dep_engine->ops)->free (dep_engine, env))
-#define AXIS2_DEP_ENGINE_GET_MODULE(dep_engine, env, module_name) \
- ((dep_engine->ops)->get_module (dep_engine, env, module_name))
+#define AXIS2_DEP_ENGINE_ADD_MODULE(dep_engine, env, module_qname) \
+ ((dep_engine->ops)->add_module (dep_engine, env, module_qname))
+
+#define AXIS2_DEP_ENGINE_GET_MODULE(dep_engine, env, module_qname) \
+ ((dep_engine->ops)->get_module (dep_engine, env, module_qname))
#define AXIS2_DEP_ENGINE_GET_CURRENT_FILE_ITEM(dep_engine, env) \
((dep_engine->ops)->get_current_file_item (dep_engine, env))
Modified: webservices/axis2/trunk/c/include/axis2_disp.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_disp.h?rev=365798&r1=365797&r2=365798&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_disp.h (original)
+++ webservices/axis2/trunk/c/include/axis2_disp.h Tue Jan 3 18:02:26 2006
@@ -61,7 +61,7 @@
* @param messageContext
* @return
*/
- axis2_svc_t* (AXIS2_CALL *find_svc)(axis2_msg_ctx_t *msg_ctx,
+ struct axis2_svc* (AXIS2_CALL *find_svc)(axis2_msg_ctx_t *msg_ctx,
axis2_env_t **env);
/**
* finds the op
Modified: webservices/axis2/trunk/c/include/axis2_error.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_error.h?rev=365798&r1=365797&r2=365798&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_error.h (original)
+++ webservices/axis2/trunk/c/include/axis2_error.h Tue Jan 3 18:02:26 2006
@@ -320,7 +320,12 @@
/** Module xml file is not found in the given path */
AXIS2_ERROR_MODULE_XML_NOT_FOUND_FOR_THE_MODULE,
AXIS2_ERROR_OPERATION_NAME_MISSING,
- AXIS2_ERROR_SVC_NAME_ERROR
+ AXIS2_ERROR_SVC_NAME_ERROR,
+ AXIS2_ERROR_OP_NAME_MISSING,
+ AXIS2_ERROR_OUTFLOW_NOT_ALLOWED_IN_TRS_IN,
+ AXIS2_ERROR_INFLOW_NOT_ALLOWED_IN_TRS_OUT,
+ AXIS2_ERROR_NO_DISPATCHER_FOUND,
+ AXIS2_ERROR_TRANSPORT_SENDER_ERROR
};
/** @} */
Added: webservices/axis2/trunk/c/include/axis2_module_builder.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_module_builder.h?rev=365798&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_module_builder.h (added)
+++ webservices/axis2/trunk/c/include/axis2_module_builder.h Tue Jan 3 18:02:26 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_MODULE_BUILDER_H
+#define AXIS2_MODULE_BUILDER_H
+
+/**
+ * @file axis2_module_builder.h
+ * @brief Axis2 Module Builder interface
+ */
+
+#include <axis2.h>
+#include <axis2_error.h>
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axis2_allocator.h>
+#include <axis2_qname.h>
+#include <axis2_module_desc.h>
+#include <axis2_dep_engine.h>
+#include <axis2_desc_builder.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+typedef struct axis2_module_builder axis2_module_builder_t;
+typedef struct axis2_module_builder_ops axis2_module_builder_ops_t;
+
+/** @defgroup axis2_module_builder Module Builder
+ * @ingroup axis2_deployment
+ * @{
+ */
+
+/**
+ * @brief Module Builder ops struct
+ * Encapsulator struct for ops of axis2_module_builder
+ */
+AXIS2_DECLARE_DATA struct axis2_module_builder_ops
+{
+ /** De-allocate memory
+ * @return status code
+ */
+ axis2_status_t (AXIS2_CALL *
+ free)(axis2_module_builder_t *module_builder,
+ axis2_env_t **env);
+
+ axis2_status_t (AXIS2_CALL *
+ populate_module) (axis2_module_builder_t *module_builder,
+ axis2_env_t **env);
+
+};
+
+/**
+ * @brief Module Builder struct
+ */
+AXIS2_DECLARE_DATA struct axis2_module_builder
+{
+ axis2_module_builder_ops_t *ops;
+ axis2_desc_builder_t *desc_builder;
+};
+
+/**
+ * Creates module builder struct
+ * @return pointer to newly created module builder
+ */
+AXIS2_DECLARE(axis2_module_builder_t *)
+axis2_module_builder_create (axis2_env_t **env);
+
+/**
+ * Creates module builder struct
+ * @param file_name
+ * @param dep_engine
+ * @param module
+ * @return pointer to newly created module builder
+ */
+AXIS2_DECLARE(axis2_module_builder_t *)
+axis2_svc_builder_create_with_file_and_dep_engine_module (axis2_env_t **env,
+ axis2_char_t *file_name,
+ axis2_dep_engine_t *dep_engine,
+ axis2_module_desc_t *module);
+
+/*************************** Function macros **********************************/
+
+#define AXIS2_MODULE_BUILDER_FREE(module_builder, env) \
+ ((module_builder->ops)->free (module_builder, env))
+
+#define AXIS2_MODULE_BUILDER_POPULATE_MODULE(module_builder, env) \
+ ((module_builder->ops)->populate_module (module_builder, env))
+
+/*************************** End of function macros ***************************/
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* AXIS2_MODULE_BUILDER_H */
Modified: webservices/axis2/trunk/c/include/axis2_phase.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_phase.h?rev=365798&r1=365797&r2=365798&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_phase.h (original)
+++ webservices/axis2/trunk/c/include/axis2_phase.h Tue Jan 3 18:02:26 2006
@@ -169,7 +169,7 @@
*/
AXIS2_DECLARE(axis2_phase_t*) axis2_phase_create(axis2_env_t **env, const axis2_char_t *phase_name);
-#define AXIS2_PHASE_ADD_HANDLER_AT(phase, env, handler) ((phase)->ops->add_handler_at(phase, env, handler))
+#define AXIS2_PHASE_ADD_HANDLER_AT(phase, env, index, handler) ((phase)->ops->add_handler_at(phase, env, index, handler))
#define AXIS2_PHASE_ADD_HANDLER(phase, env, handler) ((phase)->ops->add_handler(phase, env, handler))
#define AXIS2_PHASE_ADD_HANDLER_DESC(phase, env, handler_desc) ((phase)->ops->add_handler_desc(phase, env, handler_desc))
#define AXIS2_PHASE_INVOKE(phase, env, msg_ctx) ((phase)->ops->invoke(phase, env, msg_ctx))
Modified: webservices/axis2/trunk/c/modules/core/deployment/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/Makefile.am?rev=365798&r1=365797&r2=365798&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/Makefile.am Tue Jan 3 18:02:26 2006
@@ -8,7 +8,9 @@
ws_info.c \
ws_info_list.c \
svc_builder.c \
- svc_grp_builder.c
+ svc_grp_builder.c \
+ module_builder.c \
+ conf_builder.c
libaxis2_deployment_la_LIBADD =
INCLUDES = -I$(top_builddir)/include \
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=365798&r1=365797&r2=365798&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c Tue Jan 3 18:02:26 2006
@@ -41,6 +41,11 @@
axis2_array_list_t *ws_to_undeploy;
axis2_phases_info_t *phases_info;
+ /**
+ * To store the module specified in the server.xml at the document parsing
+ * time
+ */
+ axis2_array_list_t *module_list;
} axis2_dep_engine_impl_t;
@@ -52,6 +57,11 @@
axis2_dep_engine_free (axis2_dep_engine_t *dep_engine,
axis2_env_t **env);
+axis2_status_t AXIS2_CALL
+axis2_dep_engine_add_module(axis2_dep_engine_t *dep_engine,
+ axis2_env_t **env,
+ axis2_qname_t *module_qname);
+
struct axis2_module_desc *AXIS2_CALL
axis2_dep_engine_get_module(axis2_dep_engine_t *dep_engine,
axis2_env_t **env,
@@ -114,6 +124,7 @@
dep_engine_impl->ws_to_deploy = NULL;
dep_engine_impl->ws_to_undeploy = NULL;
dep_engine_impl->phases_info = NULL;
+ dep_engine_impl->module_list = NULL;
dep_engine_impl->dep_engine.ops = NULL;
@@ -127,6 +138,7 @@
}
dep_engine_impl->dep_engine.ops->free = axis2_dep_engine_free;
+ dep_engine_impl->dep_engine.ops->add_module = axis2_dep_engine_add_module;
dep_engine_impl->dep_engine.ops->get_module = axis2_dep_engine_get_module;
dep_engine_impl->dep_engine.ops->get_current_file_item =
axis2_dep_engine_get_current_file_item;
@@ -169,6 +181,11 @@
AXIS2_ARRAY_LIST_FREE(dep_engine_impl->ws_to_undeploy, env);
dep_engine_impl->ws_to_undeploy = NULL;
}
+ if(dep_engine_impl->module_list)
+ {
+ AXIS2_ARRAY_LIST_FREE(dep_engine_impl->module_list, env);
+ dep_engine_impl->module_list = NULL;
+ }
if(NULL != dep_engine->ops)
{
@@ -180,6 +197,18 @@
return AXIS2_SUCCESS;
}
+axis2_status_t AXIS2_CALL
+axis2_dep_engine_add_module(axis2_dep_engine_t *dep_engine,
+ axis2_env_t **env,
+ axis2_qname_t *module_qname)
+{
+ AXIS2_FUNC_PARAM_CHECK(dep_engine, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, module_qname, AXIS2_FAILURE);
+
+ return AXIS2_ARRAY_LIST_ADD(AXIS2_INTF_TO_IMPL(dep_engine)->module_list,
+ env, module_qname);
+}
+
struct axis2_module_desc *AXIS2_CALL
axis2_dep_engine_get_module(axis2_dep_engine_t *dep_engine,
axis2_env_t **env,
Added: webservices/axis2/trunk/c/modules/core/deployment/module_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/module_builder.c?rev=365798&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/module_builder.c (added)
+++ webservices/axis2/trunk/c/modules/core/deployment/module_builder.c Tue Jan 3 18:02:26 2006
@@ -0,0 +1,439 @@
+/*
+ * 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.
+ */
+
+#include <axis2_module_builder.h>
+
+/**
+ * This is to convert OM->ServiceDescrption , where it first create OM from
+ * services.xml and then populate service description by using OM
+ */
+typedef struct axis2_module_builder_impl
+{
+ axis2_module_builder_t module_builder;
+ axis2_module_desc_t *module;
+
+} axis2_module_builder_impl_t;
+
+#define AXIS2_INTF_TO_IMPL(module_builder) \
+ ((axis2_module_builder_impl_t *) module_builder)
+
+/************************* Function prototypes ********************************/
+
+axis2_status_t AXIS2_CALL
+axis2_module_builder_free (axis2_module_builder_t *module_builder,
+ axis2_env_t **env);
+
+
+axis2_status_t AXIS2_CALL
+axis2_module_builder_populate_module(axis2_module_builder_t *module_builder,
+ axis2_env_t **env);
+
+axis2_array_list_t *AXIS2_CALL
+axis2_module_builder_process_ops(axis2_module_builder_t *module_builder,
+ axis2_env_t **env,
+ axis2_om_children_qname_iterator_t *op_itr);
+
+/************************** End of function prototypes ************************/
+
+axis2_module_builder_t * AXIS2_CALL
+axis2_module_builder_create (axis2_env_t **env)
+{
+ axis2_module_builder_impl_t *module_builder_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ module_builder_impl = (axis2_module_builder_impl_t *) AXIS2_MALLOC((*env)->
+ allocator, sizeof(axis2_module_builder_impl_t));
+
+
+ if(NULL == module_builder_impl)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ module_builder_impl->module_builder.ops = NULL;
+
+ module_builder_impl->module_builder.ops =
+ AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_module_builder_ops_t));
+ if(NULL == module_builder_impl->module_builder.ops)
+ {
+ axis2_module_builder_free(&(module_builder_impl->module_builder), env);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ module_builder_impl->module_builder.ops->free = axis2_module_builder_free;
+ module_builder_impl->module_builder.ops->populate_module =
+ axis2_module_builder_populate_module;
+
+ return &(module_builder_impl->module_builder);
+}
+
+axis2_module_builder_t * AXIS2_CALL
+axis2_svc_builder_create_with_file_and_dep_engine_module (axis2_env_t **env,
+ axis2_char_t *file_name,
+ axis2_dep_engine_t *dep_engine,
+ axis2_module_desc_t *module)
+{
+ axis2_module_builder_impl_t *builder_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ builder_impl = (axis2_module_builder_impl_t *) axis2_module_builder_create(env);
+ if(NULL == builder_impl)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ builder_impl->module_builder.desc_builder =
+ axis2_desc_builder_create_with_file_and_dep_engine(env, file_name,
+ dep_engine);
+ if(!builder_impl->module_builder.desc_builder)
+ {
+ axis2_module_builder_free(&(builder_impl->module_builder), env);
+ return NULL;
+ }
+ builder_impl->module= module;
+ return &(builder_impl->module_builder);
+}
+
+/***************************Function implementation****************************/
+
+axis2_status_t AXIS2_CALL
+axis2_module_builder_free (axis2_module_builder_t *module_builder,
+ axis2_env_t **env)
+{
+ axis2_module_builder_impl_t *module_builder_impl = NULL;
+
+ AXIS2_FUNC_PARAM_CHECK(module_builder, env, AXIS2_FAILURE);
+
+ module_builder_impl = AXIS2_INTF_TO_IMPL(module_builder);
+
+ if(NULL != module_builder->ops)
+ {
+ AXIS2_FREE((*env)->allocator, module_builder->ops);
+ module_builder->ops = NULL;
+ }
+
+ if(module_builder_impl)
+ {
+ AXIS2_FREE((*env)->allocator, module_builder_impl);
+ module_builder_impl = NULL;
+ }
+
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_module_builder_populate_module(axis2_module_builder_t *module_builder,
+ axis2_env_t **env)
+{
+ axis2_module_builder_impl_t *builder_impl = NULL;
+ axis2_om_element_t *module_element = NULL;
+ axis2_om_node_t *module_node = NULL;
+ axis2_om_attribute_t *module_name_att = NULL;
+ axis2_qname_t *qattname = NULL;
+ axis2_qname_t *qdllname = NULL;
+ axis2_qname_t *qparamst = NULL;
+ axis2_qname_t *qinflowst = NULL;
+ axis2_qname_t *qoutflowst = NULL;
+ axis2_qname_t *qinfaultflow = NULL;
+ axis2_qname_t *qoutfaultflow = NULL;
+ axis2_qname_t *qopst = NULL;
+ axis2_om_attribute_t *module_dll_att = NULL;
+ axis2_om_children_qname_iterator_t *itr = NULL;
+ axis2_om_children_qname_iterator_t *op_itr = NULL;
+ axis2_om_element_t *in_flow_element = NULL;
+ axis2_om_node_t *in_flow_node = NULL;
+ axis2_om_element_t *out_flow_element = NULL;
+ axis2_om_node_t *out_flow_node = NULL;
+ axis2_om_element_t *in_fault_flow_element = NULL;
+ axis2_om_node_t *in_fault_flow_node = NULL;
+ axis2_om_element_t *out_fault_flow_element = NULL;
+ axis2_om_node_t *out_fault_flow_node = NULL;
+ struct axis2_conf *parent = NULL;
+ axis2_array_list_t *ops = NULL;
+ int size = 0;
+ int i = 0;
+
+ AXIS2_FUNC_PARAM_CHECK(module_builder, env, AXIS2_FAILURE);
+ builder_impl = AXIS2_INTF_TO_IMPL(module_builder);
+
+ module_node = AXIS2_DESC_BUILDER_BUILD_OM(module_builder->desc_builder, env);
+
+ /* Setting Module Name */
+ qattname = axis2_qname_create(env, AXIS2_ATTNAME, NULL, NULL);
+ module_name_att = AXIS2_OM_ELEMENT_GET_ATTRIBUTE(module_element, env,
+ qattname);
+ if(NULL != module_name_att)
+ {
+ axis2_char_t *module_name = NULL;
+
+ module_name = AXIS2_OM_ATTRIBUTE_GET_VALUE(module_name_att, env);
+ if(NULL != module_name && (0 != AXIS2_STRCMP("", module_name)))
+ {
+ axis2_qname_t *qmodule_name = NULL;
+ qmodule_name = axis2_qname_create(env, module_name, NULL, NULL);
+ AXIS2_MODULE_DESC_SET_NAME(builder_impl->module, env, qmodule_name);
+ AXIS2_QNAME_FREE(qmodule_name, env);
+ }
+ else
+ {
+ axis2_arch_file_data_t *file_data = NULL;
+ axis2_qname_t *qshortfilename = NULL;
+ axis2_char_t *svc_name = NULL;
+ axis2_char_t *short_file_name = NULL;
+
+ file_data = AXIS2_DEP_ENGINE_GET_CURRENT_FILE_ITEM(module_builder->
+ desc_builder->engine, env);
+ svc_name = AXIS2_ARCH_FILE_DATA_GET_SVC_NAME(file_data, env);
+ short_file_name = AXIS2_DESC_BUILDER_GET_SHORT_FILE_NAME(
+ module_builder->desc_builder, env, svc_name);
+ qshortfilename = axis2_qname_create(env, short_file_name, NULL, NULL);
+ AXIS2_MODULE_DESC_SET_NAME(builder_impl->module, env, qshortfilename);
+ AXIS2_QNAME_FREE(qshortfilename, env);
+ }
+ }
+ else
+ {
+ axis2_arch_file_data_t *file_data = NULL;
+ axis2_qname_t *qshortfilename = NULL;
+ axis2_char_t *svc_name = NULL;
+ axis2_char_t *short_file_name = NULL;
+
+ file_data = AXIS2_DEP_ENGINE_GET_CURRENT_FILE_ITEM(module_builder->
+ desc_builder->engine, env);
+ svc_name = AXIS2_ARCH_FILE_DATA_GET_SVC_NAME(file_data, env);
+ short_file_name = AXIS2_DESC_BUILDER_GET_SHORT_FILE_NAME(
+ module_builder->desc_builder, env, svc_name);
+ qshortfilename = axis2_qname_create(env, short_file_name, NULL, NULL);
+ AXIS2_MODULE_DESC_SET_NAME(builder_impl->module, env, qshortfilename);
+ AXIS2_QNAME_FREE(qshortfilename, env);
+ }
+
+ /* Setting Module Dll Name , if it is there */
+
+ qdllname = axis2_qname_create(env, AXIS2_CLASSNAME, NULL, NULL);
+ module_dll_att = AXIS2_OM_ELEMENT_GET_ATTRIBUTE(module_element, env, qdllname);
+ if(NULL != module_dll_att)
+ {
+ axis2_char_t *module_dll = NULL;
+
+
+ module_dll = AXIS2_OM_ATTRIBUTE_GET_VALUE(module_dll_att, env);
+ if(NULL != module_dll && (0 != AXIS2_STRCMP("", module_dll)))
+ {
+ if(NULL != module_builder->desc_builder->engine)
+ {
+ axis2_arch_file_data_t *file_data = NULL;
+
+ file_data = AXIS2_DEP_ENGINE_GET_CURRENT_FILE_ITEM(
+ module_builder->desc_builder->engine, env);
+ AXIS2_ARCH_FILE_DATA_SET_MODULE_DLL_NAME(file_data, env,
+ module_dll);
+
+ }
+ }
+ }
+
+ /* processing Paramters */
+ /* Processing service level paramters */
+
+ qparamst = axis2_qname_create(env, AXIS2_PARAMETERST, NULL, NULL);
+ itr = AXIS2_OM_ELEMENT_GET_CHILDREN_WITH_QNAME(module_element, env,
+ qparamst, module_node);
+ parent = AXIS2_MODULE_DESC_GET_PARENT(builder_impl->module, env);
+ AXIS2_DESC_BUILDER_PROCESS_PARAMS(module_builder->desc_builder, env,
+ itr, builder_impl->module->params, parent->param_container);
+
+ /* process INFLOW */
+ qinflowst = axis2_qname_create(env, AXIS2_INFLOWST, NULL, NULL);
+ in_flow_element = AXIS2_OM_ELEMENT_GET_FIRST_CHILD_WITH_QNAME(module_element,
+ env, qinflowst, module_node, &in_flow_node);
+ if(NULL != in_flow_element && NULL != in_flow_node)
+ {
+ axis2_flow_t *flow = AXIS2_DESC_BUILDER_PROCESS_FLOW(module_builder->
+ desc_builder, env, in_flow_element, builder_impl->module->params,
+ in_flow_node);
+ AXIS2_MODULE_DESC_SET_INFLOW(builder_impl->module, env, flow);
+ }
+
+ qoutflowst = axis2_qname_create(env, AXIS2_OUTFLOWST, NULL, NULL);
+ out_flow_element = AXIS2_OM_ELEMENT_GET_FIRST_CHILD_WITH_QNAME(module_element,
+ env, qoutflowst, module_node, &out_flow_node);
+ if(NULL != out_flow_element && NULL != out_flow_node)
+ {
+ axis2_flow_t *flow = AXIS2_DESC_BUILDER_PROCESS_FLOW(module_builder->
+ desc_builder, env, out_flow_element, builder_impl->module->params,
+ out_flow_node);
+ AXIS2_MODULE_DESC_SET_OUTFLOW(builder_impl->module, env, flow);
+ }
+
+ qinfaultflow = axis2_qname_create(env, AXIS2_IN_FAILTFLOW, NULL, NULL);
+ in_fault_flow_element = AXIS2_OM_ELEMENT_GET_FIRST_CHILD_WITH_QNAME(module_element,
+ env, qinfaultflow, module_node, &in_fault_flow_node);
+ if(NULL != in_fault_flow_element && NULL != in_fault_flow_node)
+ {
+ axis2_flow_t *flow = AXIS2_DESC_BUILDER_PROCESS_FLOW(module_builder->
+ desc_builder, env, in_fault_flow_element, builder_impl->module->
+ params, in_fault_flow_node);
+ AXIS2_MODULE_DESC_SET_FAULT_INFLOW(builder_impl->module, env, flow);
+ }
+
+ qoutfaultflow = axis2_qname_create(env, AXIS2_OUT_FAILTFLOW, NULL, NULL);
+ out_fault_flow_element = AXIS2_OM_ELEMENT_GET_FIRST_CHILD_WITH_QNAME(module_element,
+ env, qoutfaultflow, module_node, &out_fault_flow_node);
+ if(NULL != out_fault_flow_element && NULL != out_fault_flow_node)
+ {
+ axis2_flow_t *flow = AXIS2_DESC_BUILDER_PROCESS_FLOW(module_builder->
+ desc_builder, env, out_fault_flow_element, builder_impl->module->
+ params, out_fault_flow_node);
+ AXIS2_MODULE_DESC_SET_FAULT_OUTFLOW(builder_impl->module, env, flow);
+ }
+
+ /* processing Operations */
+ qopst = axis2_qname_create(env, AXIS2_OPERATIONST, NULL, NULL);
+ op_itr = AXIS2_OM_ELEMENT_GET_CHILDREN_WITH_QNAME(module_element, env,
+ qopst, module_node);
+
+ ops = axis2_module_builder_process_ops(module_builder, env, op_itr);
+ size = AXIS2_ARRAY_LIST_SIZE(ops, env);
+ for(i = 0; i < size; i++)
+ {
+ axis2_op_t *op = NULL;
+
+ op = (axis2_op_t *) AXIS2_ARRAY_LIST_GET(ops, env, i);
+ AXIS2_MODULE_DESC_ADD_OP(builder_impl->module, env, op);
+ }
+ return AXIS2_SUCCESS;
+}
+
+
+axis2_array_list_t *AXIS2_CALL
+axis2_module_builder_process_ops(axis2_module_builder_t *module_builder,
+ axis2_env_t **env,
+ axis2_om_children_qname_iterator_t *op_itr)
+{
+ axis2_module_builder_impl_t *builder_impl = NULL;
+ axis2_array_list_t *ops = NULL;
+
+ AXIS2_FUNC_PARAM_CHECK(module_builder, env, NULL);
+ AXIS2_PARAM_CHECK((*env)->error, op_itr, NULL);
+ builder_impl = AXIS2_INTF_TO_IMPL(module_builder);
+
+ ops = axis2_array_list_create(env, 10);
+ while(AXIS2_TRUE == AXIS2_OM_CHILDREN_QNAME_ITERATOR_HAS_NEXT(op_itr, env))
+ {
+ axis2_om_element_t *op_element = NULL;
+ axis2_om_node_t *op_node = NULL;
+ axis2_om_attribute_t *op_name_att = NULL;
+ axis2_om_attribute_t *op_mep_att = NULL;
+ axis2_qname_t *qattname = NULL;
+ axis2_char_t *mep_url = NULL;
+ axis2_char_t *op_name = NULL;
+ axis2_qname_t *qopname = NULL;
+ axis2_qname_t *qmsgrecv = NULL;
+ axis2_qname_t *qparamst = NULL;
+ axis2_qname_t *qmodulest = NULL;
+ axis2_qname_t *qmep = NULL;
+ axis2_om_children_qname_iterator_t *params = NULL;
+ axis2_om_children_qname_iterator_t *modules = NULL;
+ axis2_om_element_t *recv_element = NULL;
+ axis2_om_node_t *recv_node = NULL;
+ axis2_phases_info_t *info = NULL;
+ axis2_op_t *op_desc = NULL;
+
+ op_node = (axis2_om_node_t *) AXIS2_OM_CHILDREN_QNAME_ITERATOR_NEXT(
+ op_itr, env);
+ op_element = AXIS2_OM_NODE_GET_DATA_ELEMENT(op_node, env);
+ /* getting operation name */
+ qattname = axis2_qname_create(env, AXIS2_ATTNAME, NULL, NULL);
+ op_name_att = AXIS2_OM_ELEMENT_GET_ATTRIBUTE(op_element, env, qattname);
+ if(NULL == op_name_att)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_OP_NAME_MISSING,
+ AXIS2_FAILURE);
+ return NULL;
+ }
+ qmep = axis2_qname_create(env, AXIS2_MEP, NULL, NULL);
+ op_mep_att = AXIS2_OM_ELEMENT_GET_ATTRIBUTE(op_element, env, qmep);
+ if(NULL != op_mep_att)
+ {
+ mep_url = AXIS2_OM_ATTRIBUTE_GET_VALUE(op_mep_att, env);
+ }
+ if(NULL == mep_url)
+ {
+ /* assuming in-out mep */
+ /* op_descrip = new InOnlyAxisOperation(); */
+ op_desc = axis2_op_create(env);
+ }
+ else
+ {
+ /* op_descrip = AxisOperationFactory.getOperetionDescription(mepURL); */
+ op_desc = axis2_op_create(env);
+ }
+
+ op_name = AXIS2_OM_ATTRIBUTE_GET_VALUE(op_name_att, env);
+ qopname = axis2_qname_create(env, op_name, NULL, NULL);
+ AXIS2_OP_SET_NAME(op_desc, env, qopname);
+ /* Operation parameters */
+ qparamst = axis2_qname_create(env, AXIS2_PARAMETERST, NULL, NULL);
+ params = AXIS2_OM_ELEMENT_GET_CHILDREN_WITH_QNAME(op_element, env,
+ qparamst, op_node);
+ AXIS2_DESC_BUILDER_PROCESS_PARAMS(module_builder->desc_builder, env,
+ params, op_desc->param_container, builder_impl->module->params);
+ /* setting the mep of the operation */
+
+ /* loading the message receivers */
+ qmsgrecv = axis2_qname_create(env, AXIS2_MESSAGERECEIVER, NULL, NULL);
+ recv_element = AXIS2_OM_ELEMENT_GET_FIRST_CHILD_WITH_QNAME(op_element,
+ env, qmsgrecv, op_node, &recv_node);
+ if(NULL != recv_element && NULL != recv_node)
+ {
+ axis2_msg_recv_t *msg_recv = NULL;
+
+ msg_recv = AXIS2_DESC_BUILDER_LOAD_MSG_RECV(module_builder->
+ desc_builder, env, recv_element);
+ AXIS2_OP_SET_MSG_RECEIVER(op_desc, env, msg_recv);
+ }
+ else
+ {
+ axis2_msg_recv_t *msg_recv = NULL;
+ /* setting default message reciver */
+ msg_recv = AXIS2_DESC_BUILDER_LOAD_DEFAULT_MSG_RECV(module_builder->
+ desc_builder, env);
+ AXIS2_OP_SET_MSG_RECEIVER(op_desc, env,msg_recv);
+
+ }
+ /* Process Module Refs */
+ qmodulest = axis2_qname_create(env, AXIS2_MODULEST, NULL, NULL);
+ modules = AXIS2_OM_ELEMENT_GET_CHILDREN_WITH_QNAME(op_element, env,
+ qmodulest, op_node);
+ AXIS2_DESC_BUILDER_PROCESS_OP_MODULE_REFS(module_builder->desc_builder,
+ env, modules, op_desc);
+ /* setting Operation phase */
+ info = AXIS2_DEP_ENGINE_GET_PHASES_INFO(module_builder->desc_builder->
+ engine, env);
+ AXIS2_PHASES_INFO_SET_OP_PHASES(info, env, op_desc);
+
+ /* adding operation */
+ AXIS2_ARRAY_LIST_ADD(ops, env, op_desc);
+
+
+ }
+ return ops;
+}
Modified: webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c?rev=365798&r1=365797&r2=365798&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c Tue Jan 3 18:02:26 2006
@@ -46,7 +46,7 @@
axis2_om_node_t *svc_node);
axis2_array_list_t *
-process_ops(axis2_svc_builder_t *svc_builder,
+axis2_svc_builder_process_ops(axis2_svc_builder_t *svc_builder,
axis2_env_t **env,
axis2_om_children_qname_iterator_t *op_itr);
@@ -427,7 +427,7 @@
}
axis2_array_list_t *
-process_ops(axis2_svc_builder_t *svc_builder,
+axis2_svc_builder_process_ops(axis2_svc_builder_t *svc_builder,
axis2_env_t **env,
axis2_om_children_qname_iterator_t *op_itr)
{
Modified: webservices/axis2/trunk/c/modules/core/description/dll_desc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/dll_desc.c?rev=365798&r1=365797&r2=365798&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/dll_desc.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/dll_desc.c Tue Jan 3 18:02:26 2006
@@ -116,7 +116,11 @@
}
dll_desc_impl->dll_name = NULL;
+ dll_desc_impl->dll_type = 0;
+ dll_desc_impl->load_options = 0;
dll_desc_impl->dl_handler = NULL;
+ dll_desc_impl->create_funct = NULL;
+ dll_desc_impl->delete_funct = NULL;
dll_desc_impl->dll_desc.ops = NULL;
dll_desc_impl->dll_desc.ops = (axis2_dll_desc_ops_t *) AXIS2_MALLOC(
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=365798&r1=365797&r2=365798&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/conf.c (original)
+++ webservices/axis2/trunk/c/modules/core/engine/conf.c Tue Jan 3 18:02:26 2006
@@ -253,6 +253,15 @@
axis2_conf_add_module(axis2_conf_t *conf,
axis2_env_t **env,
struct axis2_module_desc *module);
+
+axis2_status_t AXIS2_CALL
+axis2_conf_set_default_dispatchers(axis2_conf_t *conf,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_conf_set_dispatch_phase(axis2_conf_t *conf,
+ axis2_env_t **env,
+ axis2_phase_t *dispatch);
/************************** End of function prototypes ************************/
@@ -525,6 +534,9 @@
config_impl->conf.ops->add_module =
axis2_conf_add_module;
+ config_impl->conf.ops->set_default_dispatchers =
+ axis2_conf_set_default_dispatchers;
+ config_impl->conf.ops->set_dispatch_phase = axis2_conf_set_dispatch_phase;
return &(config_impl->conf);
}
@@ -1474,5 +1486,152 @@
axis2_hash_set(config_impl->modules, AXIS2_MODULE_DESC_GET_NAME(module, env),
sizeof(axis2_qname_t), module);
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_conf_set_default_dispatchers(axis2_conf_t *conf,
+ axis2_env_t **env)
+{
+ axis2_conf_impl_t *config_impl = NULL;
+ axis2_phase_t *dispatch = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+ axis2_disp_t *add_dispatch = NULL;
+ axis2_disp_t *uri_dispatch = NULL;
+ axis2_disp_t *soap_action_based_dispatch = NULL;
+ axis2_disp_t *soap_msg_body_based_dispatch = NULL;
+ axis2_handler_t *handler = NULL;
+ axis2_phase_t *post_dispatch = NULL;
+ axis2_disp_checker_t *disp_checker = NULL;
+
+ AXIS2_FUNC_PARAM_CHECK(conf, env, AXIS2_FAILURE);
+ config_impl = AXIS2_INTF_TO_IMPL(conf);
+
+ dispatch = axis2_phase_create(env, AXIS2_PHASE_DISPATCH);
+ if(!dispatch)
+ {
+ return AXIS2_FAILURE;
+ }
+ add_dispatch = axis2_addr_disp_create(env);
+ if(!add_dispatch)
+ {
+ return AXIS2_FAILURE;
+ }
+ handler = AXIS2_DISP_GET_BASE(add_dispatch, env);
+ AXIS2_PHASE_ADD_HANDLER_AT(dispatch, env, 0, handler);
+
+ uri_dispatch = axis2_addr_disp_create(env);
+ if(!uri_dispatch)
+ {
+ return AXIS2_FAILURE;
+ }
+ handler = AXIS2_DISP_GET_BASE(uri_dispatch, env);
+ AXIS2_PHASE_ADD_HANDLER_AT(dispatch, env, 1, handler);
+
+ soap_action_based_dispatch = axis2_addr_disp_create(env);
+ if(!soap_action_based_dispatch)
+ {
+ return AXIS2_FAILURE;
+ }
+ handler = AXIS2_DISP_GET_BASE(soap_action_based_dispatch, env);
+ AXIS2_PHASE_ADD_HANDLER_AT(dispatch, env, 2, handler);
+
+ soap_msg_body_based_dispatch = axis2_addr_disp_create(env);
+ if(!soap_msg_body_based_dispatch)
+ {
+ return AXIS2_FAILURE;
+ }
+ handler = AXIS2_DISP_GET_BASE(soap_msg_body_based_dispatch, env);
+ AXIS2_PHASE_ADD_HANDLER_AT(dispatch, env, 3, handler);
+
+ status = AXIS2_ARRAY_LIST_ADD(config_impl->
+ in_phases_upto_and_including_post_dispatch, env, dispatch);
+ if(AXIS2_FAILURE == status)
+ {
+ AXIS2_PHASE_FREE(dispatch, env);
+ return AXIS2_FAILURE;
+ }
+
+ post_dispatch = axis2_phase_create(env, AXIS2_PHASE_POST_DISPATCH);
+ if(NULL == post_dispatch)
+ {
+ AXIS2_PHASE_FREE(dispatch, env);
+ return AXIS2_FAILURE;
+ }
+
+ disp_checker = axis2_disp_checker_create(env, NULL);
+
+ /* TODO uncomment this when instant dispatcher is available */
+ /*
+ InstanceDispatcher instanceDispatcher = new InstanceDispatcher();
+ instanceDispatcher.getHandlerDesc().setParent(this);
+ */
+
+ handler = AXIS2_DISP_CHECKER_GET_BASE(disp_checker, env);
+ AXIS2_PHASE_ADD_HANDLER_AT(post_dispatch, env, 0, handler);
+
+ /*postDispatch.addHandler(instanceDispatcher,1); */
+ status = AXIS2_ARRAY_LIST_ADD(config_impl->
+ in_phases_upto_and_including_post_dispatch, env, post_dispatch);
+ if(AXIS2_FAILURE == status)
+ {
+ AXIS2_PHASE_FREE(dispatch, env);
+ AXIS2_PHASE_FREE(post_dispatch, env);
+ AXIS2_DISP_CHECKER_FREE(disp_checker, env);
+ return AXIS2_FAILURE;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_conf_set_dispatch_phase(axis2_conf_t *conf,
+ axis2_env_t **env,
+ axis2_phase_t *dispatch)
+{
+ axis2_conf_impl_t *config_impl = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+ axis2_handler_t *handler = NULL;
+ axis2_phase_t *post_dispatch = NULL;
+ axis2_disp_checker_t *disp_checker = NULL;
+
+ AXIS2_FUNC_PARAM_CHECK(conf, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, dispatch, AXIS2_FAILURE);
+ config_impl = AXIS2_INTF_TO_IMPL(conf);
+
+ status = AXIS2_ARRAY_LIST_ADD(config_impl->
+ in_phases_upto_and_including_post_dispatch, env, dispatch);
+ if(AXIS2_FAILURE == status)
+ {
+ return AXIS2_FAILURE;
+ }
+
+ post_dispatch = axis2_phase_create(env, AXIS2_PHASE_POST_DISPATCH);
+ if(NULL == post_dispatch)
+ {
+ AXIS2_PHASE_FREE(dispatch, env);
+ return AXIS2_FAILURE;
+ }
+
+ disp_checker = axis2_disp_checker_create(env, NULL);
+
+ /* TODO uncomment this when instant dispatcher is available */
+ /*
+ InstanceDispatcher instanceDispatcher = new InstanceDispatcher();
+ instanceDispatcher.getHandlerDesc().setParent(this);
+ */
+
+ handler = AXIS2_DISP_CHECKER_GET_BASE(disp_checker, env);
+ AXIS2_PHASE_ADD_HANDLER_AT(post_dispatch, env, 0, handler);
+
+ /*postDispatch.addHandler(instanceDispatcher,1); */
+ status = AXIS2_ARRAY_LIST_ADD(config_impl->
+ in_phases_upto_and_including_post_dispatch, env, post_dispatch);
+ if(AXIS2_FAILURE == status)
+ {
+ AXIS2_PHASE_FREE(dispatch, env);
+ AXIS2_PHASE_FREE(post_dispatch, env);
+ AXIS2_DISP_CHECKER_FREE(disp_checker, env);
+ return AXIS2_FAILURE;
+ }
return AXIS2_SUCCESS;
}