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 da...@apache.org on 2006/01/17 07:30:33 UTC
svn commit: r369698 - in /webservices/axis2/trunk/c: include/
modules/core/deployment/ modules/core/engine/ modules/core/transport/
modules/core/transport/http/receiver/ modules/core/transport/http/server/
modules/util/ test/core/deployment/ test/unit/...
Author: damitha
Date: Mon Jan 16 22:30:07 2006
New Revision: 369698
URL: http://svn.apache.org/viewcvs?rev=369698&view=rev
Log:
Added two new file axis2_file.*.
Tested and fixed bugs in axis2_dep_engine_load method
Added:
webservices/axis2/trunk/c/include/axis2_file.h
webservices/axis2/trunk/c/modules/util/file.c
Modified:
webservices/axis2/trunk/c/include/axis2_arch_file_data.h
webservices/axis2/trunk/c/include/axis2_dir_handler.h
webservices/axis2/trunk/c/include/axis2_dll_desc.h
webservices/axis2/trunk/c/include/axis2_error.h
webservices/axis2/trunk/c/include/axis2_http_server.h
webservices/axis2/trunk/c/modules/core/deployment/arch_file_data.c
webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c
webservices/axis2/trunk/c/modules/core/deployment/repos_listener.c
webservices/axis2/trunk/c/modules/core/deployment/ws_info_list.c
webservices/axis2/trunk/c/modules/core/engine/conf.c
webservices/axis2/trunk/c/modules/core/transport/Makefile.am
webservices/axis2/trunk/c/modules/core/transport/axis2_transport_receiver.h
webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_server.c
webservices/axis2/trunk/c/modules/core/transport/http/server/http_server_main.c
webservices/axis2/trunk/c/modules/util/Makefile.am
webservices/axis2/trunk/c/modules/util/class_loader.c
webservices/axis2/trunk/c/modules/util/dir_handler.c
webservices/axis2/trunk/c/test/core/deployment/test_deployment.c
webservices/axis2/trunk/c/test/unit/util/util_dir_handler_test.c
Modified: webservices/axis2/trunk/c/include/axis2_arch_file_data.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_arch_file_data.h?rev=369698&r1=369697&r2=369698&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_arch_file_data.h (original)
+++ webservices/axis2/trunk/c/include/axis2_arch_file_data.h Mon Jan 16 22:30:07 2006
@@ -31,6 +31,7 @@
#include <axis2_conf.h>
#include <axis2_array_list.h>
#include <axis2_dir_handler.h>
+#include <axis2_file.h>
#ifdef __cplusplus
extern "C"
Modified: webservices/axis2/trunk/c/include/axis2_dir_handler.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_dir_handler.h?rev=369698&r1=369697&r2=369698&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_dir_handler.h (original)
+++ webservices/axis2/trunk/c/include/axis2_dir_handler.h Mon Jan 16 22:30:07 2006
@@ -43,18 +43,6 @@
AXIS2_DECLARE(axis2_array_list_t *)
axis2_dir_handler_list_dir(axis2_env_t **env,
axis2_char_t *pathname);
-
- /**
- * @brief
- * To store filename and timestamp of each module or service archive file
- */
- typedef struct axis2_file
- {
- axis2_char_t *name;
- AXIS2_TIME_T time_stamp;
-
-
- } axis2_file_t;
#define AXIS2_DIR_HANDLER_LIST_DIR(env, pathname) \
(axis2_dir_handler_list_dir(env, pathname))
Modified: webservices/axis2/trunk/c/include/axis2_dll_desc.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_dll_desc.h?rev=369698&r1=369697&r2=369698&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_dll_desc.h (original)
+++ webservices/axis2/trunk/c/include/axis2_dll_desc.h Mon Jan 16 22:30:07 2006
@@ -58,7 +58,9 @@
/** message receiver dll */
AXIS2_MSG_RECV_DLL,
/** module dll */
- AXIS2_MODULE_DLL
+ AXIS2_MODULE_DLL,
+ /** transport receiver dll */
+ AXIS2_TRANSPORT_RECV_DLL
}axis2_dll_type_t;
Modified: webservices/axis2/trunk/c/include/axis2_error.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_error.h?rev=369698&r1=369697&r2=369698&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_error.h (original)
+++ webservices/axis2/trunk/c/include/axis2_error.h Mon Jan 16 22:30:07 2006
@@ -441,6 +441,7 @@
AXIS2_ERROR_OM_ELEMENT_INVALID_STATE,
AXIS2_ERROR_RPC_NEED_MATCHING_CHILD,
AXIS2_ERROR_UNKNOWN_STYLE,
+ AXIS2_ERROR_TRANSPORT_RECV_CREATION_FAILED,
/* Listen failed for the server socket */
AXIS2_ERROR_SOCKET_LISTEN_FAILED,
Added: webservices/axis2/trunk/c/include/axis2_file.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_file.h?rev=369698&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_file.h (added)
+++ webservices/axis2/trunk/c/include/axis2_file.h Mon Jan 16 22:30:07 2006
@@ -0,0 +1,76 @@
+/*
+ * 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_FILE_H
+#define AXIS2_FILE_H
+
+#include <axis2_defines.h>
+#include <axis2_error.h>
+#include <axis2_env.h>
+#include <axis2.h>
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+typedef struct axis2_file axis2_file_t;
+
+/**
+ * @defgroup axis2_file File
+ * @ingroup axis2_util
+ * @{
+ */
+
+ /**
+ * create new file
+ * @return file newly created file
+ */
+ AXIS2_DECLARE(axis2_file_t *)
+ axis2_file_create(axis2_env_t **env);
+
+ AXIS2_DECLARE(axis2_status_t)
+ axis2_file_free (axis2_file_t *file,
+ axis2_env_t **env);
+
+ /**
+ * create a newly allocated clone of the argument file
+ */
+ axis2_file_t *AXIS2_CALL
+ axis2_file_clone(axis2_file_t *file,
+ axis2_env_t **env);
+
+ /**
+ * @brief
+ * To store filename and timestamp of each module or service archive file
+ */
+ struct axis2_file
+ {
+ axis2_char_t *name;
+ AXIS2_TIME_T time_stamp;
+
+
+ };
+
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* AXIS2_FILE_H */
Modified: webservices/axis2/trunk/c/include/axis2_http_server.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_http_server.h?rev=369698&r1=369697&r2=369698&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_http_server.h (original)
+++ webservices/axis2/trunk/c/include/axis2_http_server.h Mon Jan 16 22:30:07 2006
@@ -27,6 +27,7 @@
#include <axis2_defines.h>
#include <axis2_env.h>
#include <axis2_conf_ctx.h>
+#include <axis2_transport_receiver.h>
#ifdef __cplusplus
extern "C"
@@ -38,65 +39,9 @@
* @{
*/
-typedef struct axis2_http_server_ops axis2_http_server_ops_t;
-typedef struct axis2_http_server axis2_http_server_t;
-
-
-/**
- * @brief HTTP Server ops struct
- * Encapsulator struct for ops of axis2_http_server
- */
-AXIS2_DECLARE_DATA struct axis2_http_server_ops
-{
- axis2_status_t (AXIS2_CALL *init)
- (axis2_http_server_t *server, axis2_env_t **env,
- axis2_conf_ctx_t *conf_ctx,
- axis2_transport_in_desc_t *in_desc);
- axis2_status_t (AXIS2_CALL *start)
- (axis2_http_server_t *server, axis2_env_t **env);
- axis2_status_t (AXIS2_CALL *stop)
- (axis2_http_server_t *server, axis2_env_t **env);
-
- axis2_conf_ctx_t* (AXIS2_CALL *get_conf_ctx) (axis2_http_server_t *server,
- axis2_env_t **env);
-
- axis2_endpoint_ref_t* (AXIS2_CALL *get_reply_to_epr)
- (axis2_http_server_t *server, axis2_env_t **env,
- axis2_char_t *svc_name);
-
- axis2_bool_t (AXIS2_CALL *is_running) (axis2_http_server_t *server,
- axis2_env_t **env);
-
- axis2_status_t (AXIS2_CALL *free) (axis2_http_server_t *server,
- axis2_env_t **env);
-};
-
-/**
- * @brief HTTP Server struct
- * Axis2 HTTP Server
- */
-AXIS2_DECLARE_DATA struct axis2_http_server
-{
- axis2_http_server_ops_t *ops;
-};
-
-
-AXIS2_DECLARE(axis2_transport_receiver_t*)
+AXIS2_DECLARE(axis2_transport_receiver_t *)
axis2_http_server_create (axis2_env_t **env, axis2_char_t *repo, int port);
-/************************** Start of function macros **************************/
-
-#define AXIS2_HTTP_SERVER_INIT(server, env, conf_ctx, in_desc) \
- ((server)->ops->init(server, env, conf_ctx, in_desc))
-#define AXIS2_HTTP_SERVER_START(server, env) ((server)->ops->start(server, env))
-#define AXIS2_HTTP_SERVER_STOP(server, env) ((server)->ops->stop(server, env))
-#define AXIS2_HTTP_SERVER_GET_CONF_CTX(server, env) \
- ((server)->ops->get_conf_ctx(server, env))
-#define AXIS2_HTTP_SERVER_GET_REPLY_TO_EPR(server, env, svc_name) \
- ((server)->ops->get_reply_to_epr(server, env, svc_name))
-#define AXIS2_HTTP_SERVER_IS_RUNNING(server, env) \
- ((server)->ops->is_running(server, env))
-/************************** End of function macros ****************************/
/** @} */
#ifdef __cplusplus
Modified: webservices/axis2/trunk/c/modules/core/deployment/arch_file_data.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/arch_file_data.c?rev=369698&r1=369697&r2=369698&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/arch_file_data.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/arch_file_data.c Mon Jan 16 22:30:07 2006
@@ -189,7 +189,7 @@
return NULL;
}
file_data_impl->type = type;
- file_data_impl->file = file;
+ file_data_impl->file = axis2_file_clone(file, env);
return &(file_data_impl->arch_file_data);
}
@@ -224,7 +224,7 @@
if(file_data_impl->file)
{
- AXIS2_FREE((*env)->allocator, file_data_impl->file);
+ axis2_file_free(file_data_impl->file, env);
file_data_impl->file = NULL;
}
if(file_data_impl->msg_recv)
Modified: webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c?rev=369698&r1=369697&r2=369698&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c Mon Jan 16 22:30:07 2006
@@ -1277,7 +1277,7 @@
engine_impl = AXIS2_INTF_TO_IMPL(dep_engine);
size = AXIS2_ARRAY_LIST_SIZE(engine_impl->ws_to_deploy, env);
-
+ printf("dep_engine:size:%d\n", size);
if (size > 0)
{
int i = 0;
@@ -1293,7 +1293,7 @@
AXIS2_ARRAY_LIST_GET(engine_impl->ws_to_deploy, env, i);
type = AXIS2_ARCH_FILE_DATA_GET_TYPE(engine_impl->curr_file, env);
-
+ printf("type:%d\n", type);
switch (type)
{
case AXIS2_SVC:
@@ -1305,6 +1305,7 @@
engine_impl->conf);
file_name = AXIS2_ARCH_FILE_DATA_GET_NAME(engine_impl->
curr_file, env);
+ printf("file_name:%s\n", file_name);
status = AXIS2_ARCH_READER_PROCESS_SVC_GRP(arch_reader, env,
file_name, dep_engine, svc_grp);
if(AXIS2_SUCCESS != status)
Modified: webservices/axis2/trunk/c/modules/core/deployment/repos_listener.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/repos_listener.c?rev=369698&r1=369697&r2=369698&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/repos_listener.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/repos_listener.c Mon Jan 16 22:30:07 2006
@@ -26,10 +26,6 @@
{
axis2_repos_listener_t repos_listener;
/**
- * to store currrently checking ws info
- */
- axis2_array_list_t *current_info_list;
- /**
* Referance to a WSInfoList
*/
axis2_ws_info_list_t *info_list;
@@ -106,7 +102,6 @@
return NULL;
}
listener_impl->folder_name = NULL;
- listener_impl->current_info_list = NULL;
listener_impl->info_list = NULL;
listener_impl->BUFFER = 2048;
listener_impl->repos_listener.ops = NULL;
@@ -150,6 +145,7 @@
axis2_dep_engine_t *dep_engine)
{
axis2_repos_listener_impl_t *listener_impl = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
AXIS2_ENV_CHECK(env, NULL);
@@ -171,7 +167,8 @@
{
return NULL;
}
- axis2_repos_listener_init(&(listener_impl->repos_listener), env);
+ status = axis2_repos_listener_init(&(listener_impl->repos_listener), env);
+ printf("respos listner init status:%d\n", status);
return &(listener_impl->repos_listener);
}
@@ -209,25 +206,13 @@
{
axis2_repos_listener_impl_t *listener_impl = NULL;
axis2_char_t *module_path = NULL;
- int size = 0;
- int i = 0;
AXIS2_FUNC_PARAM_CHECK(listener, env, AXIS2_FAILURE);
listener_impl = AXIS2_INTF_TO_IMPL(listener);
module_path = AXIS2_STRACAT(listener_impl->folder_name, AXIS2_MODULE_PATH,
env);
- listener_impl->current_info_list = AXIS2_DIR_HANDLER_LIST_DIR(env, module_path);
-
- size = AXIS2_ARRAY_LIST_SIZE(listener_impl->current_info_list, env);
- for (i = 0; i< size; i++) /* loop until empty */
- {
- axis2_file_t *file = NULL;
- file = AXIS2_ARRAY_LIST_GET(listener_impl->current_info_list, env, i);
- AXIS2_WS_INFO_LIST_ADD_WS_INFO_ITEM(listener_impl->info_list, env,
- file, AXIS2_MODULE);
- }
- return AXIS2_SUCCESS;
+ return axis2_repos_listener_search_WS(listener, env, module_path, AXIS2_MODULE);
}
axis2_status_t AXIS2_CALL
@@ -235,14 +220,12 @@
axis2_env_t **env)
{
axis2_repos_listener_impl_t *listener_impl = NULL;
- axis2_char_t *module_path = NULL;
+ axis2_char_t *svc_path = NULL;
AXIS2_FUNC_PARAM_CHECK(listener, env, AXIS2_FAILURE);
listener_impl = AXIS2_INTF_TO_IMPL(listener);
- module_path = AXIS2_STRACAT(listener_impl->folder_name, AXIS2_SVC_PATH, env);
-
- /* service archives */
- return axis2_repos_listener_search_WS(listener, env, module_path, AXIS2_SVC);
+ svc_path = AXIS2_STRACAT(listener_impl->folder_name, AXIS2_SVC_PATH, env);
+ return axis2_repos_listener_search_WS(listener, env, svc_path, AXIS2_SVC);
}
axis2_status_t AXIS2_CALL
@@ -263,15 +246,27 @@
axis2_env_t **env)
{
axis2_repos_listener_impl_t *listener_impl = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
AXIS2_FUNC_PARAM_CHECK(listener, env, AXIS2_FAILURE);
listener_impl = AXIS2_INTF_TO_IMPL(listener);
- AXIS2_WS_INFO_LIST_INIT(listener_impl->info_list, env);
+ status = AXIS2_WS_INFO_LIST_INIT(listener_impl->info_list, env);
+ if(AXIS2_SUCCESS != status)
+ {
+ return AXIS2_FAILURE;
+ }
+ /* if check_modules return AXIS2_FAILURE that means
+ * there are no modules to load
+ */
axis2_repos_listener_check_modules(listener, env);
+
+ /* if check_svcs return AXIS2_FAILURE that means
+ * there are no services to load
+ */
axis2_repos_listener_check_svcs(listener, env);
- axis2_repos_listener_update(listener, env);
- return AXIS2_SUCCESS;
+
+ return axis2_repos_listener_update(listener, env);
}
axis2_status_t AXIS2_CALL
@@ -299,20 +294,25 @@
axis2_repos_listener_impl_t *listener_impl = NULL;
int size = 0;
int i = 0;
+ axis2_array_list_t *current_info_list = NULL;
AXIS2_FUNC_PARAM_CHECK(listener, env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, folder_name, AXIS2_FAILURE);
listener_impl = AXIS2_INTF_TO_IMPL(listener);
-
- listener_impl->current_info_list = AXIS2_DIR_HANDLER_LIST_DIR(env, folder_name);
-
- size = AXIS2_ARRAY_LIST_SIZE(listener_impl->current_info_list, env);
+ current_info_list = AXIS2_DIR_HANDLER_LIST_DIR(env, folder_name);
+ if(!current_info_list)
+ {
+ return AXIS2_FAILURE;
+ }
+ size = AXIS2_ARRAY_LIST_SIZE(current_info_list, env);
for (i = 0; i< size; i++) /* loop until empty */
{
axis2_file_t *file = NULL;
- file = AXIS2_ARRAY_LIST_GET(listener_impl->current_info_list, env, i);
+ file = AXIS2_ARRAY_LIST_GET(current_info_list, env, i);
AXIS2_WS_INFO_LIST_ADD_WS_INFO_ITEM(listener_impl->info_list, env,
- file, AXIS2_SVC);
+ file, type);
+ axis2_file_free(file, env);
+
}
return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/modules/core/deployment/ws_info_list.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/ws_info_list.c?rev=369698&r1=369697&r2=369698&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/ws_info_list.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/ws_info_list.c Mon Jan 16 22:30:07 2006
@@ -228,6 +228,7 @@
{
axis2_ws_info_list_impl_t *info_list_impl = NULL;
axis2_status_t status = AXIS2_FAILURE;
+ axis2_char_t *info_list_name = NULL;
AXIS2_FUNC_PARAM_CHECK(info_list, env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, file, AXIS2_FAILURE);
@@ -284,7 +285,12 @@
break;
}
}
- axis2_char_t *info_list_name = file->name;
+
+ info_list_name = AXIS2_STRDUP(file->name, env);
+ if(!info_list_name)
+ {
+ return AXIS2_FAILURE;
+ }
status = AXIS2_ARRAY_LIST_ADD(info_list_impl->current_info_lists, env,
info_list_name);
return status;
@@ -432,13 +438,17 @@
AXIS2_FUNC_PARAM_CHECK(info_list, env, AXIS2_FAILURE);
info_list_impl = AXIS2_INTF_TO_IMPL(info_list);
- axis2_ws_info_list_check_for_undeploy(info_list, env);
+ status = axis2_ws_info_list_check_for_undeploy(info_list, env);
+ if(AXIS2_TRUE != status)
+ {
+ return AXIS2_FAILURE;
+ }
/* TODO uncomment when hot deployment supported */
/*
if (deployer.isHotUpdate()) {
deployer.unDeploy();
}
*/
- status = AXIS2_DEP_ENGINE_DO_DEPLOY(info_list_impl->deployer, env);
- return status;
+
+ return AXIS2_DEP_ENGINE_DO_DEPLOY(info_list_impl->deployer, env);
}
Modified: webservices/axis2/trunk/c/modules/core/engine/conf.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/engine/conf.c?rev=369698&r1=369697&r2=369698&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/conf.c (original)
+++ webservices/axis2/trunk/c/modules/core/engine/conf.c Mon Jan 16 22:30:07 2006
@@ -1703,10 +1703,8 @@
if(NULL == module_desc)
{
axis2_file_t *file = NULL;
- int file_size = 0;
- file_size = sizeof(axis2_file_t);
- file = (axis2_file_t *) AXIS2_MALLOC((*env)->allocator, file_size);
+ file = (axis2_file_t *) axis2_file_create(env);
file->name = AXIS2_QNAME_GET_LOCALPART(module_ref, env);
dep_engine = axis2_dep_engine_create(env);
module_desc = AXIS2_DEP_ENGINE_BUILD_MODULE(dep_engine, env, file, conf);
Modified: webservices/axis2/trunk/c/modules/core/transport/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/Makefile.am?rev=369698&r1=369697&r2=369698&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/core/transport/Makefile.am Mon Jan 16 22:30:07 2006
@@ -7,4 +7,5 @@
INCLUDES = -I$(top_builddir)/include \
-I$(top_builddir)/modules/util \
-I$(top_builddir)/modules/core/transport \
+ -I$(top_builddir)/modules/core/context \
-I$(top_builddir)/modules/platforms
Modified: webservices/axis2/trunk/c/modules/core/transport/axis2_transport_receiver.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/axis2_transport_receiver.h?rev=369698&r1=369697&r2=369698&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/axis2_transport_receiver.h (original)
+++ webservices/axis2/trunk/c/modules/core/transport/axis2_transport_receiver.h Mon Jan 16 22:30:07 2006
@@ -58,26 +58,39 @@
/** De-allocate memory
* @return status code
*/
- axis2_status_t (AXIS2_CALL *free)(
- axis2_transport_receiver_t *transport_receiver,
- axis2_env_t **env);
+ axis2_status_t (AXIS2_CALL *
+ free)(axis2_transport_receiver_t *transport_receiver,
+ axis2_env_t **env);
- axis2_status_t (AXIS2_CALL *start)(
- axis2_transport_receiver_t *transport_receiver,
- axis2_env_t **env);
- axis2_status_t (AXIS2_CALL *stop)(
- axis2_transport_receiver_t *transport_receiver,
- axis2_env_t **env);
- axis2_endpoint_ref_t* (AXIS2_CALL *get_reply_to_epr)(
- axis2_transport_receiver_t *transport_receiver,
- axis2_env_t **env,
- axis2_char_t *svc_name);
-
- axis2_status_t (AXIS2_CALL *init)
- (axis2_transport_receiver_t *transport_receiver,
- axis2_env_t **env,
- struct axis2_conf_ctx *conf_ctx,
- struct axis2_transport_in_desc *transport_in);
+ axis2_status_t (AXIS2_CALL *
+ start)(axis2_transport_receiver_t *transport_receiver,
+ axis2_env_t **env);
+
+ axis2_status_t (AXIS2_CALL *
+ stop)(axis2_transport_receiver_t *transport_receiver,
+ axis2_env_t **env);
+
+ axis2_endpoint_ref_t* (AXIS2_CALL *
+ get_reply_to_epr)(axis2_transport_receiver_t *transport_receiver,
+ axis2_env_t **env,
+ axis2_char_t *svc_name);
+
+ axis2_status_t (AXIS2_CALL *
+ init) (axis2_transport_receiver_t *transport_receiver,
+ axis2_env_t **env,
+ struct axis2_conf_ctx *conf_ctx,
+ struct axis2_transport_in_desc *transport_in);
+
+
+ struct axis2_conf_ctx* (AXIS2_CALL *
+ get_conf_ctx) (axis2_transport_receiver_t *server,
+ axis2_env_t **env);
+
+
+ axis2_bool_t (AXIS2_CALL *
+ is_running) (axis2_transport_receiver_t *server,
+ axis2_env_t **env);
+
};
/**
@@ -104,7 +117,13 @@
((transport_receiver->ops)->stop (transport_receiver, env))
#define AXIS2_TRANSPORT_RECEIVER_GET_REPLY_TO_EPR(transport_receiver, env, svc_name) \
- ((transport_receiver->ops)->get_reply_to_epr (transport_receiver, env, svc_name))
+ ((transport_receiver->ops)->get_reply_to_epr (transport_receiver, env, svc_name))
+
+#define AXIS2_TRANSPORT_RECEIVER_GET_CONF_CTX(transport_receiver, env) \
+ ((transport_receiver)->ops->get_conf_ctx(transport_receiver, env))
+
+#define AXIS2_TRANSPORT_RECEIVER_IS_RUNNING(transport_receiver, env) \
+ ((transport_receiver)->ops->is_running(transport_receiver, env))
/*************************** End of function macros ***************************/
Modified: webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_server.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_server.c?rev=369698&r1=369697&r2=369698&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_server.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_server.c Mon Jan 16 22:30:07 2006
@@ -15,6 +15,7 @@
*/
#include <axis2_http_server.h>
+
#include <axis2_http_transport.h>
#include <axis2_http_svr_thread.h>
#include <axis2_transport_in_desc.h>
@@ -255,4 +256,30 @@
return AXIS2_HTTP_SVR_THREAD_IS_RUNNING(server_impl->svr_thread, env);
}
return AXIS2_FALSE;
+}
+
+/**
+ * Following block distinguish the exposed part of the dll.
+ */
+int axis2_get_instance(struct axis2_transport_receiver **inst,
+ axis2_env_t **env)
+{
+ *inst = axis2_http_server_create(env, NULL, 0);
+ if(!(*inst))
+ {
+ return AXIS2_FAILURE;
+ }
+
+ return AXIS2_SUCCESS;
+}
+
+int axis2_remove_instance(axis2_svc_skeleton_t *inst,
+ axis2_env_t **env)
+{
+ axis2_status_t status = AXIS2_FAILURE;
+ if (inst)
+ {
+ status = AXIS2_MSG_RECV_FREE(inst, env);
+ }
+ return status;
}
Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/http_server_main.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/server/http_server_main.c?rev=369698&r1=369697&r2=369698&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/server/http_server_main.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/server/http_server_main.c Mon Jan 16 22:30:07 2006
@@ -49,7 +49,7 @@
{
axis2_allocator_t *allocator = NULL;
axis2_env_t *env = NULL;
- axis2_http_server_t *server = NULL;
+ axis2_transport_receiver_t *server = NULL;
char tmp_str[512];
int port = 9090;
axis2_char_t *repo = "../../../../../deploy";
@@ -96,6 +96,6 @@
system_exit(allocator, env, -1);
}
- AXIS2_HTTP_SERVER_START(server, &env);
+ AXIS2_TRANSPORT_RECEIVER_START(server, &env);
return 0;
}
Modified: webservices/axis2/trunk/c/modules/util/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/Makefile.am?rev=369698&r1=369697&r2=369698&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/util/Makefile.am Mon Jan 16 22:30:07 2006
@@ -15,7 +15,8 @@
file_handler.c \
file_diff.c\
class_loader.c\
- network_handler.c
+ network_handler.c \
+ file.c
libaxis2_util_la_LIBADD =
INCLUDES = -I$(top_builddir)/include \
Modified: webservices/axis2/trunk/c/modules/util/class_loader.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/class_loader.c?rev=369698&r1=369697&r2=369698&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/class_loader.c (original)
+++ webservices/axis2/trunk/c/modules/util/class_loader.c Mon Jan 16 22:30:07 2006
@@ -50,6 +50,7 @@
void *msg_recv = NULL; /* axis2_msg_recv */
void *handler = NULL; /* axis2_handler */
void *module = NULL; /* axis2_module */
+ void *transport_recv = NULL; /* axis2_transport_receiver */
CREATE_FUNCT create_funct = NULL;
axis2_dll_desc_t *dll_desc = NULL;
axis2_status_t status = AXIS2_FAILURE;
@@ -151,6 +152,19 @@
return NULL;
}
return msg_recv;
+ }
+ if(AXIS2_TRANSPORT_RECV_DLL == dll_type)
+ {
+ create_funct(&transport_recv, env);
+ printf("transport receiver loaded successfully\n");
+ if(NULL == transport_recv)
+ {
+ printf("transport_recv is null\n");
+ AXIS2_ERROR_SET((*env)->error,
+ AXIS2_ERROR_TRANSPORT_RECV_CREATION_FAILED,AXIS2_FAILURE);
+ return NULL;
+ }
+ return transport_recv;
}
return NULL;
Modified: webservices/axis2/trunk/c/modules/util/dir_handler.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/dir_handler.c?rev=369698&r1=369697&r2=369698&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/dir_handler.c (original)
+++ webservices/axis2/trunk/c/modules/util/dir_handler.c Mon Jan 16 22:30:07 2006
@@ -15,6 +15,7 @@
*/
#include <axis2_dir_handler.h>
+#include <axis2_file.h>
extern int alphasort();
@@ -37,19 +38,16 @@
struct direct **files = NULL;
int file_select();
axis2_status_t status = AXIS2_FAILURE;
- int file_size = 0;
AXIS2_ENV_CHECK(env, NULL);
file_list = axis2_array_list_create(env, 100);
count = scandir(pathname, &files, file_select, alphasort);
-
/* If no files found, make a non-selectable menu item */
if (count <= 0)
{
printf("No files in this directory:%s\n", pathname);
- exit(0);
+ return NULL;
}
- file_size = sizeof(axis2_file_t);
for (i=1; i < count + 1 ; ++i)
{
@@ -59,7 +57,7 @@
axis2_char_t *path = NULL;
fname = files[i-1]->d_name;
- arch_file = (axis2_file_t *) AXIS2_MALLOC((*env)->allocator, file_size);
+ arch_file = (axis2_file_t *) axis2_file_create(env);
if(!arch_file)
{
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -113,7 +111,9 @@
if ((ptr != NULL) &&
((strcmp(ptr, ".so") == 0)
|| (strcmp(ptr, ".zip") == 0) ))
+ {
return (AXIS2_TRUE);
+ }
else
return(AXIS2_FALSE);
}
Added: webservices/axis2/trunk/c/modules/util/file.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/file.c?rev=369698&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/util/file.c (added)
+++ webservices/axis2/trunk/c/modules/util/file.c Mon Jan 16 22:30:07 2006
@@ -0,0 +1,77 @@
+/*
+ * 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_file.h>
+#include <axis2_string.h>
+
+/************************** End of function prototypes ************************/
+
+axis2_file_t * AXIS2_CALL
+axis2_file_create(axis2_env_t **env)
+{
+ axis2_file_t *file = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ file = (axis2_file_t *) AXIS2_MALLOC((*env)->allocator, sizeof(axis2_file_t));
+
+ if(NULL == file)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ file->name = NULL;
+ file->time_stamp = 0;
+
+ return file;
+}
+
+/***************************Function implementation****************************/
+
+axis2_status_t AXIS2_CALL
+axis2_file_free (axis2_file_t *file,
+ axis2_env_t **env)
+{
+ if(file->name)
+ {
+ AXIS2_FREE((*env)->allocator, file->name);
+ file->name = NULL;
+ }
+
+ if(file)
+ {
+ AXIS2_FREE((*env)->allocator, file);
+ file = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_file_t *AXIS2_CALL
+axis2_file_clone(axis2_file_t *file,
+ axis2_env_t **env)
+{
+ axis2_file_t *new_file = NULL;
+ AXIS2_FUNC_PARAM_CHECK(file, env, NULL);
+ new_file = axis2_file_create(env);
+ new_file->name = AXIS2_STRDUP(file->name, env);
+ if(!new_file->name)
+ {
+ axis2_file_free(new_file, env);
+ new_file = NULL;
+ }
+ new_file->time_stamp = file->time_stamp;
+ return new_file;
+}
Modified: webservices/axis2/trunk/c/test/core/deployment/test_deployment.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/core/deployment/test_deployment.c?rev=369698&r1=369697&r2=369698&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/core/deployment/test_deployment.c (original)
+++ webservices/axis2/trunk/c/test/core/deployment/test_deployment.c Mon Jan 16 22:30:07 2006
@@ -7,10 +7,10 @@
#include <axis2_dep_engine.h>
#include <axis2_env.h>
#include <axis2_allocator.h>
+#include <axis2_class_loader.h>
int axis2_test_dep_engine_load()
{
- axis2_status_t status = AXIS2_FAILURE;
axis2_dep_engine_t *dep_engine = NULL;
axis2_conf_t *conf = NULL;
axis2_array_list_t *in_phases = NULL;
@@ -47,6 +47,11 @@
return 0;
}
+int axis2_test_dep_engine_do_deploy()
+{
+ return 0;
+}
+
int axis2_test_engine_conf_builder_populate_conf()
{
axis2_status_t status = AXIS2_FAILURE;
@@ -87,9 +92,45 @@
return 0;
}
+axis2_test_transport_receiver_load()
+{
+ axis2_dll_desc_t *dll_desc = NULL;
+ axis2_char_t *dll_name = NULL;
+ axis2_transport_receiver_t *transport_recv = NULL;
+ axis2_param_t *impl_info_param = NULL;
+ axis2_bool_t *is_running = NULL;
+ axis2_char_t *expected = NULL;
+ axis2_char_t *axis2c_home = NULL;
+
+ expected = "application";
+ printf("testing axis2_transport_recv load\n");
+ axis2_allocator_t *allocator = axis2_allocator_init (NULL);
+ axis2_env_t *env = axis2_env_create (allocator);
+
+ dll_desc = axis2_dll_desc_create(&env);
+
+ axis2c_home = AXIS2_GETENV("AXIS2C_HOME");
+ dll_name = AXIS2_STRACAT (axis2c_home, "/lib/libaxis2_http_receiver.so", &env);
+ printf("transport receiver name:%s\n", dll_name);
+ AXIS2_DLL_DESC_SET_NAME(dll_desc, &env, dll_name);
+ AXIS2_DLL_DESC_SET_TYPE(dll_desc, &env, AXIS2_TRANSPORT_RECV_DLL);
+ axis2_class_loader_init(&env);
+ impl_info_param = axis2_param_create(&env, NULL, NULL);
+ AXIS2_PARAM_SET_VALUE(impl_info_param, &env, dll_desc);
+ transport_recv = (axis2_transport_receiver_t *) axis2_class_loader_create_dll(&env,
+ impl_info_param);
+ is_running = AXIS2_TRANSPORT_RECEIVER_IS_RUNNING(transport_recv, &env);
+ printf("is_running:%s\n", is_running);
+ AXIS2_FREE(env->allocator, dll_name);
+ return 0;
+}
+
int main()
{
- axis2_test_engine_conf_builder_populate_conf();
+ /*axis2_test_dep_engine_do_deploy();*/
+ /*axis2_test_engine_conf_builder_populate_conf();*/
axis2_test_dep_engine_load();
+ /*axis2_test_transport_receiver_load();*/
+
return 0;
}
Modified: webservices/axis2/trunk/c/test/unit/util/util_dir_handler_test.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/util/util_dir_handler_test.c?rev=369698&r1=369697&r2=369698&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/util/util_dir_handler_test.c (original)
+++ webservices/axis2/trunk/c/test/unit/util/util_dir_handler_test.c Mon Jan 16 22:30:07 2006
@@ -1,4 +1,5 @@
#include <util_dir_handler_test.h>
+#include <axis2_file.h>
#include <axis2_string.h>
void Testaxis2_dir_handler_list_dir(CuTest *tc)