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 2005/11/16 05:01:09 UTC
svn commit: r344872 - in /webservices/axis2/trunk/c: include/axis2_flow.h
include/axis2_flow_container.h include/axis2_module_desc.h
modules/core/description/src/flow_container.c
modules/core/description/src/module_desc.c
Author: damitha
Date: Tue Nov 15 20:01:00 2005
New Revision: 344872
URL: http://svn.apache.org/viewcvs?rev=344872&view=rev
Log: (empty)
Added:
webservices/axis2/trunk/c/include/axis2_flow.h
webservices/axis2/trunk/c/include/axis2_flow_container.h
webservices/axis2/trunk/c/include/axis2_module_desc.h
webservices/axis2/trunk/c/modules/core/description/src/flow_container.c
webservices/axis2/trunk/c/modules/core/description/src/module_desc.c
Added: webservices/axis2/trunk/c/include/axis2_flow.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_flow.h?rev=344872&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_flow.h (added)
+++ webservices/axis2/trunk/c/include/axis2_flow.h Tue Nov 15 20:01:00 2005
@@ -0,0 +1,122 @@
+/*
+ * 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_FLOW_H
+#define AXIS2_FLOW_H
+
+/**
+ * @file axis2_flow.h
+ * @brief axis2 flow interface
+ */
+
+#include <axis2.h>
+#include <axis2_error.h>
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axis2_allocator.h>
+#include <axis2_string.h>
+#include <axis2_array_list.h>
+#include <axis2_handler_desc.h>
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+typedef struct axis2_flow_ops_s axis2_flow_ops_t;
+typedef struct axis2_flow_s axis2_flow_t;
+
+
+/** @defgroup axis2_flow Flow
+ * @ingroup axis2_flow
+ * @{
+ */
+
+/**
+ * @brief Flow operations struct
+ * Encapsulator struct for operations of axis2_flow
+ */
+struct axis2_flow_ops_s
+{
+ /** Deallocate memory
+ * @return status code
+ */
+ axis2_status_t (AXIS2_CALL *free) (axis2_flow_t *flow,
+ axis2_env_t **env);
+
+ /**
+ * Add handler description
+ * @param handler handler description
+ */
+ axis2_status_t (AXIS2_CALL *add_handler) (axis2_flow_t *flow,
+ axis2_env_t **env,
+ axis2_handler_desc_t *handler);
+
+ /**
+ * Get handler
+ * @param index index of the handler
+ * @return handler description
+ */
+ axis2_handler_desc_t * (AXIS2_CALL *get_handler) (axis2_flow_t *flow,
+ axis2_env_t **env,
+ int index);
+
+ /**
+ * Get handler count
+ * @return handler count
+ */
+ int (AXIS2_CALL *get_handler_count) (axis2_flow_t *flow,
+ axis2_env_t **env);
+};
+
+/**
+ * @brief Flow struct
+ * Flow
+ */
+struct axis2_flow_s
+{
+ axis2_flow_ops_t *ops;
+};
+
+/**
+ * Creates flow struct
+ * @return pointer to newly created flow
+ */
+AXIS2_DECLARE(axis2_flow_t *)
+axis2_flow_create (axis2_env_t **env);
+
+/*************************** Function macros **********************************/
+
+#define AXIS2_FLOW_FREE(flow, env) ((flow->ops)->free (flow, env))
+
+#define AXIS2_FLOW_ADD_HANDLER(flow, env, param) \
+ ((flow->ops)->add_handler (flow, env, handler))
+
+#define AXIS2_FLOW_GET_HANDLER(flow, env, index) \
+ ((flow->ops)->get_handler (flow, env, index))
+
+#define AXIS2_FLOW_GET_HANDLER_COUNT(flow, env) \
+ ((flow->ops)->get_handler_count (flow, env))
+
+/*************************** End of function macros ***************************/
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* AXIS2_FLOW_H */
Added: webservices/axis2/trunk/c/include/axis2_flow_container.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_flow_container.h?rev=344872&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_flow_container.h (added)
+++ webservices/axis2/trunk/c/include/axis2_flow_container.h Tue Nov 15 20:01:00 2005
@@ -0,0 +1,180 @@
+/*
+ * 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_FLOW_CONTAINER_H
+#define AXIS2_FLOW_CONTAINER_H
+
+/**
+ * @file axis2_flow_container.h
+ * @brief axis2 flow container interface
+ */
+
+#include <axis2.h>
+#include <axis2_error.h>
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axis2_allocator.h>
+#include <axis2_string.h>
+#include <axis2_array_list.h>
+#include <axis2_flow.h>
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+typedef struct axis2_flow_container_ops_s axis2_flow_container_ops_t;
+typedef struct axis2_flow_container_s axis2_flow_container_t;
+
+
+/** @defgroup axis2_flow_container Flow Container
+ * @ingroup axis2_flow_container
+ * @{
+ */
+
+/**
+ * @brief Flow Container operations struct
+ * Encapsulator struct for operations of axis2_flow_container
+ */
+struct axis2_flow_container_ops_s
+{
+ /** Deallocate memory
+ * @return status code
+ */
+ axis2_status_t (AXIS2_CALL *free) (axis2_flow_container_t *flow_container,
+ axis2_env_t **env);
+
+ /**
+ * Get fault out flow
+ * @return in flow
+ */
+ axis2_flow_t *(AXIS2_CALL *get_in_flow)(axis2_flow_container_t *flow_container,
+ axis2_env_t **env);
+
+ /**
+ * Set in flow
+ * @param in_flow in flow
+ */
+ axis2_status_t (AXIS2_CALL *set_in_flow)(
+ axis2_flow_container_t *flow_container,
+ axis2_env_t **env,
+ axis2_flow_t *in_flow);
+
+ /**
+ * Get out flow
+ * @return out flow
+ */
+ axis2_flow_t *(AXIS2_CALL *get_out_flow)(
+ axis2_flow_container_t *flow_container,
+ axis2_env_t **env);
+
+ /**
+ * Set out flow
+ * @param out_flow out flow
+ */
+ axis2_status_t (AXIS2_CALL *set_out_flow)(
+ axis2_flow_container_t *flow_container,
+ axis2_env_t **env,
+ axis2_flow_t *out_flow);
+
+ /**
+ * Get fault in flow
+ * @return fault in flow
+ */
+ axis2_flow_t * (AXIS2_CALL *get_fault_in_flow)(
+ axis2_flow_container_t *flow_container,
+ axis2_env_t **env);
+
+ /**
+ * set fault in flow
+ * @param falut_in_flow falut in flow
+ */
+ axis2_status_t (AXIS2_CALL *set_fault_in_flow)(
+ axis2_flow_container_t *flow_container,
+ axis2_env_t **env,
+ axis2_flow_t *falut_in_flow);
+ /**
+ * Get fault out flow
+ * @return fault out flow
+ */
+ axis2_flow_t *(AXIS2_CALL *get_fault_out_flow)(
+ axis2_flow_container_t *flow_container,
+ axis2_env_t **env);
+
+ /**
+ * Set fault out flow
+ * @param fault_out_flow fault out flow
+ */
+ axis2_status_t (AXIS2_CALL *set_fault_out_flow)(
+ axis2_flow_container_t *flow_container,
+ axis2_env_t **env,
+ axis2_flow_t *fault_out_flow);
+};
+
+/**
+ * @brief Flow container struct
+ * Container for flows
+ */
+struct axis2_flow_container_s
+{
+ axis2_flow_container_ops_t *ops;
+};
+
+/**
+ * Creates flow container struct
+ * @return pointer to newly created flow container
+ */
+AXIS2_DECLARE(axis2_flow_container_t *)
+axis2_flow_container_create (axis2_env_t **env);
+
+/*************************** Function macros **********************************/
+
+#define AXIS2_FLOW_CONTAINER_FREE(flow_container, env) \
+ ((flow_container->ops)->free (flow_container, env))
+
+#define AXIS2_FLOW_CONTAINER_GET_IN_FLOW(flow_container, env) \
+ ((flow_container->ops)->get_in_flow (flow_container, env))
+
+#define AXIS2_FLOW_CONTAINER_SET_IN_FLOW(flow_container, env, in_flow) \
+ ((flow_container->ops)->set_in_flow (flow_container, env, in_flow))
+
+#define AXIS2_FLOW_CONTAINER_GET_OUT_FLOW(flow_container, env) \
+ ((flow_container->ops)->get_out_flow (flow_container, env))
+
+#define AXIS2_FLOW_CONTAINER_SET_OUT_FLOW(flow_container, env, out_flow) \
+ ((flow_container->ops)->set_out_flow (flow_container, env, out_flow))
+
+#define AXIS2_FLOW_CONTAINER_GET_FAULT_IN_FLOW(flow_container, env) \
+ ((flow_container->ops)->get_fault_in_flow (flow_container, env))
+
+#define AXIS2_FLOW_CONTAINER_SET_FAULT_IN_FLOW(flow_container, env, fault_in_flow) \
+ ((flow_container->ops)->set_fault_in_flow (flow_container, env, fault_in_flow))
+
+#define AXIS2_FLOW_CONTAINER_GET_FAULT_OUT_FLOW(flow_container, env) \
+ ((flow_container->ops)->get_fault_out_flow (flow_container, env))
+
+#define AXIS2_FLOW_CONTAINER_SET_FAULT_OUT_FLOW(flow_container, env, fault_out_flow) \
+ ((flow_container->ops)->set_fault_out_flow (flow_container, env, fault_out_flow))
+
+/*************************** End of function macros ***************************/
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* AXIS2_FLOW_CONTAINER_H */
Added: webservices/axis2/trunk/c/include/axis2_module_desc.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_module_desc.h?rev=344872&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_module_desc.h (added)
+++ webservices/axis2/trunk/c/include/axis2_module_desc.h Tue Nov 15 20:01:00 2005
@@ -0,0 +1,98 @@
+/*
+ * 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_DESC_H
+#define AXIS2_MODULE_DESC_H
+
+/**
+ * @file axis2_module_desc.h
+ * @brief axis2 module_desc interface
+ * <p>This holds the information about a Module. </p>
+ * <ol>
+ * <li>parameters<li>
+ * <li>handlers<li>
+ * <ol>
+ * <p>Handler are registered once they are avlible but they avalibe to all
+ * services if axis2.xml has a module ref="." or avalible to a single service
+ * if services.xml have module ref=".."</p>
+ */
+
+#include <axis2.h>
+#include <axis2_error.h>
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axis2_allocator.h>
+#include <axis2_string.h>
+
+#include <axis2_array_list.h>
+#include <axis2_param_container.h>
+#include <axis2_flow_container.h>
+#include <axis2_param.h>
+#include <axis2_operation.h>
+#include <axis2_engine_config.h>
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+typedef struct axis2_module_desc_ops_s axis2_module_desc_ops_t;
+typedef struct axis2_module_desc_s axis2_module_desc_t;
+
+
+/** @defgroup axis2_module_desc Module Description
+ * @ingroup axis2_module_desc
+ * @{
+ */
+
+/**
+ * @brief Module Description operations struct
+ * Encapsulator struct for operations of axis2_module_desc
+ */
+struct axis2_module_desc_ops_s
+{
+};
+
+/**
+ * @brief Module Description struct
+ * Axis2 Module Description
+ */
+struct axis2_module_desc_s
+{
+ axis2_module_desc_ops_t *ops;
+
+};
+
+/** create Module Description struct
+ * @return pointer to newly created module description
+ */
+AXIS2_DECLARE(axis2_module_desc_t *)
+axis2_module_desc_create (axis2_env_t **env);
+
+/** create Module Description struct
+ * @return pointer to newly created module description
+ */
+AXIS2_DECLARE(axis2_module_desc_t *)
+axis2_module_desc_create_with_qname (axis2_env_t **env,
+ axis2_qname_t *qname);
+
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* AXIS2_MODULE_DESC_H */
Added: webservices/axis2/trunk/c/modules/core/description/src/flow_container.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/src/flow_container.c?rev=344872&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/src/flow_container.c (added)
+++ webservices/axis2/trunk/c/modules/core/description/src/flow_container.c Tue Nov 15 20:01:00 2005
@@ -0,0 +1,280 @@
+/*
+ * 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_flow_container.h>
+
+/**
+ * @brief Flow container struct impl
+ * Container for flows
+ */
+typedef struct axis2_flow_container_impl_s
+{
+ axis2_flow_container_t flow_container;
+ /**
+ * Field in
+ */
+ axis2_flow_t *in;
+ /**
+ * Field out
+ */
+ axis2_flow_t *out;
+ /**
+ * Field fault
+ */
+ axis2_flow_t *in_fault;
+
+ axis2_flow_t *out_fault;
+
+} axis2_flow_container_impl_t;
+
+#define AXIS2_INTF_TO_IMPL(flow_container) \
+ ((axis2_flow_container_impl_t *)flow_container)
+
+/************************* Function prototypes ********************************/
+
+axis2_status_t AXIS2_CALL
+axis2_flow_container_free(axis2_flow_container_t *flow_container,
+ axis2_env_t **env);
+
+axis2_flow_t *AXIS2_CALL
+axis2_flow_container_get_in_flow(axis2_flow_container_t *flow_container,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_flow_container_set_in_flow(axis2_flow_container_t *flow_container,
+ axis2_env_t **env,
+ axis2_flow_t *in_flow);
+
+axis2_flow_t *AXIS2_CALL
+axis2_flow_container_get_out_flow(axis2_flow_container_t *flow_container,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_flow_container_set_out_flow(axis2_flow_container_t *flow_container,
+ axis2_env_t **env,
+ axis2_flow_t *out_flow);
+
+axis2_flow_t * AXIS2_CALL
+axis2_flow_container_get_fault_in_flow(axis2_flow_container_t *flow_container,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_flow_container_set_fault_in_flow(axis2_flow_container_t *flow_container,
+ axis2_env_t **env,
+ axis2_flow_t *falut_in_flow);
+
+axis2_flow_t *AXIS2_CALL
+axis2_flow_container_get_fault_out_flow(axis2_flow_container_t *flow_container,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_flow_container_set_fault_out_flow(axis2_flow_container_t *flow_container,
+ axis2_env_t **env,
+ axis2_flow_t *fault_out_flow);
+
+/************************** End of function prototypes ************************/
+
+axis2_flow_container_t * AXIS2_CALL
+axis2_flow_container_create (axis2_env_t **env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+
+ axis2_flow_container_impl_t *flow_container_impl =
+ (axis2_flow_container_impl_t *) AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_flow_container_impl_t));
+
+
+ if(NULL == flow_container_impl)
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+
+ flow_container_impl->flow_container.ops =
+ AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_flow_container_ops_t));
+ if(NULL == flow_container_impl->flow_container.ops)
+ {
+ AXIS2_FREE((*env)->allocator, flow_container_impl);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ }
+
+ flow_container_impl->flow_container.ops->free = axis2_flow_container_free;
+ flow_container_impl->flow_container.ops->get_in_flow =
+ axis2_flow_container_get_in_flow;
+ flow_container_impl->flow_container.ops->set_in_flow =
+ axis2_flow_container_set_in_flow;
+ flow_container_impl->flow_container.ops->get_out_flow =
+ axis2_flow_container_get_out_flow;
+ flow_container_impl->flow_container.ops->set_out_flow =
+ axis2_flow_container_set_out_flow;
+ flow_container_impl->flow_container.ops->get_fault_in_flow =
+ axis2_flow_container_get_fault_in_flow;
+ flow_container_impl->flow_container.ops->set_fault_in_flow =
+ axis2_flow_container_set_fault_in_flow;
+ flow_container_impl->flow_container.ops->get_fault_out_flow =
+ axis2_flow_container_get_fault_out_flow;
+ flow_container_impl->flow_container.ops->set_fault_out_flow =
+ axis2_flow_container_set_fault_out_flow;
+
+
+ flow_container_impl->in = axis2_flow_create(env);
+ flow_container_impl->out = axis2_flow_create(env);
+ flow_container_impl->in_fault = axis2_flow_create(env);
+ flow_container_impl->out_fault = axis2_flow_create(env);
+
+ if(NULL == flow_container_impl->in || NULL == flow_container_impl->out
+ || NULL == flow_container_impl->in_fault
+ || NULL == flow_container_impl->out_fault)
+ {
+ AXIS2_FLOW_FREE(flow_container_impl->in, env);
+ AXIS2_FLOW_FREE(flow_container_impl->out, env);
+ AXIS2_FLOW_FREE(flow_container_impl->in_fault, env);
+ AXIS2_FLOW_FREE(flow_container_impl->out_fault, env);
+ }
+
+ return &(flow_container_impl->flow_container);
+}
+
+/*************************** Start of operation impls *************************/
+
+axis2_status_t AXIS2_CALL
+axis2_flow_container_free(axis2_flow_container_t *flow_container,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(flow_container, env, AXIS2_FAILURE);
+
+ if(NULL != flow_container->ops)
+ AXIS2_FREE((*env)->allocator, flow_container->ops);
+
+ if(NULL != AXIS2_INTF_TO_IMPL(flow_container)->in)
+ AXIS2_FLOW_FREE(AXIS2_INTF_TO_IMPL(flow_container)->in, env);
+
+ if(NULL != AXIS2_INTF_TO_IMPL(flow_container)->out)
+ AXIS2_FLOW_FREE(AXIS2_INTF_TO_IMPL(flow_container)->out, env);
+
+ if(NULL != AXIS2_INTF_TO_IMPL(flow_container)->in_fault)
+ AXIS2_FLOW_FREE(AXIS2_INTF_TO_IMPL(flow_container)->in_fault, env);
+
+ if(NULL != AXIS2_INTF_TO_IMPL(flow_container)->out_fault)
+ AXIS2_FLOW_FREE(AXIS2_INTF_TO_IMPL(flow_container)->out_fault, env);
+
+ AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(flow_container));
+
+ return AXIS2_SUCCESS;
+}
+
+/**
+ * Get fault out flow
+ * @return in flow
+ */
+axis2_flow_t *AXIS2_CALL
+axis2_flow_container_get_in_flow(axis2_flow_container_t *flow_container,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(flow_container, env, NULL);
+ return AXIS2_INTF_TO_IMPL(flow_container)->in;
+}
+
+/**
+ * Set in flow
+ * @param in_flow in flow
+ */
+axis2_status_t AXIS2_CALL
+axis2_flow_container_set_in_flow(axis2_flow_container_t *flow_container,
+ axis2_env_t **env,
+ axis2_flow_t *in_flow)
+{
+ AXIS2_FUNC_PARAM_CHECK(flow_container, env, AXIS2_FAILURE);
+ AXIS2_INTF_TO_IMPL(flow_container)->in = in_flow;
+ return AXIS2_SUCCESS;
+}
+
+/**
+ * Get out flow
+ * @return out flow
+ */
+axis2_flow_t *AXIS2_CALL
+axis2_flow_container_get_out_flow(axis2_flow_container_t *flow_container,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(flow_container, env, NULL);
+ return AXIS2_INTF_TO_IMPL(flow_container)->out;
+}
+
+/**
+ * Set out flow
+ * @param out_flow out flow
+ */
+axis2_status_t AXIS2_CALL
+axis2_flow_container_set_out_flow(axis2_flow_container_t *flow_container,
+ axis2_env_t **env,
+ axis2_flow_t *out_flow)
+{
+ AXIS2_FUNC_PARAM_CHECK(flow_container, env, AXIS2_FAILURE);
+ AXIS2_INTF_TO_IMPL(flow_container)->out = out_flow;
+ return AXIS2_SUCCESS;
+}
+
+/**
+ * Get fault in flow
+ * @return fault in flow
+ */
+axis2_flow_t * AXIS2_CALL
+axis2_flow_container_get_fault_in_flow(axis2_flow_container_t *flow_container,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(flow_container, env, NULL);
+ return AXIS2_INTF_TO_IMPL(flow_container)->in_fault;
+}
+
+/**
+ * set fault in flow
+ * @param falut_in_flow falut in flow
+ */
+axis2_status_t AXIS2_CALL
+axis2_flow_container_set_fault_in_flow(axis2_flow_container_t *flow_container,
+ axis2_env_t **env,
+ axis2_flow_t *falut_in_flow)
+{
+ AXIS2_FUNC_PARAM_CHECK(flow_container, env, AXIS2_FAILURE);
+ AXIS2_INTF_TO_IMPL(flow_container)->in_fault = falut_in_flow;
+ return AXIS2_SUCCESS;
+}
+
+/**
+ * Get fault out flow
+ * @return fault out flow
+ */
+axis2_flow_t *AXIS2_CALL
+axis2_flow_container_get_fault_out_flow(axis2_flow_container_t *flow_container,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(flow_container, env, NULL);
+ return AXIS2_INTF_TO_IMPL(flow_container)->out_fault;
+}
+
+/**
+ * Set fault out flow
+ * @param fault_out_flow fault out flow
+ */
+axis2_status_t AXIS2_CALL
+axis2_flow_container_set_fault_out_flow(axis2_flow_container_t *flow_container,
+ axis2_env_t **env,
+ axis2_flow_t *fault_out_flow)
+{
+ AXIS2_FUNC_PARAM_CHECK(flow_container, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, fault_out_flow, AXIS2_FAILURE);
+
+ AXIS2_INTF_TO_IMPL(flow_container)->out_fault = fault_out_flow;
+ return AXIS2_SUCCESS;
+}
Added: webservices/axis2/trunk/c/modules/core/description/src/module_desc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/src/module_desc.c?rev=344872&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/src/module_desc.c (added)
+++ webservices/axis2/trunk/c/modules/core/description/src/module_desc.c Tue Nov 15 20:01:00 2005
@@ -0,0 +1,440 @@
+/*
+ * 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_desc.h>
+
+/**
+ * @brief Module Descripton struct impl
+ * Module Descripton
+ */
+typedef struct axis2_module_desc_impl_s
+{
+ axis2_module_desc_t module_desc;
+
+ axis2_qname_t *qname;
+
+ axis2_engine_config_t *parent;
+
+ axis2_flow_container_t *flow_container;
+
+ axis2_param_container_t *params;
+
+ /**
+ * To store module opeartions , which are suppose to be added to a service
+ * if it is engaged to a service
+ */
+ axis2_hash_t *operations;
+
+} axis2_module_desc_impl_t;
+
+#define AXIS2_INTF_TO_IMPL(module_desc) ((axis2_module_desc_impl_t *)module_desc)
+
+/************************* Function prototypes ********************************/
+
+axis2_status_t AXIS2_CALL
+axis2_module_desc_free(axis2_module_desc_t *module_desc,
+ axis2_env_t **env);
+
+
+/************************** End of function prototypes ************************/
+
+axis2_module_desc_t * AXIS2_CALL
+axis2_module_desc_create (axis2_env_t **env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+
+ axis2_module_desc_impl_t *module_desc_impl =
+ (axis2_module_desc_impl_t *) AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_module_desc_impl_t));
+
+ if(NULL == module_desc_impl)
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+
+ module_desc_impl->params = axis2_param_container_create(env);
+ if(NULL == module_desc_impl->params)
+ {
+ AXIS2_FREE((*env)->allocator, module_desc_impl);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ }
+
+ module_desc_impl->flow_container = axis2_flow_container_create(env);
+ if(NULL == module_desc_impl->flow_container)
+ {
+ AXIS2_PARAM_CONTAINER_FREE(module_desc_impl->params, env);
+ AXIS2_FREE((*env)->allocator, module_desc_impl);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ }
+
+ module_desc_impl->operations = axis2_hash_make(env);
+ if(NULL == module_desc_impl->operations)
+ {
+ AXIS2_PARAM_CONTAINER_FREE(module_desc_impl->params, env);
+ AXIS2_FLOW_CONTAINER_FREE(module_desc_impl->flow_container, env);
+ AXIS2_FREE((*env)->allocator, module_desc_impl);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ }
+
+ module_desc_impl->module_desc.ops =
+ AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_module_desc_ops_t));
+ if(NULL == module_desc_impl->module_desc.ops)
+ {
+ AXIS2_PARAM_CONTAINER_FREE(module_desc_impl->params, env);
+ AXIS2_FLOW_CONTAINER_FREE(module_desc_impl->flow_container, env);
+ axis2_hash_free(module_desc_impl->operations, env);
+ AXIS2_FREE((*env)->allocator, module_desc_impl);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ }
+
+ /*module_desc_impl->module_desc.ops->free = axis2_module_desc_free;*/
+
+ module_desc_impl->qname = NULL;
+
+ module_desc_impl->parent = NULL;
+
+ return &(module_desc_impl->module_desc);
+}
+
+axis2_module_desc_t * AXIS2_CALL
+axis2_module_desc_create_with_qname (axis2_env_t **env, axis2_qname_t *qname)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+ AXIS2_PARAM_CHECK((*env)->error, qname, NULL);
+
+ axis2_module_desc_impl_t *module_desc_impl =
+ AXIS2_INTF_TO_IMPL(axis2_module_desc_create(env));
+ if(NULL == module_desc_impl)
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+
+ module_desc_impl->qname = qname;
+
+ return &(module_desc_impl->module_desc);
+}
+
+
+/*************************** Start of operation impls *************************/
+
+axis2_status_t AXIS2_CALL
+axis2_module_desc_free(axis2_module_desc_t *module_desc,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(module_desc, env, AXIS2_FAILURE);
+
+ if(NULL != module_desc->ops)
+ AXIS2_FREE((*env)->allocator, module_desc->ops);
+
+ if(NULL == AXIS2_INTF_TO_IMPL(module_desc)->params)
+ AXIS2_PARAM_CONTAINER_FREE(AXIS2_INTF_TO_IMPL(module_desc)->params, env);
+
+ if(NULL == AXIS2_INTF_TO_IMPL(module_desc)->flow_container)
+ AXIS2_FLOW_CONTAINER_FREE(AXIS2_INTF_TO_IMPL(module_desc)->flow_container, env);
+
+ if(NULL != AXIS2_INTF_TO_IMPL(module_desc)->parent)
+ AXIS2_ENGINE_CONFIG_FREE(AXIS2_INTF_TO_IMPL(module_desc)->parent, env);
+
+ if(NULL != AXIS2_INTF_TO_IMPL(module_desc)->qname)
+ AXIS2_QNAME_FREE(AXIS2_INTF_TO_IMPL(module_desc)->qname, env);
+
+ if(NULL != AXIS2_INTF_TO_IMPL(module_desc)->operations)
+ axis2_hash_free(AXIS2_INTF_TO_IMPL(module_desc)->operations, env);
+
+ AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(module_desc));
+
+ return AXIS2_SUCCESS;
+}
+
+/**
+ * Get fault out flow
+ * @return in flow
+ */
+axis2_flow_t *AXIS2_CALL
+axis2_module_desc_get_in_flow(axis2_module_desc_t *module_desc,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(module_desc, env, NULL);
+
+ return AXIS2_FLOW_CONTAINER_GET_IN_FLOW(AXIS2_INTF_TO_IMPL(module_desc)-> \
+ flow_container, env);
+}
+
+/**
+ * Set in flow
+ * @param in_flow in flow
+ */
+axis2_status_t AXIS2_CALL
+axis2_module_desc_set_in_flow(axis2_module_desc_t *module_desc,
+ axis2_env_t **env,
+ axis2_flow_t *in_flow)
+{
+ AXIS2_FUNC_PARAM_CHECK(module_desc, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, in_flow, AXIS2_FAILURE);
+
+ return AXIS2_FLOW_CONTAINER_SET_IN_FLOW(AXIS2_INTF_TO_IMPL(module_desc)-> \
+ flow_container, env, in_flow);
+}
+
+/**
+ * Get out flow
+ * @return out flow
+ */
+axis2_flow_t *AXIS2_CALL
+axis2_module_desc_get_out_flow(axis2_module_desc_t *module_desc,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(module_desc, env, NULL);
+
+ return AXIS2_FLOW_CONTAINER_GET_OUT_FLOW(AXIS2_INTF_TO_IMPL(module_desc)-> \
+ flow_container, env);
+}
+
+/**
+ * Set out flow
+ * @param out_flow out flow
+ */
+axis2_status_t AXIS2_CALL
+axis2_module_desc_set_out_flow(axis2_module_desc_t *module_desc,
+ axis2_env_t **env,
+ axis2_flow_t *out_flow)
+{
+ AXIS2_FUNC_PARAM_CHECK(module_desc, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, out_flow, AXIS2_FAILURE);
+
+ return AXIS2_FLOW_CONTAINER_SET_OUT_FLOW(AXIS2_INTF_TO_IMPL(module_desc)-> \
+ flow_container, env, out_flow);
+}
+
+/**
+ * Get fault in flow
+ * @return fault in flow
+ */
+axis2_flow_t * AXIS2_CALL
+axis2_module_desc_get_fault_in_flow(axis2_module_desc_t *module_desc,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(module_desc, env, NULL);
+
+ return AXIS2_FLOW_CONTAINER_GET_FAULT_IN_FLOW(
+ AXIS2_INTF_TO_IMPL(module_desc)->flow_container, env);
+}
+
+/**
+ * set fault in flow
+ * @param falut_in_flow falut in flow
+ */
+axis2_status_t AXIS2_CALL
+axis2_module_desc_set_fault_in_flow(axis2_module_desc_t *module_desc,
+ axis2_env_t **env,
+ axis2_flow_t *falut_in_flow)
+{
+ AXIS2_FUNC_PARAM_CHECK(module_desc, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, falut_in_flow, AXIS2_FAILURE);
+
+ return AXIS2_FLOW_CONTAINER_SET_FAULT_IN_FLOW(AXIS2_INTF_TO_IMPL(
+ module_desc)->flow_container,env, falut_in_flow);
+}
+
+/**
+ * Get fault out flow
+ * @return fault out flow
+ */
+axis2_flow_t *AXIS2_CALL
+axis2_module_desc_get_fault_out_flow(axis2_module_desc_t *module_desc,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(module_desc, env, NULL);
+ return AXIS2_FLOW_CONTAINER_GET_FAULT_OUT_FLOW(AXIS2_INTF_TO_IMPL(
+ module_desc)->flow_container, env);
+}
+
+/**
+ * Set fault out flow
+ * @param fault_out_flow fault out flow
+ */
+axis2_status_t AXIS2_CALL
+axis2_module_desc_set_fault_out_flow(axis2_module_desc_t *module_desc,
+ axis2_env_t **env,
+ axis2_flow_t *fault_out_flow)
+{
+ AXIS2_FUNC_PARAM_CHECK(module_desc, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, fault_out_flow, AXIS2_FAILURE);
+
+ return AXIS2_FLOW_CONTAINER_SET_FAULT_OUT_FLOW(AXIS2_INTF_TO_IMPL(
+ module_desc)->flow_container, env, fault_out_flow);
+}
+
+/**
+ * @return
+ */
+axis2_qname_t * AXIS2_CALL
+axis2_module_desc_get_name (axis2_module_desc_t *module_desc,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(module_desc, env, NULL);
+
+ return AXIS2_INTF_TO_IMPL(module_desc)->qname;
+}
+
+/**
+ * @param name
+ */
+axis2_status_t AXIS2_CALL
+axis2_module_desc_set_name (axis2_module_desc_t *module_desc,
+ axis2_env_t **env,
+ axis2_qname_t *qname)
+{
+ AXIS2_FUNC_PARAM_CHECK(module_desc, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, qname, AXIS2_FAILURE);
+
+ AXIS2_INTF_TO_IMPL(module_desc)->qname = qname;
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_module_desc_add_operation (axis2_module_desc_t *module_desc,
+ axis2_env_t **env,
+ axis2_operation_t *operation)
+{
+ AXIS2_FUNC_PARAM_CHECK(module_desc, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, operation, AXIS2_FAILURE);
+
+ if (NULL == (AXIS2_INTF_TO_IMPL(module_desc)->operations))
+ {
+ AXIS2_INTF_TO_IMPL(module_desc)->operations = axis2_hash_make (env);
+ }
+
+ axis2_hash_set(AXIS2_INTF_TO_IMPL(module_desc)->operations,
+ AXIS2_OPERATION_GET_NAME(operation, env), sizeof(axis2_qname_t),
+ operation);
+
+ return AXIS2_SUCCESS;
+}
+
+axis2_hash_t * AXIS2_CALL
+axis2_module_desc_get_operations (axis2_module_desc_t *module_desc,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(module_desc, env, NULL);
+ return AXIS2_INTF_TO_IMPL(module_desc)->opeartions;
+}
+
+axis2_engine_config_t * AXIS2_CALL
+axis2_module_desc_get_parent (axis2_module_desc_t *module_desc,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(module_desc, env, NULL);
+ return AXIS2_INTF_TO_IMPL(module_desc)->parent;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_module_desc_set_parent (axis2_module_desc_t *module_desc,
+ axis2_env_t **env,
+ axis2_engine_config_t **parent)
+{
+ AXIS2_FUNC_PARAM_CHECK(module_desc, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, parent, AXIS2_FAILURE);
+ AXIS2_INTF_TO_IMPL(module_desc)->parent = parent;
+}
+
+/**
+ * Add parameter
+ * @param param
+ */
+axis2_status_t AXIS2_CALL
+axis2_module_desc_add_param(module_desc_t *module_desc,
+ axis2_env_t **env,
+ axis2_param_t *param)
+{
+ AXIS2_FUNC_PARAM_CHECK(module_desc, env, AXIS2_FAILURE);
+
+ axis2_char_t *param_name = AXIS2_PARAM_GET_NAME(param, env);
+ if(NULL == param_name)
+ AXIS2_SET_ERROR((*env)->error, AXIS2_ERROR_INVALID_STATE_PARAM,
+ AXIS2_FAILURE);
+ if(axis2_module_desc_is_param_locked(module_desc, env, param_name)
+ {
+ AXIS2_SET_ERROR((*env)->error,
+ AXIS2_ERROR_PARAMETER_LOCKED_CANNOT_OVERRIDE, AXIS2_FAILURE);
+ }
+ else
+ {
+ AXIS2_PARAM_CONTAINER_ADD_PARAM(AXIS2_INTF_TO_IMPL(module_desc)->
+ param_container, env, param);
+ }
+}
+
+/**
+ * @param name
+ * @return parameter
+ */
+axis2_param_t * AXIS2_CALL
+axis2_module_desc_get_param(axis2_module_desc_t *module_desc,
+ axis2_env_t **env,
+ const axis2_char_t *name)
+{
+ AXIS2_FUNC_PARAM_CHECK(module_desc, env, NULL);
+ AXIS2_PARAM_CHECK((*env)->error, name, NULL);
+
+ return AXIS2_PARAM_CONTAINER_GET_PARAM(AXIS2_INTF_TO_IMPL(module_desc)->
+ param_container, env, name)
+}
+
+axis2_array_list_t * AXIS2_CALL
+axis2_module_desc_get_params (axis2_module_desc_t *module_desc,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(module_desc, env, NULL);
+
+ return AXIS2_PARAM_CONTAINER_GET_PARAMS(AXIS2_INTF_TO_IMPL(module_desc)->
+ params, env);
+}
+
+/**
+ * To check whether a given paramter is locked
+ * @param param_name
+ * @return whether parameter is locked
+ */
+axis2_bool_t AXIS2_CALL
+axis2_module_desc_is_param_locked (axis2_module_desc_t module_desc,
+ axis2_env_t **env,
+ const axis2_char_t *param_name)
+{
+ AXIS2_FUNC_PARAM_CHECK(module_desc, env, AXIS2_FALSE);
+ axis2_bool_t locked = AXIS2_FALSE;
+
+ AXIS2_PARAM_CHECK((*env)->error, param_name, AXIS2_FALSE);
+ axis2_char_t *param_name_l = AXIS2_STRDUP(param_name, env);
+ if(NULL == param_name_l)
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FALSE);
+
+ /* checking the locked value of parent*/
+ if(NULL != AXIS2_INTF_TO_IMPL(module_desc)->parent)
+ locked = AXIS2_ENGINE_CONFIG_IS_PARAM_LOCKED(AXIS2_INTF_TO_IMPL(
+ module_desc)->parent, env, param_name_l);
+
+ if(AXIS2_TRUE == locked)
+ {
+ return AXIS2_TRUE;
+ }
+ else
+ {
+ axis2_parem_t param_l = axis2_module_desc_get_param(module_desc, env,
+ param_name_l);
+ if(NULL != param && AXIS2_TRUE == AXIS2_PARAM_IS_LOCKED)
+ return AXIS2_TRUE;
+ else
+ return AXIS2_FALSE;
+
+ }
+}