axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r368286 - in /webservices/axis2/trunk/c: include/axis2_conf_init.h include/axis2_module.h modules/core/deployment/Makefile.am modules/core/deployment/conf_init.c modules/core/transport/axis2_transport_listener.h
Date Thu, 12 Jan 2006 05:50:14 GMT
Author: samisa
Date: Wed Jan 11 21:50:03 2006
New Revision: 368286

URL: http://svn.apache.org/viewcvs?rev=368286&view=rev
Log:
Added initialization for config and fixed the rest to get it working

Added:
    webservices/axis2/trunk/c/include/axis2_conf_init.h
    webservices/axis2/trunk/c/modules/core/deployment/conf_init.c
Modified:
    webservices/axis2/trunk/c/include/axis2_module.h
    webservices/axis2/trunk/c/modules/core/deployment/Makefile.am
    webservices/axis2/trunk/c/modules/core/transport/axis2_transport_listener.h

Added: webservices/axis2/trunk/c/include/axis2_conf_init.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_conf_init.h?rev=368286&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_conf_init.h (added)
+++ webservices/axis2/trunk/c/include/axis2_conf_init.h Wed Jan 11 21:50:03 2006
@@ -0,0 +1,65 @@
+/*
+ * 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_CONF_INIT_H
+#define AXIS2_CONF_INIT_H
+
+/**
+ * @file axis2_conf_init.h
+ * @brief Axis2 configuration initilizing functions
+ */
+
+#include <axis2.h>
+#include <axis2_error.h>
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axis2_allocator.h>
+#include <axis2_dep_engine.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** @defgroup axis2_conf_init configuration initilizing functions
+ * @ingroup axis2_deployment
+ * @{
+ */
+
+/**
+ * Builds the configuration for the Server
+ * @param env Environment. MUST NOT be NULL
+ * @param repo_name repository name
+ * @return pointer to an instance of configuration context properly initialized
+ */
+AXIS2_DECLARE(axis2_conf_ctx_t*) build_conf_ctx (axis2_env_t **env,
+    axis2_char_t *repo_name);
+/**
+ * Builds the Configuration for the Client
+ * @param env Environment. MUST NOT be NULL
+ * @param axis2_home. axis2 home for client. 
+ * @return pointer to an instance of configuration context properly initialized
+ */
+AXIS2_DECLARE(axis2_conf_ctx_t*) build_client_conf_ctx(axis2_env_t **env,
+        axis2_char_t *axis2_home);
+
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+#endif  /* AXIS2_CONF_INIT_H */

Modified: webservices/axis2/trunk/c/include/axis2_module.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_module.h?rev=368286&r1=368285&r2=368286&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_module.h (original)
+++ webservices/axis2/trunk/c/include/axis2_module.h Wed Jan 11 21:50:03 2006
@@ -60,16 +60,16 @@
 {
     /* initialize the module */
     axis2_status_t (AXIS2_CALL *
-    init) (struct axis2_conf *axis2_system,
-            axis2_env_t **env);
+    init) (struct axis2_module *module, 
+            axis2_env_t **env, struct axis2_conf *axis2_system);
 
     /* TODO figure out how to get the engage() concept done */
     /* public void engage(ExecutionChain exeChain) throws AxisFault; */
     
     /* shutdown the module */
     axis2_status_t (AXIS2_CALL * 
-    shutdown)(struct axis2_conf *axis2_system,
-            axis2_env_t **env);
+    shutdown)(struct axis2_module *module,
+                axis2_env_t **env, struct axis2_conf *axis2_system);
     
 
 } ;
@@ -88,11 +88,11 @@
 
 /*************************** Function macros **********************************/
 
-#define AXIS2_MODULE_INIT(module, env) \
-		((module)->ops->init (module, env))
+#define AXIS2_MODULE_INIT(module, env, conf) \
+		((module)->ops->init (module, env, conf))
 
-#define AXIS2_MODULE_SHUTDOWN(module, env) \
-		((module)->ops->free (module, env))
+#define AXIS2_MODULE_SHUTDOWN(module, env, conf) \
+		((module)->ops->free (module, env, conf))
 
 
 /** @} */

