Author: nandika
Date: Tue Feb 16 12:09:36 2010
New Revision: 910493
URL: http://svn.apache.org/viewvc?rev=910493&view=rev
Log:
is_module_engaged method added
Modified:
axis/axis2/c/core/trunk/include/axis2_op.h
axis/axis2/c/core/trunk/include/axis2_svc_grp.h
axis/axis2/c/core/trunk/src/core/description/op.c
axis/axis2/c/core/trunk/src/core/description/svc_grp.c
Modified: axis/axis2/c/core/trunk/include/axis2_op.h
URL:
http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/include/axis2_op.h?rev=910493&r1=910492&r2=910493&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/include/axis2_op.h (original)
+++ axis/axis2/c/core/trunk/include/axis2_op.h Tue Feb 16 12:09:36 2010
@@ -717,6 +717,19 @@
const axis2_op_t * op,
const axutil_env_t * env);
+ /**
+ * Checks whether this operation is engaged to module
+ * @param op point to the operation
+ * @param env pointer to environment struct
+ * @param mod_qname module qname
+ */
+ AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+ axis2_op_is_module_engaged(
+ const axis2_op_t *op,
+ const axutil_env_t *env,
+ const axutil_qname_t *mod_qname);
+
+
/** @} */
#ifdef __cplusplus
}
Modified: axis/axis2/c/core/trunk/include/axis2_svc_grp.h
URL:
http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/include/axis2_svc_grp.h?rev=910493&r1=910492&r2=910493&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/include/axis2_svc_grp.h (original)
+++ axis/axis2/c/core/trunk/include/axis2_svc_grp.h Tue Feb 16 12:09:36 2010
@@ -362,6 +362,20 @@
const axis2_svc_grp_t * svc_grp,
const axutil_env_t * env);
+ /**
+ * Checks whether a given module is engaged to the service group
+ * @param svc_grp point to service group
+ * @param env pointer to the environment struct
+ * @return pointer to base description struct
+ */
+
+ AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+ axis2_svc_grp_is_module_engaged(
+ const axis2_svc_grp_t *svc_grp,
+ const axutil_env_t *env,
+ const axutil_qname_t *qname);
+
+
#ifdef __cplusplus
}
#endif
Modified: axis/axis2/c/core/trunk/src/core/description/op.c
URL:
http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/src/core/description/op.c?rev=910493&r1=910492&r2=910493&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/src/core/description/op.c (original)
+++ axis/axis2/c/core/trunk/src/core/description/op.c Tue Feb 16 12:09:36 2010
@@ -1381,3 +1381,43 @@
return op->base;
}
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+axis2_op_is_module_engaged(
+ const axis2_op_t *op,
+ const axutil_env_t *env,
+ const axutil_qname_t *mod_qname)
+{
+ int index = 0;
+ int size = 0;
+ axutil_array_list_t *collection_module = NULL;
+ axis2_module_desc_t *module_desc = NULL;
+ axis2_char_t *opname = NULL;
+ axis2_char_t *modname = NULL;
+
+ opname = axutil_qname_get_localpart(axis2_op_get_qname(op, env), env);
+ collection_module = op->engaged_module_list;
+ if(collection_module)
+ {
+ size = axutil_array_list_size(collection_module, env);
+ }
+ for(index = 0; index < size; index++)
+ {
+ const axutil_qname_t *qname1 = NULL;
+
+ module_desc = (axis2_module_desc_t
*)axutil_array_list_get(collection_module, env, index);
+ if(!module_desc)
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+ "Retrieving a module failed from operation %s engaged module"
+ " list", opname);
+ return AXIS2_FAILURE;
+ }
+ qname1 = axis2_module_desc_get_qname(module_desc, env);
+ if(axutil_qname_equals(qname1, env, mod_qname))
+ {
+ return AXIS2_TRUE;
+ }
+ }
+ return AXIS2_FALSE;
+}
+
Modified: axis/axis2/c/core/trunk/src/core/description/svc_grp.c
URL:
http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/src/core/description/svc_grp.c?rev=910493&r1=910492&r2=910493&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/src/core/description/svc_grp.c (original)
+++ axis/axis2/c/core/trunk/src/core/description/svc_grp.c Tue Feb 16 12:09:36
2010
@@ -598,3 +598,28 @@
return svc_grp->base;
}
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+axis2_svc_grp_is_module_engaged(
+ const axis2_svc_grp_t *svc_grp,
+ const axutil_env_t *env,
+ const axutil_qname_t *module_name)
+{
+ int i = 0;
+ axutil_qname_t *modu = NULL;
+ axis2_char_t *modu_local = NULL;
+ axis2_char_t *module_name_local = NULL;
+ int size = 0;
+
+ size = axutil_array_list_size(svc_grp->module_qname_list, env);
+ for(i = 0; size; i++)
+ {
+ modu = axutil_array_list_get(svc_grp->module_qname_list, env, i);
+ modu_local = axutil_qname_get_localpart(modu, env);
+ module_name_local = axutil_qname_get_localpart(module_name, env);
+ if(!axutil_strcmp(modu_local, module_name_local))
+ {
+ return AXIS2_TRUE;
+ }
+ }
+ return AXIS2_FALSE;
+}