axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r375246 - in /webservices/axis2/trunk/c: ides/anjuta/axis2c.prj include/axis2_addr_mod.h include/axis2_module.h include/axis2_module_desc.h modules/mod_addr/Makefile.am modules/mod_addr/mod_addr.c
Date Mon, 06 Feb 2006 11:06:26 GMT
Author: damitha
Date: Mon Feb  6 03:06:23 2006
New Revision: 375246

URL: http://svn.apache.org/viewcvs?rev=375246&view=rev
Log:
module loading related stuff.
Now I think module addressing module is ready to be loaded

Added:
    webservices/axis2/trunk/c/modules/mod_addr/mod_addr.c
Modified:
    webservices/axis2/trunk/c/ides/anjuta/axis2c.prj
    webservices/axis2/trunk/c/include/axis2_addr_mod.h
    webservices/axis2/trunk/c/include/axis2_module.h
    webservices/axis2/trunk/c/include/axis2_module_desc.h
    webservices/axis2/trunk/c/modules/mod_addr/Makefile.am

Modified: webservices/axis2/trunk/c/ides/anjuta/axis2c.prj
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/ides/anjuta/axis2c.prj?rev=375246&r1=375245&r2=375246&view=diff
==============================================================================
--- webservices/axis2/trunk/c/ides/anjuta/axis2c.prj (original)
+++ webservices/axis2/trunk/c/ides/anjuta/axis2c.prj Mon Feb  6 03:06:23 2006
@@ -247,7 +247,8 @@
 	include/axis2_http_svr_thread.h\
 	include/axis2_uuid_gen.h\
 	include/axis2_conf_init.h\
-	include/axis2_svr_callback.h
+	include/axis2_svr_callback.h\
+	include/axis2_addr_mod.h
 
 module.source.name=.
 module.source.type=
@@ -435,7 +436,10 @@
 	test/client/echo/echo_client.c\
 	test/client/echo/axis2_echo_stub.c\
 	modules/core/deployment/conf_init.c\
-	modules/core/receivers/svr_callback.c
+	modules/core/receivers/svr_callback.c\
+	modules/mod_addr/addr_in_handler.c\
+	modules/mod_addr/addr_out_handler.c\
+	modules/mod_addr/mod_addr.c
 
 module.pixmap.name=.
 module.pixmap.type=

Modified: webservices/axis2/trunk/c/include/axis2_addr_mod.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_addr_mod.h?rev=375246&r1=375245&r2=375246&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_addr_mod.h (original)
+++ webservices/axis2/trunk/c/include/axis2_addr_mod.h Mon Feb  6 03:06:23 2006
@@ -29,8 +29,11 @@
 {
 #endif
 
-AXIS2_DECLARE(axis2_handler_t*) axis2_addr_in_handler_create(axis2_env_t **env, axis2_qname_t
*qname);
-AXIS2_DECLARE(axis2_handler_t*) axis2_addr_out_handler_create(axis2_env_t **env, axis2_qname_t
*qname);
+AXIS2_DECLARE(axis2_handler_t*) 
+axis2_addr_in_handler_create(axis2_env_t **env, axis2_qname_t *qname);
+
+AXIS2_DECLARE(axis2_handler_t*) 
+axis2_addr_out_handler_create(axis2_env_t **env, axis2_qname_t *qname);
     
 /** @} */
     

Modified: webservices/axis2/trunk/c/include/axis2_module.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_module.h?rev=375246&r1=375245&r2=375246&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_module.h (original)
+++ webservices/axis2/trunk/c/include/axis2_module.h Mon Feb  6 03:06:23 2006
@@ -40,6 +40,7 @@
 #include <axis2_allocator.h>
 #include <axis2_string.h>
 #include <axis2_conf.h>
+#include <axis2_hash.h>
 
 
 #ifdef __cplusplus
@@ -61,7 +62,8 @@
     /* initialize the module */
     axis2_status_t (AXIS2_CALL *
     init) (struct axis2_module *module, 
-            axis2_env_t **env, struct axis2_conf *axis2_system);
+            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; */
@@ -69,14 +71,24 @@
     /* shutdown the module */
     axis2_status_t (AXIS2_CALL * 
     shutdown)(struct axis2_module *module,
-                axis2_env_t **env, struct axis2_conf *axis2_system);
+                axis2_env_t **env, 
+                struct axis2_conf *axis2_system);
     
+    /** 
+     * Return a hash map of handler create functions for the module
+     * @return function ptr map 
+     */
+    axis2_status_t (AXIS2_CALL * 
+    fill_handler_create_func_map)(struct axis2_module *module,
+                                    axis2_env_t **env);
+
 
 } ;
 
 AXIS2_DECLARE_DATA struct axis2_module 
 {
     axis2_module_ops_t *ops;
+    axis2_hash_t *handler_create_func_map;
 };
 
 /**
@@ -92,8 +104,10 @@
 		((module)->ops->init (module, env, conf))
 
 #define AXIS2_MODULE_SHUTDOWN(module, env, conf) \
-		((module)->ops->free (module, env, conf))
+		((module)->ops->shutdown (module, env, conf))
 
+#define AXIS2_MODULE_FILL_HANDLER_CREATE_FUNC_MAP(module, env) \
+		((module)->ops->fill_handler_create_func_map (module, env))
 
 /** @} */
 

Modified: 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=375246&r1=375245&r2=375246&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_module_desc.h (original)
+++ webservices/axis2/trunk/c/include/axis2_module_desc.h Mon Feb  6 03:06:23 2006
@@ -207,7 +207,7 @@
     /**
      * @return
      */