Modified: webservices/axis2/trunk/c/modules/core/deployment/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/Makefile.am?rev=368286&r1=368285&r2=368286&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/Makefile.am Wed Jan 11 21:50:03 2006
@@ -11,7 +11,8 @@
                                     svc_grp_builder.c \
                                     module_builder.c \
                                     conf_builder.c \
-                                    repos_listener.c
+                                    repos_listener.c \
+                                    conf_init.c
 
 libaxis2_deployment_la_LIBADD = 
 INCLUDES = -I$(top_builddir)/include \

Added: webservices/axis2/trunk/c/modules/core/deployment/conf_init.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/conf_init.c?rev=368286&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/conf_init.c (added)
+++ webservices/axis2/trunk/c/modules/core/deployment/conf_init.c Wed Jan 11 21:50:03 2006
@@ -0,0 +1,199 @@
+/*
+ * 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_conf_init.h>
+
+axis2_status_t AXIS2_CALL axis2_init_modules(axis2_env_t **env, 
+    axis2_conf_ctx_t *conf_ctx);
+axis2_status_t AXIS2_CALL axis2_init_transports(axis2_env_t **env, 
+    axis2_conf_ctx_t *conf_ctx);
+    
+axis2_conf_ctx_t* AXIS2_CALL build_conf_ctx (axis2_env_t **env,
+    axis2_char_t *repo_name)
+{    
+    axis2_conf_ctx_t *conf_ctx = NULL;
+    axis2_dep_engine_t *dep_engine = NULL;
+    axis2_conf_t *conf = NULL;
+    axis2_phase_resolver_t *phase_resolver = NULL;
+    
+    AXIS2_ENV_CHECK(env, NULL);
+    
+    dep_engine = axis2_dep_engine_create_with_repos_name(env, repo_name);
+    if (!dep_engine)
+    {
+        return NULL;
+    }
+    
+    conf = AXIS2_DEP_ENGINE_LOAD(dep_engine, env);
+    if (!conf)
+    {
+        return NULL;
+    }
+    
+    phase_resolver = axis2_phase_resolver_create_with_config(env, conf);
+    if (!phase_resolver)
+    {
+        return NULL;
+    }
+    
+    conf_ctx = axis2_conf_ctx_create(env, conf);
+    
+    AXIS2_PHASE_RESOLVER_BUILD_CHAINS(phase_resolver, env);
+    
+    axis2_init_modules(env, conf_ctx);
+    axis2_init_transports(env, conf_ctx);
+    
+    return conf_ctx;
+}
+
+ axis2_conf_ctx_t* AXIS2_CALL build_client_conf_ctx(axis2_env_t **env,
+        axis2_char_t *axis2_home)
+{
+    axis2_conf_ctx_t *conf_ctx = NULL;
+    axis2_dep_engine_t *dep_engine = NULL;
+    axis2_conf_t *conf = NULL;
+    axis2_phase_resolver_t *phase_resolver = NULL;
+    
+    AXIS2_ENV_CHECK(env, NULL);
+    
+    dep_engine = axis2_dep_engine_create(env);
+    if (!dep_engine)
+    {
+        return NULL;
+    }
+    
+    conf = AXIS2_DEP_ENGINE_LOAD_CLIENT(dep_engine, env, axis2_home);
+    if (!conf)
+    {
+        return NULL;
+    }
+    
+    phase_resolver = axis2_phase_resolver_create_with_config(env, conf);
+    if (!phase_resolver)
+    {
+        return NULL;
+    }
+
+    conf_ctx = axis2_conf_ctx_create(env, conf);
+    if (!conf_ctx)
+    {
+        return NULL;
+    }
+
+    AXIS2_PHASE_RESOLVER_BUILD_CHAINS(phase_resolver, env);
+
+    axis2_init_modules(env, conf_ctx);
+    axis2_init_transports(env, conf_ctx);
+    
+    return conf_ctx;
+}
+
+axis2_status_t AXIS2_CALL axis2_init_modules(axis2_env_t **env, 
+    axis2_conf_ctx_t *conf_ctx)
+{
+    axis2_conf_t *conf = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, conf_ctx, AXIS2_FAILURE);
+    
+    conf = AXIS2_CONF_CTX_GET_CONF(conf_ctx, env);
+    if (conf)
+    {
+        axis2_hash_t *module_map = AXIS2_CONF_GET_MODULES(conf, env);
+        if (module_map)
+        {
+            axis2_hash_index_t *hi = NULL;
+            void *module = NULL;
+            for (hi = axis2_hash_first (module_map, env);
+                    hi; hi = axis2_hash_next (env, hi))
+            {
+                axis2_hash_this (hi, NULL, NULL, &module);
+                if (module)
+                {
+                    axis2_module_t *mod = (axis2_module_t*)module;
+                    AXIS2_MODULE_INIT(mod, env, conf);
+                }
+            }
+        }
+        status = AXIS2_SUCCESS;
+    }
+    
+    return status;
+}
+
+axis2_status_t AXIS2_CALL axis2_init_transports(axis2_env_t **env, 
+    axis2_conf_ctx_t *conf_ctx)
+{
+    axis2_conf_t *conf = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, conf_ctx, AXIS2_FAILURE);
+    
+    conf = AXIS2_CONF_CTX_GET_CONF(conf_ctx, env);
+    if (conf)
+    {
+        axis2_hash_t *transport_map = NULL;
+       
+        transport_map = AXIS2_CONF_GET_TRANSPORTS_IN(conf, env);
+        if (transport_map)
+        {
+            axis2_hash_index_t *hi = NULL;
+            void *transport = NULL;
+            for (hi = axis2_hash_first (transport_map, env);
+                    hi; hi = axis2_hash_next (env, hi))
+            {
+                axis2_hash_this (hi, NULL, NULL, transport);
+                if (transport)
+                {
+                    axis2_transport_in_desc_t *transport_in = (axis2_transport_in_desc_t*)transport;
+                    axis2_transport_listener_t *listener = AXIS2_TRANSPORT_IN_DESC_GET_RECV(transport_in,
env);
+                    if (listener)
+                    {
+                        status = AXIS2_TRANSPORT_LISTENER_INIT(listener, env, conf_ctx, transport_in);
+                    }
+                    
+                }
+            }
+        }
+        
+        transport_map = AXIS2_CONF_GET_TRANSPORTS_OUT(conf, env);
+        if (transport_map)
+        {
+            axis2_hash_index_t *hi = NULL;
+            void *transport = NULL;
+            for (hi = axis2_hash_first (transport_map, env);
+                    hi; hi = axis2_hash_next (env, hi))
+            {
+                axis2_hash_this (hi, NULL, NULL, transport);
+                if (transport)
+                {
+                    axis2_transport_out_desc_t *transport_out = (axis2_transport_out_desc_t*)transport;
+                    axis2_transport_sender_t *sender = AXIS2_TRANSPORT_OUT_DESC_GET_SENDER(transport_out,
env);
+                    if (sender)
+                    {
+                        status = AXIS2_TRANSPORT_SENDER_INIT(sender, env, conf_ctx, transport_out);
+                    }
+                    
+                }
+            }
+        }
+        status = AXIS2_SUCCESS;
+    }
+    
+    return status;
+}

Modified: webservices/axis2/trunk/c/modules/core/transport/axis2_transport_listener.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/axis2_transport_listener.h?rev=368286&r1=368285&r2=368286&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/axis2_transport_listener.h (original)
+++ webservices/axis2/trunk/c/modules/core/transport/axis2_transport_listener.h Wed Jan 11
21:50:03 2006
@@ -71,6 +71,11 @@
 			        axis2_env_t **env,
                     axis2_char_t *svc_name);
 
+    axis2_status_t (AXIS2_CALL * 
+    init) (axis2_transport_listener_t *transport_listener,
+                                axis2_env_t **env,
+                                struct axis2_ctx *conf_ctx,
+                                struct axis2_transport_in_desc *transport_in);
 };
 
 /** 



Mime
View raw message