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 sa...@apache.org on 2007/03/05 05:11:57 UTC
svn commit: r514539 [8/8] - in /webservices/axis2/trunk/c: include/
modules/core/deployment/ modules/core/description/ modules/core/engine/
modules/core/transport/http/receiver/ modules/core/transport/http/sender/
Modified: webservices/axis2/trunk/c/modules/core/description/svc_grp.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/description/svc_grp.c?view=diff&rev=514539&r1=514538&r2=514539
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/svc_grp.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/svc_grp.c Sun Mar 4 20:11:56 2007
@@ -18,14 +18,8 @@
#include <axis2_svc_grp.h>
#include <axis2_conf_ctx.h>
-/**
- * @brief Service group struct impl
- * Axis2 Service group impl
- */
-typedef struct axis2_svc_grp_impl
+struct axis2_svc_grp
{
- /** base service group with operations */
- axis2_svc_grp_t svc_grp;
/** service group name */
axis2_char_t *svc_grp_name;
/** map of services */
@@ -36,203 +30,65 @@
axis2_conf_t *parent;
/** list of module references */
axis2_array_list_t *module_list;
-}
-axis2_svc_grp_impl_t;
-
-#define AXIS2_INTF_TO_IMPL(svc_grp) ((axis2_svc_grp_impl_t *)svc_grp)
-
-axis2_status_t AXIS2_CALL
-axis2_svc_grp_free(
- axis2_svc_grp_t *svc_grp,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_svc_grp_set_name(
- axis2_svc_grp_t *svc_grp,
- const axis2_env_t *env,
- const axis2_char_t *name);
-
-const axis2_char_t *AXIS2_CALL
-axis2_svc_grp_get_name(
- const axis2_svc_grp_t *svc_grp,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_svc_grp_add_svc(
- axis2_svc_grp_t *svc_grp,
- const axis2_env_t *env,
- axis2_svc_t *svc);
-
-axis2_svc_t *AXIS2_CALL
-axis2_svc_grp_get_svc(
- const axis2_svc_grp_t *svc_grp,
- const axis2_env_t *env,
- const axis2_qname_t *svc_name);
-
-axis2_hash_t *AXIS2_CALL
-axis2_svc_grp_get_all_svcs(
- const axis2_svc_grp_t *svc_grp,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_svc_grp_remove_svc(
- axis2_svc_grp_t *svc_grp,
- const axis2_env_t *env,
- const axis2_qname_t *svc_name);
-
-axis2_status_t AXIS2_CALL
-axis2_svc_grp_add_param(
- axis2_svc_grp_t *svc_grp,
- const axis2_env_t *env,
- axis2_param_t *param);
-
-axis2_param_t *AXIS2_CALL
-axis2_svc_grp_get_param(
- const axis2_svc_grp_t *svc_grp,
- const axis2_env_t *env,
- const axis2_char_t *name);
-
-axis2_array_list_t *AXIS2_CALL
-axis2_svc_grp_get_all_params(
- const axis2_svc_grp_t *svc_grp,
- const axis2_env_t *env);
-
-axis2_bool_t AXIS2_CALL
-axis2_svc_grp_is_param_locked(
- axis2_svc_grp_t *svc_grp,
- const axis2_env_t *env,
- const axis2_char_t *param_name);
-
-axis2_status_t AXIS2_CALL
-axis2_svc_grp_add_module_qname(
- axis2_svc_grp_t *svc_grp,
- const axis2_env_t *env,
- const axis2_qname_t *module_qname);
-
-axis2_conf_t *AXIS2_CALL
-axis2_svc_grp_get_parent(
- const axis2_svc_grp_t *svc_grp,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_svc_grp_set_parent(
- axis2_svc_grp_t *svc_grp,
- const axis2_env_t *env,
- axis2_conf_t *parent);
-
-axis2_status_t AXIS2_CALL
-axis2_svc_grp_engage_module(
- axis2_svc_grp_t *svc_grp,
- const axis2_env_t *env,
- const axis2_qname_t *module_name);
-
-axis2_array_list_t *AXIS2_CALL
-axis2_svc_grp_get_all_module_qnames(
- const axis2_svc_grp_t *svc_grp,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_svc_grp_add_module_ref(
- axis2_svc_grp_t *svc_grp,
- const axis2_env_t *env,
- const axis2_qname_t *moduleref);
-
-axis2_array_list_t *AXIS2_CALL
-axis2_svc_grp_get_all_module_refs(
- const axis2_svc_grp_t *svc_grp,
- const axis2_env_t *env);
-
-axis2_svc_grp_ctx_t *AXIS2_CALL
-axis2_svc_grp_get_svc_grp_ctx(
- const axis2_svc_grp_t *svc_grp,
- const axis2_env_t *env,
- axis2_conf_ctx_t *parent);
+ /** parameter container to hold service related parameters */
+ axis2_param_container_t *param_container;
+};
AXIS2_EXTERN axis2_svc_grp_t *AXIS2_CALL
axis2_svc_grp_create(
const axis2_env_t *env)
{
- axis2_svc_grp_impl_t *svc_grp_impl = NULL;
+ axis2_svc_grp_t *svc_grp = NULL;
AXIS2_ENV_CHECK(env, NULL);
- svc_grp_impl = (axis2_svc_grp_impl_t *)
- AXIS2_MALLOC(env->allocator, sizeof(axis2_svc_grp_impl_t));
+ svc_grp = (axis2_svc_grp_t *)
+ AXIS2_MALLOC(env->allocator, sizeof(axis2_svc_grp_t));
- if (NULL == svc_grp_impl)
+ if (NULL == svc_grp)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- svc_grp_impl->svc_grp.param_container = NULL;
- svc_grp_impl->module_qnames = NULL;
- svc_grp_impl->svcs = NULL;
- svc_grp_impl->svc_grp.ops = NULL;
- svc_grp_impl->parent = NULL;
- svc_grp_impl->svc_grp_name = NULL;
- svc_grp_impl->module_list = NULL;
-
- svc_grp_impl->svc_grp.param_container = axis2_param_container_create(env);
- if (NULL == svc_grp_impl->svc_grp.param_container)
- {
- axis2_svc_grp_free(&(svc_grp_impl->svc_grp), env);
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
+ svc_grp->param_container = NULL;
+ svc_grp->module_qnames = NULL;
+ svc_grp->svcs = NULL;
+ svc_grp->parent = NULL;
+ svc_grp->svc_grp_name = NULL;
+ svc_grp->module_list = NULL;
- svc_grp_impl->module_qnames = axis2_array_list_create(env, 20);
- if (NULL == svc_grp_impl->module_qnames)
+ svc_grp->param_container = axis2_param_container_create(env);
+ if (NULL == svc_grp->param_container)
{
- axis2_svc_grp_free(&(svc_grp_impl->svc_grp), env);
+ axis2_svc_grp_free(svc_grp, env);
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- svc_grp_impl->module_list = axis2_array_list_create(env, 0);
- if (NULL == svc_grp_impl->module_list)
+ svc_grp->module_qnames = axis2_array_list_create(env, 20);
+ if (NULL == svc_grp->module_qnames)
{
- axis2_svc_grp_free(&(svc_grp_impl->svc_grp), env);
+ axis2_svc_grp_free(svc_grp, env);
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- svc_grp_impl->svcs = axis2_hash_make(env);
- if (NULL == svc_grp_impl->svcs)
+ svc_grp->module_list = axis2_array_list_create(env, 0);
+ if (NULL == svc_grp->module_list)
{
- axis2_svc_grp_free(&(svc_grp_impl->svc_grp), env);
+ axis2_svc_grp_free(svc_grp, env);
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- svc_grp_impl->svc_grp.ops = AXIS2_MALLOC(env->allocator,
- sizeof(axis2_svc_grp_ops_t));
- if (NULL == svc_grp_impl->svc_grp.ops)
+ svc_grp->svcs = axis2_hash_make(env);
+ if (NULL == svc_grp->svcs)
{
- AXIS2_FREE(env->allocator, svc_grp_impl);
+ axis2_svc_grp_free(svc_grp, env);
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- svc_grp_impl->svc_grp.ops->free = axis2_svc_grp_free;
- svc_grp_impl->svc_grp.ops->set_name = axis2_svc_grp_set_name;
- svc_grp_impl->svc_grp.ops->get_name = axis2_svc_grp_get_name;
- svc_grp_impl->svc_grp.ops->add_svc = axis2_svc_grp_add_svc;
- svc_grp_impl->svc_grp.ops->get_svc = axis2_svc_grp_get_svc;
- svc_grp_impl->svc_grp.ops->get_all_svcs = axis2_svc_grp_get_all_svcs;
- svc_grp_impl->svc_grp.ops->remove_svc = axis2_svc_grp_remove_svc;
- svc_grp_impl->svc_grp.ops->add_param = axis2_svc_grp_add_param;
- svc_grp_impl->svc_grp.ops->get_param = axis2_svc_grp_get_param;
- svc_grp_impl->svc_grp.ops->get_all_params = axis2_svc_grp_get_all_params;
- svc_grp_impl->svc_grp.ops->is_param_locked = axis2_svc_grp_is_param_locked;
- svc_grp_impl->svc_grp.ops->add_module_qname = axis2_svc_grp_add_module_qname;
- svc_grp_impl->svc_grp.ops->get_parent = axis2_svc_grp_get_parent;
- svc_grp_impl->svc_grp.ops->set_parent = axis2_svc_grp_set_parent;
- svc_grp_impl->svc_grp.ops->engage_module = axis2_svc_grp_engage_module;
- svc_grp_impl->svc_grp.ops->get_all_module_qnames = axis2_svc_grp_get_all_module_qnames;
- svc_grp_impl->svc_grp.ops->add_module_ref = axis2_svc_grp_add_module_ref;
- svc_grp_impl->svc_grp.ops->get_all_module_refs = axis2_svc_grp_get_all_module_refs;
- svc_grp_impl->svc_grp.ops->get_svc_grp_ctx = axis2_svc_grp_get_svc_grp_ctx;
-
- return &(svc_grp_impl->svc_grp);
+ return svc_grp;
}
AXIS2_EXTERN axis2_svc_grp_t *AXIS2_CALL
@@ -240,36 +96,26 @@
const axis2_env_t *env,
axis2_conf_t *conf)
{
- axis2_svc_grp_impl_t *svc_grp_impl = NULL;
+ axis2_svc_grp_t *svc_grp = NULL;
AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, conf, NULL);
- svc_grp_impl = (axis2_svc_grp_impl_t *) axis2_svc_grp_create(env);
- if (svc_grp_impl)
- svc_grp_impl->parent = conf;
+ svc_grp = (axis2_svc_grp_t *) axis2_svc_grp_create(env);
+ if (svc_grp)
+ svc_grp->parent = conf;
- return &(svc_grp_impl->svc_grp);
+ return svc_grp;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_svc_grp_free(
axis2_svc_grp_t *svc_grp,
const axis2_env_t *env)
{
- axis2_svc_grp_impl_t *svc_grp_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- svc_grp_impl = AXIS2_INTF_TO_IMPL(svc_grp);
-
- if (svc_grp->ops)
- {
- AXIS2_FREE(env->allocator, svc_grp->ops);
- svc_grp->ops = NULL;
- }
-
if (svc_grp->param_container)
{
AXIS2_PARAM_CONTAINER_FREE(svc_grp->param_container,
@@ -277,54 +123,51 @@
svc_grp->param_container = NULL;
}
- if (svc_grp_impl->svc_grp_name)
+ if (svc_grp->svc_grp_name)
{
- AXIS2_FREE(env->allocator, svc_grp_impl->svc_grp_name);
- svc_grp_impl->svc_grp_name = NULL;
+ AXIS2_FREE(env->allocator, svc_grp->svc_grp_name);
+ svc_grp->svc_grp_name = NULL;
}
- if (svc_grp_impl->svcs)
+ if (svc_grp->svcs)
{
/* services are freed by arch_file_data */
- axis2_hash_free(svc_grp_impl->svcs, env);
- svc_grp_impl->svcs = NULL;
+ axis2_hash_free(svc_grp->svcs, env);
+ svc_grp->svcs = NULL;
}
- if (svc_grp_impl->module_qnames)
+ if (svc_grp->module_qnames)
{
- AXIS2_ARRAY_LIST_FREE(svc_grp_impl->module_qnames, env);
- svc_grp_impl->module_qnames = NULL;
+ AXIS2_ARRAY_LIST_FREE(svc_grp->module_qnames, env);
+ svc_grp->module_qnames = NULL;
}
- if (svc_grp_impl->module_list)
+ if (svc_grp->module_list)
{
- AXIS2_ARRAY_LIST_FREE(svc_grp_impl->module_list, env);
- svc_grp_impl->module_list = NULL;
+ AXIS2_ARRAY_LIST_FREE(svc_grp->module_list, env);
+ svc_grp->module_list = NULL;
}
- if (svc_grp_impl)
+ if (svc_grp)
{
- AXIS2_FREE(env->allocator, svc_grp_impl);
- svc_grp_impl = NULL;
+ AXIS2_FREE(env->allocator, svc_grp);
+ svc_grp = NULL;
}
return AXIS2_SUCCESS;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_svc_grp_set_name(
axis2_svc_grp_t *svc_grp,
const axis2_env_t *env,
const axis2_char_t *name)
{
- axis2_svc_grp_impl_t *svc_grp_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- svc_grp_impl = AXIS2_INTF_TO_IMPL(svc_grp);
- if (svc_grp_impl->svc_grp_name)
- AXIS2_FREE(env->allocator, svc_grp_impl->svc_grp_name);
- svc_grp_impl->svc_grp_name = AXIS2_STRDUP(name, env);
- if (!svc_grp_impl->svc_grp_name)
+ if (svc_grp->svc_grp_name)
+ AXIS2_FREE(env->allocator, svc_grp->svc_grp_name);
+ svc_grp->svc_grp_name = AXIS2_STRDUP(name, env);
+ if (!svc_grp->svc_grp_name)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return AXIS2_FAILURE;
@@ -333,23 +176,22 @@
return AXIS2_SUCCESS;
}
-const axis2_char_t *AXIS2_CALL
+AXIS2_EXTERN const axis2_char_t *AXIS2_CALL
axis2_svc_grp_get_name(
const axis2_svc_grp_t *svc_grp,
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, NULL);
- return AXIS2_INTF_TO_IMPL(svc_grp)->svc_grp_name;
+ return svc_grp->svc_grp_name;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_svc_grp_add_svc(
axis2_svc_grp_t *svc_grp,
const axis2_env_t *env,
axis2_svc_t *svc)
{
- axis2_svc_grp_impl_t *svc_grp_impl = NULL;
axis2_phase_resolver_t *handler_resolver = NULL;
axis2_status_t status = AXIS2_FAILURE;
const axis2_qname_t *svc_qname = NULL;
@@ -358,25 +200,23 @@
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, svc, AXIS2_FAILURE);
- svc_grp_impl = AXIS2_INTF_TO_IMPL(svc_grp);
-
- if (!svc_grp_impl->svcs)
+ if (!svc_grp->svcs)
{
- svc_grp_impl->svcs = axis2_hash_make(env);
- if (!svc_grp_impl->svcs)
+ svc_grp->svcs = axis2_hash_make(env);
+ if (!svc_grp->svcs)
return AXIS2_FAILURE;
}
svc_qname = AXIS2_SVC_GET_QNAME(svc, env);
svc_name = AXIS2_QNAME_TO_STRING((axis2_qname_t *)svc_qname, env);
- axis2_hash_set(svc_grp_impl->svcs, svc_name, AXIS2_HASH_KEY_STRING, svc);
+ axis2_hash_set(svc_grp->svcs, svc_name, AXIS2_HASH_KEY_STRING, svc);
handler_resolver = axis2_phase_resolver_create_with_config_and_svc(env,
- svc_grp_impl->parent, svc);
+ svc_grp->parent, svc);
if (NULL == handler_resolver)
{
/* remove the previously added service */
- axis2_hash_set(svc_grp_impl->svcs, svc_name, AXIS2_HASH_KEY_STRING,
+ axis2_hash_set(svc_grp->svcs, svc_name, AXIS2_HASH_KEY_STRING,
NULL);
return AXIS2_FAILURE;
@@ -386,7 +226,7 @@
if (AXIS2_SUCCESS != status)
{
/* remove the previously added service */
- axis2_hash_set(svc_grp_impl->svcs, svc_name, AXIS2_HASH_KEY_STRING, NULL);
+ axis2_hash_set(svc_grp->svcs, svc_name, AXIS2_HASH_KEY_STRING, NULL);
AXIS2_PHASE_RESOLVER_FREE(handler_resolver, env);
return status;
}
@@ -395,7 +235,7 @@
if (AXIS2_SUCCESS != status)
{
/* remove the previously added service */
- axis2_hash_set(svc_grp_impl->svcs, svc_name, AXIS2_HASH_KEY_STRING, NULL);
+ axis2_hash_set(svc_grp->svcs, svc_name, AXIS2_HASH_KEY_STRING, NULL);
AXIS2_PHASE_RESOLVER_FREE(handler_resolver, env);
return status;
}
@@ -404,7 +244,7 @@
if (AXIS2_SUCCESS != status)
{
/* remove the previously added service */
- axis2_hash_set(svc_grp_impl->svcs, svc_name, AXIS2_HASH_KEY_STRING, NULL);
+ axis2_hash_set(svc_grp->svcs, svc_name, AXIS2_HASH_KEY_STRING, NULL);
AXIS2_PHASE_RESOLVER_FREE(handler_resolver, env);
return status;
}
@@ -413,34 +253,32 @@
return status;
}
-axis2_svc_t *AXIS2_CALL
+AXIS2_EXTERN axis2_svc_t *AXIS2_CALL
axis2_svc_grp_get_svc(
const axis2_svc_grp_t *svc_grp,
const axis2_env_t *env,
const axis2_qname_t *qname)
{
- axis2_svc_grp_impl_t *svc_grp_impl = NULL;
axis2_char_t *name = NULL;
AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, qname, NULL);
- svc_grp_impl = AXIS2_INTF_TO_IMPL(svc_grp);
name = AXIS2_QNAME_TO_STRING((axis2_qname_t *)qname, env);
- return (axis2_svc_t *) axis2_hash_get(svc_grp_impl->svcs, name,
+ return (axis2_svc_t *) axis2_hash_get(svc_grp->svcs, name,
AXIS2_HASH_KEY_STRING);
}
-axis2_hash_t *AXIS2_CALL
+AXIS2_EXTERN axis2_hash_t *AXIS2_CALL
axis2_svc_grp_get_all_svcs(
const axis2_svc_grp_t *svc_grp,
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, NULL);
- return AXIS2_INTF_TO_IMPL(svc_grp)->svcs;
+ return svc_grp->svcs;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_svc_grp_remove_svc(
axis2_svc_grp_t *svc_grp,
const axis2_env_t *env,
@@ -455,13 +293,13 @@
svc = axis2_svc_grp_get_svc(svc_grp, env, svc_qname);
svc_name = AXIS2_QNAME_TO_STRING((axis2_qname_t *)svc_qname, env);
- axis2_hash_set(AXIS2_INTF_TO_IMPL(svc_grp)->svcs, svc_name,
+ axis2_hash_set(svc_grp->svcs, svc_name,
AXIS2_HASH_KEY_STRING, NULL);
return AXIS2_SUCCESS;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_svc_grp_add_param(
axis2_svc_grp_t *svc_grp,
const axis2_env_t *env,
@@ -485,28 +323,25 @@
return AXIS2_FAILURE;
}
-axis2_param_t *AXIS2_CALL
+AXIS2_EXTERN axis2_param_t *AXIS2_CALL
axis2_svc_grp_get_param(
const axis2_svc_grp_t *svc_grp,
const axis2_env_t *env,
const axis2_char_t *name)
{
axis2_param_t *param = NULL;
- axis2_svc_grp_impl_t *svc_grp_impl = NULL;
-
AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, name, NULL);
- svc_grp_impl = AXIS2_INTF_TO_IMPL(svc_grp);
param = AXIS2_PARAM_CONTAINER_GET_PARAM(svc_grp->param_container, env, name);
- if (param == NULL && svc_grp_impl->parent)
+ if (param == NULL && svc_grp->parent)
{
- param = AXIS2_CONF_GET_PARAM(svc_grp_impl->parent, env, name);
+ param = AXIS2_CONF_GET_PARAM(svc_grp->parent, env, name);
}
return param;
}
-axis2_array_list_t *AXIS2_CALL
+AXIS2_EXTERN axis2_array_list_t *AXIS2_CALL
axis2_svc_grp_get_all_params(
const axis2_svc_grp_t *svc_grp,
const axis2_env_t *env)
@@ -516,7 +351,7 @@
return AXIS2_PARAM_CONTAINER_GET_PARAMS(svc_grp->param_container, env);
}
-axis2_bool_t AXIS2_CALL
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
axis2_svc_grp_is_param_locked(
axis2_svc_grp_t *svc_grp,
const axis2_env_t *env,
@@ -552,7 +387,7 @@
return ret;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_svc_grp_add_module_qname(
axis2_svc_grp_t *svc_grp,
const axis2_env_t *env,
@@ -560,45 +395,41 @@
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- return AXIS2_ARRAY_LIST_ADD(AXIS2_INTF_TO_IMPL(svc_grp)->module_qnames, env,
+ return AXIS2_ARRAY_LIST_ADD(svc_grp->module_qnames, env,
module_qname);
}
-axis2_conf_t *AXIS2_CALL
+AXIS2_EXTERN axis2_conf_t *AXIS2_CALL
axis2_svc_grp_get_parent(
const axis2_svc_grp_t *svc_grp,
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, NULL);
- return AXIS2_INTF_TO_IMPL(svc_grp)->parent;
+ return svc_grp->parent;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_svc_grp_set_parent(
axis2_svc_grp_t *svc_grp,
const axis2_env_t *env,
axis2_conf_t *parent)
{
- axis2_svc_grp_impl_t *svc_grp_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, parent, AXIS2_FAILURE);
- svc_grp_impl = AXIS2_INTF_TO_IMPL(svc_grp);
- if (svc_grp_impl->parent)
- AXIS2_CONF_FREE(svc_grp_impl->parent, env);
- svc_grp_impl->parent = parent;
+ if (svc_grp->parent)
+ AXIS2_CONF_FREE(svc_grp->parent, env);
+ svc_grp->parent = parent;
return AXIS2_SUCCESS;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_svc_grp_engage_module(
axis2_svc_grp_t *svc_grp,
const axis2_env_t *env,
const axis2_qname_t *module_name)
{
- axis2_svc_grp_impl_t *svc_grp_impl = NULL;
int i = 0;
axis2_status_t status = AXIS2_FAILURE;
axis2_qname_t *modu = NULL;
@@ -613,15 +444,14 @@
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, module_name, AXIS2_FAILURE);
- svc_grp_impl = AXIS2_INTF_TO_IMPL(svc_grp);
- size = AXIS2_ARRAY_LIST_SIZE(svc_grp_impl->module_qnames, env);
+ size = AXIS2_ARRAY_LIST_SIZE(svc_grp->module_qnames, env);
if (AXIS2_TRUE != AXIS2_ERROR_GET_STATUS_CODE(env->error))
{
return AXIS2_FAILURE;
}
for (i = 0; size; i++)
{
- modu = AXIS2_ARRAY_LIST_GET(svc_grp_impl->module_qnames, env, i);
+ modu = AXIS2_ARRAY_LIST_GET(svc_grp->module_qnames, env, i);
modu_local = AXIS2_QNAME_GET_LOCALPART(modu, env);
module_name_local = AXIS2_QNAME_GET_LOCALPART(module_name, env);
if (0 == AXIS2_STRCMP(modu_local, module_name_local))
@@ -638,7 +468,7 @@
return AXIS2_FAILURE;
}
- phase_resolver = axis2_phase_resolver_create_with_config(env, svc_grp_impl->
+ phase_resolver = axis2_phase_resolver_create_with_config(env, svc_grp->
parent);
if (NULL == phase_resolver)
@@ -646,7 +476,7 @@
return AXIS2_FAILURE;
}
- module = AXIS2_CONF_GET_MODULE(svc_grp_impl->parent, env, module_name);
+ module = AXIS2_CONF_GET_MODULE(svc_grp->parent, env, module_name);
if (module)
{
axis2_svc_t *axis_svc = NULL;
@@ -680,48 +510,45 @@
return axis2_svc_grp_add_module_qname(svc_grp, env, module_name);
}
-axis2_array_list_t *AXIS2_CALL
+AXIS2_EXTERN axis2_array_list_t *AXIS2_CALL
axis2_svc_grp_get_all_module_qnames(
const axis2_svc_grp_t *svc_grp,
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, NULL);
- return AXIS2_INTF_TO_IMPL(svc_grp)->module_qnames;
+ return svc_grp->module_qnames;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_svc_grp_add_module_ref(
axis2_svc_grp_t *svc_grp,
const axis2_env_t *env,
const axis2_qname_t *moduleref)
{
- axis2_svc_grp_impl_t *svc_grp_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, moduleref, AXIS2_FAILURE);
- svc_grp_impl = AXIS2_INTF_TO_IMPL(svc_grp);
- if (!svc_grp_impl->module_list)
+ if (!svc_grp->module_list)
{
- svc_grp_impl->module_list = axis2_array_list_create(env, 0);
- if (!svc_grp_impl->module_list)
+ svc_grp->module_list = axis2_array_list_create(env, 0);
+ if (!svc_grp->module_list)
return AXIS2_FAILURE;
}
- return AXIS2_ARRAY_LIST_ADD(svc_grp_impl->module_list, env, moduleref);
+ return AXIS2_ARRAY_LIST_ADD(svc_grp->module_list, env, moduleref);
}
-axis2_array_list_t *AXIS2_CALL
+AXIS2_EXTERN axis2_array_list_t *AXIS2_CALL
axis2_svc_grp_get_all_module_refs(
const axis2_svc_grp_t *svc_grp,
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, NULL);
- return AXIS2_INTF_TO_IMPL(svc_grp)->module_list;
+ return svc_grp->module_list;
}
-axis2_svc_grp_ctx_t *AXIS2_CALL
+AXIS2_EXTERN axis2_svc_grp_ctx_t *AXIS2_CALL
axis2_svc_grp_get_svc_grp_ctx(
const axis2_svc_grp_t *svc_grp,
const axis2_env_t *env,
@@ -739,3 +566,12 @@
}
return svc_grp_ctx;
}
+
+AXIS2_EXTERN axis2_param_container_t *AXIS2_CALL
+axis2_svc_grp_get_param_container(const axis2_svc_grp_t *svc_grp,
+ const axis2_env_t *env)
+{
+ return svc_grp->param_container;
+}
+
+
Modified: webservices/axis2/trunk/c/modules/core/description/transport_in_desc.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/description/transport_in_desc.c?view=diff&rev=514539&r1=514538&r2=514539
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/transport_in_desc.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/transport_in_desc.c Sun Mar 4 20:11:56 2007
@@ -18,9 +18,8 @@
#include <axis2_transport_in_desc.h>
#include <axis2_transport_receiver.h>
-typedef struct axis2_transport_in_desc_impl
+struct axis2_transport_in_desc
{
- axis2_transport_in_desc_t transport_in;
axis2_flow_t *in_flow;
axis2_flow_t *fault_in_flow;
AXIS2_TRANSPORT_ENUMS trans_enum;
@@ -31,182 +30,45 @@
axis2_transport_receiver_t *recv;
axis2_phase_t *in_phase;
axis2_phase_t *fault_phase;
-}
-axis2_transport_in_desc_impl_t;
-
-#define AXIS2_INTF_TO_IMPL(transport_in) ((axis2_transport_in_desc_impl_t *)transport_in)
-
-axis2_status_t AXIS2_CALL
-axis2_transport_in_desc_free(
- axis2_transport_in_desc_t *transport_in,
- const axis2_env_t *env);
-
-AXIS2_TRANSPORT_ENUMS AXIS2_CALL
-axis2_transport_in_desc_get_enum(
- const axis2_transport_in_desc_t *transport_in,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_transport_in_desc_set_enum(
- axis2_transport_in_desc_t *transport_in,
- const axis2_env_t *env,
- const AXIS2_TRANSPORT_ENUMS trans_enum);
-
-axis2_flow_t *AXIS2_CALL
-axis2_transport_in_desc_get_in_flow(
- const axis2_transport_in_desc_t *transport_in,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_transport_in_desc_set_in_flow(
- axis2_transport_in_desc_t *transport_in,
- const axis2_env_t *env,
- axis2_flow_t *in_flow);
-
-axis2_flow_t *AXIS2_CALL
-axis2_transport_in_desc_get_fault_in_flow(
- const axis2_transport_in_desc_t *transport_in,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_transport_in_desc_set_fault_in_flow(
- axis2_transport_in_desc_t *transport_in,
- const axis2_env_t *env,
- axis2_flow_t *fault_in_flow);
-
-axis2_transport_receiver_t *AXIS2_CALL
-axis2_transport_in_desc_get_recv(
- const axis2_transport_in_desc_t *transport_in,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_transport_in_desc_set_recv(
- axis2_transport_in_desc_t *transport_in,
- const axis2_env_t *env,
- axis2_transport_receiver_t *recv);
-
-axis2_phase_t *AXIS2_CALL
-axis2_transport_in_desc_get_in_phase(
- const axis2_transport_in_desc_t *transport_in,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_transport_in_desc_set_in_phase(
- axis2_transport_in_desc_t *transport_in,
- const axis2_env_t *env,
- axis2_phase_t *in_phase);
-
-axis2_phase_t *AXIS2_CALL
-axis2_transport_in_desc_get_fault_phase(
- const axis2_transport_in_desc_t *transport_in,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_transport_in_desc_set_fault_phase(
- axis2_transport_in_desc_t *transport_in,
- const axis2_env_t *env,
- axis2_phase_t *fault_phase);
-
-axis2_status_t AXIS2_CALL
-axis2_transport_in_desc_add_param(
- axis2_transport_in_desc_t *transport_in_desc,
- const axis2_env_t *env,
- axis2_param_t *param);
-
-axis2_param_t *AXIS2_CALL
-axis2_transport_in_desc_get_param(
- const axis2_transport_in_desc_t *transport_in_desc,
- const axis2_env_t *env,
- const axis2_char_t *param_name);
-
-axis2_bool_t AXIS2_CALL
-axis2_transport_in_desc_is_param_locked(
- axis2_transport_in_desc_t *
- transport_in_desc,
- const axis2_env_t *env,
- const axis2_char_t *param_name);
-
+ /** parameter container to hold transport in related parameters */
+ axis2_param_container_t *param_container;
+};
AXIS2_EXTERN axis2_transport_in_desc_t *AXIS2_CALL
axis2_transport_in_desc_create(
const axis2_env_t *env,
const AXIS2_TRANSPORT_ENUMS trans_enum)
{
- axis2_transport_in_desc_impl_t *transport_in_impl = NULL;
+ axis2_transport_in_desc_t *transport_in = NULL;
AXIS2_ENV_CHECK(env, NULL);
- transport_in_impl = (axis2_transport_in_desc_impl_t *) AXIS2_MALLOC(env->
- allocator, sizeof(axis2_transport_in_desc_impl_t));
+ transport_in = (axis2_transport_in_desc_t *) AXIS2_MALLOC(env->
+ allocator, sizeof(axis2_transport_in_desc_t));
- if (NULL == transport_in_impl)
+ if (NULL == transport_in)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- transport_in_impl->trans_enum = trans_enum;
- transport_in_impl->in_phase = NULL;
- transport_in_impl->fault_phase = NULL;
- transport_in_impl->in_flow = NULL;
- transport_in_impl->fault_in_flow = NULL;
- transport_in_impl->recv = NULL;
- transport_in_impl->transport_in.ops = NULL;
- transport_in_impl->transport_in.param_container = NULL;
-
- transport_in_impl->transport_in.param_container = axis2_param_container_create(env);
- if (NULL == transport_in_impl->transport_in.param_container)
- {
- axis2_transport_in_desc_free(&(transport_in_impl->transport_in), env);
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
+ transport_in->trans_enum = trans_enum;
+ transport_in->in_phase = NULL;
+ transport_in->fault_phase = NULL;
+ transport_in->in_flow = NULL;
+ transport_in->fault_in_flow = NULL;
+ transport_in->recv = NULL;
+ transport_in->param_container = NULL;
- transport_in_impl->transport_in.ops =
- AXIS2_MALLOC(env->allocator, sizeof(axis2_transport_in_desc_ops_t));
- if (NULL == transport_in_impl->transport_in.ops)
+ transport_in->param_container = axis2_param_container_create(env);
+ if (NULL == transport_in->param_container)
{
- axis2_transport_in_desc_free(&(transport_in_impl->transport_in), env);
+ axis2_transport_in_desc_free(transport_in, env);
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- transport_in_impl->transport_in.ops->free = axis2_transport_in_desc_free;
- transport_in_impl->transport_in.ops->free_void_arg =
- axis2_transport_in_desc_free_void_arg;
-
- transport_in_impl->transport_in.ops->get_enum =
- axis2_transport_in_desc_get_enum;
- transport_in_impl->transport_in.ops->set_enum =
- axis2_transport_in_desc_set_enum;
- transport_in_impl->transport_in.ops->get_in_flow =
- axis2_transport_in_desc_get_in_flow;
- transport_in_impl->transport_in.ops->set_in_flow =
- axis2_transport_in_desc_set_in_flow;
- transport_in_impl->transport_in.ops->get_fault_in_flow =
- axis2_transport_in_desc_get_fault_in_flow;
- transport_in_impl->transport_in.ops->set_fault_in_flow =
- axis2_transport_in_desc_set_fault_in_flow;
- transport_in_impl->transport_in.ops->get_recv =
- axis2_transport_in_desc_get_recv;
- transport_in_impl->transport_in.ops->set_recv =
- axis2_transport_in_desc_set_recv;
- transport_in_impl->transport_in.ops->get_in_phase =
- axis2_transport_in_desc_get_in_phase;
- transport_in_impl->transport_in.ops->set_in_phase =
- axis2_transport_in_desc_set_in_phase;
- transport_in_impl->transport_in.ops->get_fault_phase =
- axis2_transport_in_desc_get_fault_phase;
- transport_in_impl->transport_in.ops->set_fault_phase =
- axis2_transport_in_desc_set_fault_phase;
- transport_in_impl->transport_in.ops->add_param =
- axis2_transport_in_desc_add_param;
- transport_in_impl->transport_in.ops->get_param =
- axis2_transport_in_desc_get_param;
- transport_in_impl->transport_in.ops->is_param_locked =
- axis2_transport_in_desc_is_param_locked;
-
- return &(transport_in_impl->transport_in);
+ return transport_in;
}
@@ -215,22 +77,12 @@
axis2_transport_in_desc_t *transport_in,
const axis2_env_t *env)
{
- axis2_transport_in_desc_impl_t *transport_in_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- transport_in_impl = AXIS2_INTF_TO_IMPL(transport_in);
-
- if (transport_in_impl->recv)
- {
- AXIS2_TRANSPORT_RECEIVER_FREE(transport_in_impl->recv, env);
- transport_in_impl->recv = NULL;
- }
-
- if (transport_in->ops)
+ if (transport_in->recv)
{
- AXIS2_FREE(env->allocator, transport_in->ops);
- transport_in->ops = NULL;
+ AXIS2_TRANSPORT_RECEIVER_FREE(transport_in->recv, env);
+ transport_in->recv = NULL;
}
if (transport_in->param_container)
@@ -239,31 +91,31 @@
transport_in->param_container = NULL;
}
- if (transport_in_impl->in_flow)
+ if (transport_in->in_flow)
{
- AXIS2_FLOW_FREE(transport_in_impl->in_flow, env);
- transport_in_impl->in_flow = NULL;
+ AXIS2_FLOW_FREE(transport_in->in_flow, env);
+ transport_in->in_flow = NULL;
}
- if (transport_in_impl->fault_in_flow)
+ if (transport_in->fault_in_flow)
{
- AXIS2_FLOW_FREE(transport_in_impl->fault_in_flow, env);
- transport_in_impl->fault_in_flow = NULL;
+ AXIS2_FLOW_FREE(transport_in->fault_in_flow, env);
+ transport_in->fault_in_flow = NULL;
}
- if (transport_in_impl->in_phase)
+ if (transport_in->in_phase)
{
- AXIS2_FLOW_FREE(transport_in_impl->in_phase, env);
- transport_in_impl->in_phase = NULL;
+ AXIS2_PHASE_FREE(transport_in->in_phase, env);
+ transport_in->in_phase = NULL;
}
- if (transport_in_impl->fault_phase)
+ if (transport_in->fault_phase)
{
- AXIS2_FLOW_FREE(transport_in_impl->fault_phase, env);
- transport_in_impl->fault_phase = NULL;
+ AXIS2_PHASE_FREE(transport_in->fault_phase, env);
+ transport_in->fault_phase = NULL;
}
- AXIS2_FREE(env->allocator, transport_in_impl);
+ AXIS2_FREE(env->allocator, transport_in);
return AXIS2_SUCCESS;
}
@@ -287,7 +139,7 @@
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, NULL);
- return AXIS2_INTF_TO_IMPL(transport_in)->trans_enum;
+ return transport_in->trans_enum;
}
axis2_status_t AXIS2_CALL
@@ -296,13 +148,9 @@
const axis2_env_t *env,
const AXIS2_TRANSPORT_ENUMS trans_enum)
{
- axis2_transport_in_desc_impl_t *transport_in_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- transport_in_impl = AXIS2_INTF_TO_IMPL(transport_in);
-
- transport_in_impl->trans_enum = trans_enum;
+ transport_in->trans_enum = trans_enum;
return AXIS2_SUCCESS;
}
@@ -312,7 +160,7 @@
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, NULL);
- return AXIS2_INTF_TO_IMPL(transport_in)->in_flow;
+ return transport_in->in_flow;
}
axis2_status_t AXIS2_CALL
@@ -321,17 +169,15 @@
const axis2_env_t *env,
axis2_flow_t *in_flow)
{
- axis2_transport_in_desc_impl_t *transport_in_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, in_flow, AXIS2_FAILURE);
- transport_in_impl = AXIS2_INTF_TO_IMPL(transport_in);
- if (transport_in_impl->in_flow)
+ if (transport_in->in_flow)
{
- AXIS2_FLOW_FREE(transport_in_impl->in_flow, env);
- transport_in_impl->in_flow = NULL;
+ AXIS2_FLOW_FREE(transport_in->in_flow, env);
+ transport_in->in_flow = NULL;
}
- transport_in_impl->in_flow = in_flow;
+ transport_in->in_flow = in_flow;
return AXIS2_SUCCESS;
}
@@ -340,7 +186,7 @@
const axis2_transport_in_desc_t *transport_in,
const axis2_env_t *env)
{
- return AXIS2_INTF_TO_IMPL(transport_in)->fault_in_flow;
+ return transport_in->fault_in_flow;
}
axis2_status_t AXIS2_CALL
@@ -349,17 +195,15 @@
const axis2_env_t *env,
axis2_flow_t *fault_in_flow)
{
- axis2_transport_in_desc_impl_t *transport_in_impl = AXIS2_INTF_TO_IMPL(transport_in);
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, fault_in_flow, AXIS2_FAILURE);
- transport_in_impl = AXIS2_INTF_TO_IMPL(transport_in);
- if (transport_in_impl->fault_in_flow)
+ if (transport_in->fault_in_flow)
{
- AXIS2_FLOW_FREE(transport_in_impl->fault_in_flow, env);
- transport_in_impl->fault_in_flow = NULL;
+ AXIS2_FLOW_FREE(transport_in->fault_in_flow, env);
+ transport_in->fault_in_flow = NULL;
}
- transport_in_impl->fault_in_flow = fault_in_flow;
+ transport_in->fault_in_flow = fault_in_flow;
return AXIS2_SUCCESS;
}
@@ -369,7 +213,7 @@
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, NULL);
- return AXIS2_INTF_TO_IMPL(transport_in)->recv;
+ return transport_in->recv;
}
axis2_status_t AXIS2_CALL
@@ -378,19 +222,16 @@
const axis2_env_t *env,
axis2_transport_receiver_t *recv)
{
- axis2_transport_in_desc_impl_t *transport_in_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, recv, AXIS2_FAILURE);
- transport_in_impl = AXIS2_INTF_TO_IMPL(transport_in);
-
- if (transport_in_impl->recv)
+ if (transport_in->recv)
{
- AXIS2_TRANSPORT_RECEIVER_FREE(transport_in_impl->recv, env);
- transport_in_impl->recv = NULL;
+ AXIS2_TRANSPORT_RECEIVER_FREE(transport_in->recv, env);
+ transport_in->recv = NULL;
}
- transport_in_impl->recv = recv;
+ transport_in->recv = recv;
return AXIS2_SUCCESS;
}
@@ -401,7 +242,7 @@
{
AXIS2_ENV_CHECK(env, NULL);
- return AXIS2_INTF_TO_IMPL(transport_in)->in_phase;
+ return transport_in->in_phase;
}
axis2_status_t AXIS2_CALL
@@ -410,18 +251,15 @@
const axis2_env_t *env,
axis2_phase_t *in_phase)
{
- axis2_transport_in_desc_impl_t *transport_in_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, in_phase, AXIS2_FAILURE);
- transport_in_impl = AXIS2_INTF_TO_IMPL(transport_in);
- if (transport_in_impl->in_phase)
+ if (transport_in->in_phase)
{
- AXIS2_FLOW_FREE(transport_in_impl->in_phase, env);
- transport_in_impl->in_phase = NULL;
+ AXIS2_PHASE_FREE(transport_in->in_phase, env);
+ transport_in->in_phase = NULL;
}
- transport_in_impl->in_phase = in_phase;
+ transport_in->in_phase = in_phase;
return AXIS2_SUCCESS;
}
@@ -432,7 +270,7 @@
{
AXIS2_ENV_CHECK(env, NULL);
- return AXIS2_INTF_TO_IMPL(transport_in)->fault_phase;
+ return transport_in->fault_phase;
}
axis2_status_t AXIS2_CALL
@@ -441,18 +279,15 @@
const axis2_env_t *env,
axis2_phase_t *fault_phase)
{
- axis2_transport_in_desc_impl_t *transport_in_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, fault_phase, AXIS2_FAILURE);
- transport_in_impl = AXIS2_INTF_TO_IMPL(transport_in);
- if (transport_in_impl->fault_phase)
+ if (transport_in->fault_phase)
{
- AXIS2_FLOW_FREE(transport_in_impl->fault_phase, env);
- transport_in_impl->fault_phase = NULL;
+ AXIS2_PHASE_FREE(transport_in->fault_phase, env);
+ transport_in->fault_phase = NULL;
}
- transport_in_impl->fault_phase = fault_phase;
+ transport_in->fault_phase = fault_phase;
return AXIS2_SUCCESS;
}
@@ -496,3 +331,11 @@
return AXIS2_PARAM_CONTAINER_IS_PARAM_LOCKED(transport_in_desc->
param_container, env, param_name);
}
+
+AXIS2_EXTERN axis2_param_container_t *AXIS2_CALL
+axis2_transport_in_desc_param_container(const axis2_transport_in_desc_t *transport_in_desc,
+ const axis2_env_t *env)
+{
+ return transport_in_desc->param_container;
+}
+
Modified: webservices/axis2/trunk/c/modules/core/description/transport_out_desc.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/description/transport_out_desc.c?view=diff&rev=514539&r1=514538&r2=514539
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/transport_out_desc.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/transport_out_desc.c Sun Mar 4 20:11:56 2007
@@ -17,190 +17,53 @@
#include <axis2_transport_out_desc.h>
-typedef struct axis2_transport_out_desc_impl
+struct axis2_transport_out_desc
{
- axis2_transport_out_desc_t transport_out;
axis2_flow_t *out_flow;
axis2_flow_t *fault_out_flow;
AXIS2_TRANSPORT_ENUMS trans_enum;
axis2_transport_sender_t *sender;
axis2_phase_t *out_phase;
axis2_phase_t *fault_phase;
-}
-axis2_transport_out_desc_impl_t;
-
-#define AXIS2_INTF_TO_IMPL(transport_out) ((axis2_transport_out_desc_impl_t *)transport_out)
-
-axis2_status_t AXIS2_CALL
-axis2_transport_out_desc_free(
- axis2_transport_out_desc_t *transport_out,
- const axis2_env_t *env);
-
-AXIS2_TRANSPORT_ENUMS AXIS2_CALL
-axis2_transport_out_desc_get_enum(
- const axis2_transport_out_desc_t *transport_out,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_transport_out_desc_set_enum(
- axis2_transport_out_desc_t *transport_out,
- const axis2_env_t *env,
- const AXIS2_TRANSPORT_ENUMS trans_enum);
-
-axis2_flow_t *AXIS2_CALL
-axis2_transport_out_desc_get_out_flow(
- const axis2_transport_out_desc_t *transport_out,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_transport_out_desc_set_out_flow(
- axis2_transport_out_desc_t *transport_out,
- const axis2_env_t *env,
- axis2_flow_t *out_flow);
-
-axis2_flow_t *AXIS2_CALL
-axis2_transport_out_desc_get_fault_out_flow(
- const axis2_transport_out_desc_t *transport_out,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_transport_out_desc_set_fault_out_flow(
- axis2_transport_out_desc_t *transport_out,
- const axis2_env_t *env,
- axis2_flow_t *fault_out_flow);
-
-axis2_transport_sender_t *AXIS2_CALL
-axis2_transport_out_desc_get_sender(
- const axis2_transport_out_desc_t *transport_out,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_transport_out_desc_set_sender(
- axis2_transport_out_desc_t *transport_out,
- const axis2_env_t *env,
- axis2_transport_sender_t *sender);
-
-axis2_phase_t *AXIS2_CALL
-axis2_transport_out_desc_get_out_phase(
- const axis2_transport_out_desc_t *transport_out,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_transport_out_desc_set_out_phase(
- axis2_transport_out_desc_t *transport_out,
- const axis2_env_t *env,
- axis2_phase_t *out_phase);
-
-axis2_phase_t *AXIS2_CALL
-axis2_transport_out_desc_get_fault_phase(
- const axis2_transport_out_desc_t *transport_out,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_transport_out_desc_set_fault_phase(
- axis2_transport_out_desc_t *transport_out,
- const axis2_env_t *env,
- axis2_phase_t *fault_phase);
-
-axis2_status_t AXIS2_CALL
-axis2_transport_out_desc_add_param(
- axis2_transport_out_desc_t *transport_out_desc,
- const axis2_env_t *env,
- axis2_param_t *param);
-
-axis2_param_t *AXIS2_CALL
-axis2_transport_out_desc_get_param(
- const axis2_transport_out_desc_t *transport_out_desc,
- const axis2_env_t *env,
- const axis2_char_t *param_name);
-
-axis2_bool_t AXIS2_CALL
-axis2_transport_out_desc_is_param_locked(
- axis2_transport_out_desc_t *
- transport_out_desc,
- const axis2_env_t *env,
- const axis2_char_t *param_name);
+ /** parameter container that holds parameter */
+ axis2_param_container_t *param_container;
+};
AXIS2_EXTERN axis2_transport_out_desc_t *AXIS2_CALL
axis2_transport_out_desc_create(
const axis2_env_t *env,
const AXIS2_TRANSPORT_ENUMS trans_enum)
{
- axis2_transport_out_desc_impl_t *transport_out_impl = NULL;
+ axis2_transport_out_desc_t *transport_out = NULL;
AXIS2_ENV_CHECK(env, NULL);
- transport_out_impl = (axis2_transport_out_desc_impl_t *) AXIS2_MALLOC(env->
- allocator, sizeof(axis2_transport_out_desc_impl_t));
+ transport_out = (axis2_transport_out_desc_t *) AXIS2_MALLOC(env->
+ allocator, sizeof(axis2_transport_out_desc_t));
- if (NULL == transport_out_impl)
+ if (NULL == transport_out)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- transport_out_impl->trans_enum = trans_enum;
- transport_out_impl->out_phase = NULL;
- transport_out_impl->fault_phase = NULL;
- transport_out_impl->out_flow = NULL;
- transport_out_impl->fault_out_flow = NULL;
- transport_out_impl->sender = NULL;
- transport_out_impl->transport_out.ops = NULL;
- transport_out_impl->transport_out.param_container = NULL;
-
- transport_out_impl->transport_out.param_container = axis2_param_container_create(env);
- if (NULL == transport_out_impl->transport_out.param_container)
- {
- axis2_transport_out_desc_free(&(transport_out_impl->transport_out), env);
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
+ transport_out->trans_enum = trans_enum;
+ transport_out->out_phase = NULL;
+ transport_out->fault_phase = NULL;
+ transport_out->out_flow = NULL;
+ transport_out->fault_out_flow = NULL;
+ transport_out->sender = NULL;
+ transport_out->param_container = NULL;
- transport_out_impl->transport_out.ops =
- AXIS2_MALLOC(env->allocator, sizeof(axis2_transport_out_desc_ops_t));
- if (NULL == transport_out_impl->transport_out.ops)
+ transport_out->param_container = axis2_param_container_create(env);
+ if (NULL == transport_out->param_container)
{
- axis2_transport_out_desc_free(&(transport_out_impl->transport_out), env);
+ axis2_transport_out_desc_free(transport_out, env);
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- transport_out_impl->transport_out.ops->free = axis2_transport_out_desc_free;
- transport_out_impl->transport_out.ops->free_void_arg =
- axis2_transport_out_desc_free_void_arg;
-
- transport_out_impl->transport_out.ops->get_enum =
- axis2_transport_out_desc_get_enum;
- transport_out_impl->transport_out.ops->set_enum =
- axis2_transport_out_desc_set_enum;
- transport_out_impl->transport_out.ops->get_out_flow =
- axis2_transport_out_desc_get_out_flow;
- transport_out_impl->transport_out.ops->set_out_flow =
- axis2_transport_out_desc_set_out_flow;
- transport_out_impl->transport_out.ops->get_fault_out_flow =
- axis2_transport_out_desc_get_fault_out_flow;
- transport_out_impl->transport_out.ops->set_fault_out_flow =
- axis2_transport_out_desc_set_fault_out_flow;
- transport_out_impl->transport_out.ops->get_sender =
- axis2_transport_out_desc_get_sender;
- transport_out_impl->transport_out.ops->set_sender =
- axis2_transport_out_desc_set_sender;
- transport_out_impl->transport_out.ops->get_out_phase =
- axis2_transport_out_desc_get_out_phase;
- transport_out_impl->transport_out.ops->set_out_phase =
- axis2_transport_out_desc_set_out_phase;
- transport_out_impl->transport_out.ops->get_fault_phase =
- axis2_transport_out_desc_get_fault_phase;
- transport_out_impl->transport_out.ops->set_fault_phase =
- axis2_transport_out_desc_set_fault_phase;
- transport_out_impl->transport_out.ops->add_param =
- axis2_transport_out_desc_add_param;
- transport_out_impl->transport_out.ops->get_param =
- axis2_transport_out_desc_get_param;
- transport_out_impl->transport_out.ops->is_param_locked =
- axis2_transport_out_desc_is_param_locked;
-
- return &(transport_out_impl->transport_out);
+ return transport_out;
}
axis2_status_t AXIS2_CALL
@@ -208,55 +71,45 @@
axis2_transport_out_desc_t *transport_out,
const axis2_env_t *env)
{
- axis2_transport_out_desc_impl_t *transport_out_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- transport_out_impl = AXIS2_INTF_TO_IMPL(transport_out);
-
- if (transport_out_impl->sender)
+ if (transport_out->sender)
{
- AXIS2_TRANSPORT_SENDER_FREE(transport_out_impl->sender, env);
- transport_out_impl->sender = NULL;
+ AXIS2_TRANSPORT_SENDER_FREE(transport_out->sender, env);
+ transport_out->sender = NULL;
}
- if (transport_out->ops)
+ if (transport_out->param_container)
{
- AXIS2_FREE(env->allocator, transport_out->ops);
- transport_out->ops = NULL;
+ AXIS2_PARAM_CONTAINER_FREE(transport_out->param_container, env);
+ transport_out->param_container = NULL;
}
- if (transport_out_impl->transport_out.param_container)
+ if (transport_out->out_flow)
{
- AXIS2_PARAM_CONTAINER_FREE(transport_out_impl->transport_out.param_container, env);
- transport_out_impl->transport_out.param_container = NULL;
+ AXIS2_FLOW_FREE(transport_out->out_flow, env);
+ transport_out->out_flow = NULL;
}
- if (transport_out_impl->out_flow)
+ if (transport_out->fault_out_flow)
{
- AXIS2_FLOW_FREE(transport_out_impl->out_flow, env);
- transport_out_impl->out_flow = NULL;
+ AXIS2_FLOW_FREE(transport_out->fault_out_flow, env);
+ transport_out->fault_out_flow = NULL;
}
- if (transport_out_impl->fault_out_flow)
+ if (transport_out->out_phase)
{
- AXIS2_FLOW_FREE(transport_out_impl->fault_out_flow, env);
- transport_out_impl->fault_out_flow = NULL;
+ AXIS2_PHASE_FREE(transport_out->out_phase, env);
+ transport_out->out_phase = NULL;
}
- if (transport_out_impl->out_phase)
+ if (transport_out->fault_phase)
{
- AXIS2_FLOW_FREE(transport_out_impl->out_phase, env);
- transport_out_impl->out_phase = NULL;
+ AXIS2_PHASE_FREE(transport_out->fault_phase, env);
+ transport_out->fault_phase = NULL;
}
- if (transport_out_impl->fault_phase)
- {
- AXIS2_FLOW_FREE(transport_out_impl->fault_phase, env);
- transport_out_impl->fault_phase = NULL;
- }
-
- AXIS2_FREE(env->allocator, transport_out_impl);
+ AXIS2_FREE(env->allocator, transport_out);
return AXIS2_SUCCESS;
}
@@ -280,7 +133,7 @@
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, NULL);
- return AXIS2_INTF_TO_IMPL(transport_out)->trans_enum;
+ return transport_out->trans_enum;
}
axis2_status_t AXIS2_CALL
@@ -289,9 +142,8 @@
const axis2_env_t *env,
const AXIS2_TRANSPORT_ENUMS trans_enum)
{
- axis2_transport_out_desc_impl_t *transport_out_impl = AXIS2_INTF_TO_IMPL(transport_out);
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- transport_out_impl->trans_enum = trans_enum;
+ transport_out->trans_enum = trans_enum;
return AXIS2_SUCCESS;
}
@@ -301,7 +153,7 @@
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, NULL);
- return AXIS2_INTF_TO_IMPL(transport_out)->out_flow;
+ return transport_out->out_flow;
}
axis2_status_t AXIS2_CALL
@@ -310,17 +162,15 @@
const axis2_env_t *env,
axis2_flow_t *out_flow)
{
- axis2_transport_out_desc_impl_t *transport_out_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, out_flow, AXIS2_FAILURE);
- transport_out_impl = AXIS2_INTF_TO_IMPL(transport_out);
- if (transport_out_impl->out_flow)
+ if (transport_out->out_flow)
{
- AXIS2_FLOW_FREE(transport_out_impl->out_flow, env);
- transport_out_impl->out_flow = NULL;
+ AXIS2_FLOW_FREE(transport_out->out_flow, env);
+ transport_out->out_flow = NULL;
}
- transport_out_impl->out_flow = out_flow;
+ transport_out->out_flow = out_flow;
return AXIS2_SUCCESS;
}
@@ -329,7 +179,7 @@
const axis2_transport_out_desc_t *transport_out,
const axis2_env_t *env)
{
- return AXIS2_INTF_TO_IMPL(transport_out)->fault_out_flow;
+ return transport_out->fault_out_flow;
}
axis2_status_t AXIS2_CALL
@@ -338,17 +188,15 @@
const axis2_env_t *env,
axis2_flow_t *fault_out_flow)
{
- axis2_transport_out_desc_impl_t *transport_out_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, fault_out_flow, AXIS2_FAILURE);
- transport_out_impl = AXIS2_INTF_TO_IMPL(transport_out);
- if (transport_out_impl->fault_out_flow)
+ if (transport_out->fault_out_flow)
{
- AXIS2_FLOW_FREE(transport_out_impl->fault_out_flow, env);
- transport_out_impl->fault_out_flow = NULL;
+ AXIS2_FLOW_FREE(transport_out->fault_out_flow, env);
+ transport_out->fault_out_flow = NULL;
}
- transport_out_impl->fault_out_flow = fault_out_flow;
+ transport_out->fault_out_flow = fault_out_flow;
return AXIS2_SUCCESS;
}
@@ -358,7 +206,7 @@
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, NULL);
- return AXIS2_INTF_TO_IMPL(transport_out)->sender;
+ return transport_out->sender;
}
axis2_status_t AXIS2_CALL
@@ -367,19 +215,16 @@
const axis2_env_t *env,
axis2_transport_sender_t *sender)
{
- axis2_transport_out_desc_impl_t *transport_out_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, sender, AXIS2_FAILURE);
- transport_out_impl = AXIS2_INTF_TO_IMPL(transport_out);
-
- if (transport_out_impl->sender)
+ if (transport_out->sender)
{
- AXIS2_TRANSPORT_SENDER_FREE(transport_out_impl->sender, env);
- transport_out_impl->sender = NULL;
+ AXIS2_TRANSPORT_SENDER_FREE(transport_out->sender, env);
+ transport_out->sender = NULL;
}
- transport_out_impl->sender = sender;
+ transport_out->sender = sender;
return AXIS2_SUCCESS;
}
@@ -390,7 +235,7 @@
{
AXIS2_ENV_CHECK(env, NULL);
- return AXIS2_INTF_TO_IMPL(transport_out)->out_phase;
+ return transport_out->out_phase;
}
axis2_status_t AXIS2_CALL
@@ -399,18 +244,15 @@
const axis2_env_t *env,
axis2_phase_t *out_phase)
{
- axis2_transport_out_desc_impl_t *transport_out_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, out_phase, AXIS2_FAILURE);
- transport_out_impl = AXIS2_INTF_TO_IMPL(transport_out);
- if (transport_out_impl->out_phase)
+ if (transport_out->out_phase)
{
- AXIS2_FLOW_FREE(transport_out_impl->out_phase, env);
- transport_out_impl->out_phase = NULL;
+ AXIS2_PHASE_FREE(transport_out->out_phase, env);
+ transport_out->out_phase = NULL;
}
- transport_out_impl->out_phase = out_phase;
+ transport_out->out_phase = out_phase;
return AXIS2_SUCCESS;
}
@@ -421,7 +263,7 @@
{
AXIS2_ENV_CHECK(env, NULL);
- return AXIS2_INTF_TO_IMPL(transport_out)->fault_phase;
+ return transport_out->fault_phase;
}
axis2_status_t AXIS2_CALL
@@ -430,18 +272,15 @@
const axis2_env_t *env,
axis2_phase_t *fault_phase)
{
- axis2_transport_out_desc_impl_t *transport_out_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, fault_phase, AXIS2_FAILURE);
- transport_out_impl = AXIS2_INTF_TO_IMPL(transport_out);
- if (transport_out_impl->fault_phase)
+ if (transport_out->fault_phase)
{
- AXIS2_FLOW_FREE(transport_out_impl->fault_phase, env);
- transport_out_impl->fault_phase = NULL;
+ AXIS2_PHASE_FREE(transport_out->fault_phase, env);
+ transport_out->fault_phase = NULL;
}
- transport_out_impl->fault_phase = fault_phase;
+ transport_out->fault_phase = fault_phase;
return AXIS2_SUCCESS;
}
@@ -485,3 +324,11 @@
return AXIS2_PARAM_CONTAINER_IS_PARAM_LOCKED(transport_out_desc->
param_container, env, param_name);
}
+
+AXIS2_EXTERN axis2_param_container_t *AXIS2_CALL
+axis2_transport_out_desc_param_container(const axis2_transport_out_desc_t *transport_out_desc,
+ const axis2_env_t *env)
+{
+ return transport_out_desc->param_container;
+}
+
Modified: webservices/axis2/trunk/c/modules/core/engine/conf.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/engine/conf.c?view=diff&rev=514539&r1=514538&r2=514539
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/conf.c (original)
+++ webservices/axis2/trunk/c/modules/core/engine/conf.c Sun Mar 4 20:11:56 2007
@@ -916,7 +916,7 @@
handler_desc = (axis2_handler_desc_t *)
AXIS2_ARRAY_LIST_GET(config_impl->handlers, env, i);
if (handler_desc)
- AXIS2_HANDLER_FREE(handler_desc, env);
+ AXIS2_HANDLER_DESC_FREE(handler_desc, env);
handler_desc = NULL;
Modified: webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_receiver.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_receiver.c?view=diff&rev=514539&r1=514538&r2=514539
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_receiver.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_receiver.c Sun Mar 4 20:11:56 2007
@@ -194,7 +194,8 @@
server_impl->conf_ctx = conf_ctx;
param = (axis2_param_t *)AXIS2_PARAM_CONTAINER_GET_PARAM(
- in_desc->param_container, env, "port");
+ axis2_transport_in_desc_param_container(in_desc, env),
+ env, "port");
if (param)
{
port_str = AXIS2_PARAM_GET_VALUE(param, env);
Modified: webservices/axis2/trunk/c/modules/core/transport/http/sender/http_sender.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/sender/http_sender.c?view=diff&rev=514539&r1=514538&r2=514539
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/sender/http_sender.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/sender/http_sender.c Sun Mar 4 20:11:56 2007
@@ -555,11 +555,11 @@
axis2_http_sender_util_add_header (env, request, AXIS2_HTTP_HEADER_CONTENT_TYPE, content_type);
- if (content_type)
+ /*if (content_type)
{
AXIS2_FREE(env->allocator, content_type);
content_type = NULL;
- }
+ }*/
}
if (0 == AXIS2_STRCMP(sender_impl->http_version,
@@ -947,8 +947,9 @@
return AXIS2_FAILURE;
}
- proxy_param = AXIS2_PARAM_CONTAINER_GET_PARAM(trans_desc->param_container,
- env, AXIS2_HTTP_PROXY);
+ proxy_param = AXIS2_PARAM_CONTAINER_GET_PARAM(
+ axis2_transport_out_desc_param_container(trans_desc, env),
+ env, AXIS2_HTTP_PROXY);
if (proxy_param)
{
transport_attrs = AXIS2_PARAM_GET_ATTRIBUTES(proxy_param, env);
Modified: webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c?view=diff&rev=514539&r1=514538&r2=514539
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c Sun Mar 4 20:11:56 2007
@@ -449,7 +449,7 @@
AXIS2_PARAM_CHECK(env->error, out_desc, AXIS2_FAILURE);
version_param = AXIS2_PARAM_CONTAINER_GET_PARAM(
- out_desc->param_container, env,
+ axis2_transport_out_desc_param_container(out_desc, env), env,
AXIS2_HTTP_PROTOCOL_VERSION);
if (version_param)
{
@@ -469,7 +469,7 @@
AXIS2_INTF_TO_IMPL(transport_sender)->http_version = AXIS2_STRDUP(
version, env);
encoding_param = AXIS2_PARAM_CONTAINER_GET_PARAM(
- out_desc->param_container, env,
+ axis2_transport_out_desc_param_container(out_desc, env), env,
AXIS2_HTTP_HEADER_TRANSFER_ENCODING);
if (encoding_param)
{
@@ -506,7 +506,7 @@
temp_param = AXIS2_PARAM_CONTAINER_GET_PARAM(
- out_desc->param_container, env,
+ axis2_transport_out_desc_param_container(out_desc, env), env,
AXIS2_HTTP_SO_TIMEOUT);
if (temp_param)
{
@@ -517,7 +517,7 @@
AXIS2_INTF_TO_IMPL(transport_sender)->so_timeout = AXIS2_ATOI(temp);
}
temp = (axis2_char_t *)AXIS2_PARAM_CONTAINER_GET_PARAM(
- out_desc->param_container, env,
+ axis2_transport_out_desc_param_container(out_desc, env), env,
AXIS2_HTTP_CONNECTION_TIMEOUT);
if (temp_param)
{
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org