-    axis2_module_t *(AXIS2_CALL *
+    struct axis2_module *(AXIS2_CALL *
     get_module) (axis2_module_desc_t *module_desc,
                                         axis2_env_t **env);
     
@@ -217,7 +217,7 @@
     axis2_status_t (AXIS2_CALL *
     set_module) (axis2_module_desc_t *module_desc,
                                     axis2_env_t **env,
-                                    axis2_module_t *module);                            
           
+                                    struct axis2_module *module);                       
                
 
 };
 

Modified: webservices/axis2/trunk/c/modules/mod_addr/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/mod_addr/Makefile.am?rev=375246&r1=375245&r2=375246&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/mod_addr/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/mod_addr/Makefile.am Mon Feb  6 03:06:23 2006
@@ -1,6 +1,10 @@
+prglibdir=$(prefix)/modules/addressing
 lib_LTLIBRARIES = libaxis2_mod_addr.la
+prglib_DATA= module.xml
 AM_CPPFLAGS = $(CPPFLAGS)
-libaxis2_mod_addr_la_SOURCES = addr_in_handler.c addr_out_handler.c
+libaxis2_mod_addr_la_SOURCES = addr_in_handler.c \
+                                addr_out_handler.c \
+                                mod_addr.c
 
 libaxis2_mod_addr_la_LIBADD = 
 INCLUDES = -I$(top_builddir)/include \

Added: webservices/axis2/trunk/c/modules/mod_addr/mod_addr.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/mod_addr/mod_addr.c?rev=375246&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/mod_addr/mod_addr.c (added)
+++ webservices/axis2/trunk/c/modules/mod_addr/mod_addr.c Mon Feb  6 03:06:23 2006
@@ -0,0 +1,135 @@
+/*
+ * 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.h>
+#include <axis2_addr_mod.h>
+
+int 
+axis2_mod_addr_shutdown(axis2_module_t *module,
+                        axis2_env_t **env,
+                        axis2_conf_t *axis2_system);
+
+int 
+axis2_mod_addr_init(axis2_module_t *module,
+                        axis2_env_t **env,
+                        axis2_conf_t *axis2_system);
+
+
+axis2_status_t AXIS2_CALL
+axis2_mod_addr_fill_handler_create_func_map(axis2_module_t *module,
+                                            axis2_env_t **env);
+
+axis2_module_t *
+axis2_mod_addr_create(axis2_env_t **env)
+{
+    axis2_module_t *module = NULL;
+    module = AXIS2_MALLOC((*env)->allocator, 
+        sizeof(axis2_module_t));
+
+    
+    module->ops = AXIS2_MALLOC(
+        (*env)->allocator, sizeof(axis2_module_ops_t));
+
+    module->ops->shutdown = axis2_mod_addr_shutdown;
+    module->ops->init = axis2_mod_addr_init;
+    module->ops->fill_handler_create_func_map = 
+        axis2_mod_addr_fill_handler_create_func_map;
+
+    return module;
+}
+
+int 
+axis2_addr_module_init(axis2_module_t *module,
+                        axis2_env_t **env,
+                        axis2_conf_t *axis2_system)
+{
+    /* Any initialization stuff of mod_addr goes here */
+    return AXIS2_SUCCESS;
+}
+
+int 
+axis2_mod_addr_shutdown(axis2_module_t *module,
+                        axis2_env_t **env,
+                        axis2_conf_t *axis2_system)
+{
+    if(module->ops)
+    {
+        AXIS2_FREE((*env)->allocator, module->ops);
+        module->ops = NULL;
+    }
+
+    if(module->handler_create_func_map)
+    {
+        /* TODO
+         *  do the neccessary clean in hash map
+         */
+        axis2_hash_free(module->handler_create_func_map, env);
+        module->handler_create_func_map = NULL;
+    }
+    
+    if(module)
+    {
+        AXIS2_FREE((*env)->allocator, module);
+        module = NULL;
+    }
+    return AXIS2_SUCCESS; 
+}
+
+axis2_status_t AXIS2_CALL
+axis2_mod_addr_fill_handler_create_func_map(axis2_module_t *module,
+                                            axis2_env_t **env)
+{
+    module->handler_create_func_map = axis2_hash_make(env);
+    if(!module->handler_create_func_map)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, 
+            AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
+    axis2_hash_set(module->handler_create_func_map, "AddressingInHandler", 
+        AXIS2_HASH_KEY_STRING, axis2_addr_in_handler_create);
+
+    axis2_hash_set(module->handler_create_func_map, "AddressingOutHandler", 
+        AXIS2_HASH_KEY_STRING, axis2_addr_out_handler_create);
+
+    return AXIS2_SUCCESS;
+}
+
+/**
+ * Following block distinguish the exposed part of the dll.
+ */
+
+int axis2_get_instance(struct axis2_module **inst,
+                        axis2_env_t **env)
+{
+	*inst = axis2_mod_addr_create(env);
+    if(!(*inst))
+    {
+        return AXIS2_FAILURE;
+    }
+
+    return AXIS2_SUCCESS;
+}
+
+int axis2_remove_instance(axis2_module_t *inst,
+                            axis2_env_t **env)
+{
+    axis2_status_t status = AXIS2_FAILURE;
+	if (inst)
+	{
+        status = axis2_mod_addr_shutdown(inst, env, NULL);
+    }
+    return status;
+}



Mime
View raw message