You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2006/05/02 13:28:48 UTC
svn commit: r398910 - in /webservices/axis2/trunk/c: include/axis2_client.h
include/axis2_env.h modules/util/env.c samples/Makefile.am
samples/user_guide/clients/echo_blocking.c
Author: samisa
Date: Tue May 2 04:28:36 2006
New Revision: 398910
URL: http://svn.apache.org/viewcvs?rev=398910&view=rev
Log:
Provided convinient method to create the env.
Also fixed a few bugs
Modified:
webservices/axis2/trunk/c/include/axis2_client.h
webservices/axis2/trunk/c/include/axis2_env.h
webservices/axis2/trunk/c/modules/util/env.c
webservices/axis2/trunk/c/samples/Makefile.am
webservices/axis2/trunk/c/samples/user_guide/clients/echo_blocking.c
Modified: webservices/axis2/trunk/c/include/axis2_client.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_client.h?rev=398910&r1=398909&r2=398910&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_client.h (original)
+++ webservices/axis2/trunk/c/include/axis2_client.h Tue May 2 04:28:36 2006
@@ -25,11 +25,8 @@
#include <axis2_async_result.h>
#include <axis2_callback.h>
-#include <axis2_callback_recv.h>
#include <axis2_call.h>
-#include <axis2_listener_manager.h>
#include <axis2_mep_client.h>
-#include <axis2_msg_sender.h>
#include <axis2_op_client.h>
#include <axis2_options.h>
#include <axis2_stub.h>
Modified: webservices/axis2/trunk/c/include/axis2_env.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_env.h?rev=398910&r1=398909&r2=398910&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_env.h (original)
+++ webservices/axis2/trunk/c/include/axis2_env.h Tue May 2 04:28:36 2006
@@ -69,6 +69,16 @@
axis2_thread_pool_t *thread_pool;
} axis2_env_t;
+ /**
+ * Creates an environment struct with all of its default parts,
+ * that is an allocator, error, log and a thread pool.
+ * @param log_file name of the log file
+ * @param log_level log level to be used
+ * @return pointer to the newly created environment struct
+ */
+ AXIS2_DECLARE(axis2_env_t *) axis2_env_create_all (axis2_char_t *log_file,
+ axis2_log_levels_t log_level);
+
/**
* Creates an environment struct. Users of axis2 should not use this function
* to create an environment. He should use the other two create functions.
Modified: webservices/axis2/trunk/c/modules/util/env.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/env.c?rev=398910&r1=398909&r2=398910&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/env.c (original)
+++ webservices/axis2/trunk/c/modules/util/env.c Tue May 2 04:28:36 2006
@@ -18,7 +18,31 @@
#include <string.h>
#include <axis2_env.h>
#include <axis2_error_default.h>
+#include <axis2_log_default.h>
#include <axis2_string.h>
+
+AXIS2_DECLARE(axis2_env_t *) axis2_env_create_all (axis2_char_t *log_file,
+ axis2_log_levels_t log_level)
+{
+ axis2_env_t *env = NULL;
+ axis2_error_t *error = NULL;
+ axis2_log_t *log = NULL;
+ axis2_allocator_t *allocator = NULL;
+ axis2_thread_pool_t *thread_pool = NULL;
+
+ if (!log_file)
+ log_file = "/dev/stderr";
+
+ allocator = axis2_allocator_init (NULL);
+ error = axis2_error_create(allocator);
+ log = axis2_log_create(allocator, NULL, log_file);
+ thread_pool = axis2_thread_pool_init(allocator);
+ env = axis2_env_create_with_error_log_thread_pool(allocator, error, log, thread_pool);
+ env->log->level = log_level;
+ axis2_error_init();
+
+ return env;
+}
AXIS2_DECLARE(axis2_status_t) axis2_env_free (axis2_env_t *env)
{
Modified: webservices/axis2/trunk/c/samples/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/samples/Makefile.am?rev=398910&r1=398909&r2=398910&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/Makefile.am (original)
+++ webservices/axis2/trunk/c/samples/Makefile.am Tue May 2 04:28:36 2006
@@ -1,5 +1,5 @@
samplesdir=$(prefix)/samples
samples_DATA=AUTHORS autogen.sh ChangeLog configure.ac Makefile.am NEWS README configure Makefile.in config.h.in INSTALL COPYING ../install-sh ../config.guess ../ltmain.sh ../depcomp ../missing ../config.sub
-SUBDIRS = server client
+SUBDIRS = server client user_guide
install-data-hook:
chmod 755 $(samplesdir)/configure $(samplesdir)/autogen.sh
Modified: webservices/axis2/trunk/c/samples/user_guide/clients/echo_blocking.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/samples/user_guide/clients/echo_blocking.c?rev=398910&r1=398909&r2=398910&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/user_guide/clients/echo_blocking.c (original)
+++ webservices/axis2/trunk/c/samples/user_guide/clients/echo_blocking.c Tue May 2 04:28:36 2006
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-#include <axis2_client.h>
-#include <axis2_om.h>
-#include <axis2_util.h>
#include <stdio.h>
+#include <axis2_util.h>
+#include <axis2_om.h>
#include <axis2_soap.h>
+#include <axis2_client.h>
axis2_om_node_t *
build_om_programatically(axis2_env_t **env);
@@ -28,9 +28,9 @@
axis2_om_node_t *node = NULL;
axis2_status_t status = AXIS2_FAILURE;
axis2_env_t *env = NULL;
- axis2_error_t *error = NULL;
+ /*axis2_error_t *error = NULL;
axis2_log_t *log = NULL;
- axis2_allocator_t *allocator = NULL;
+ axis2_allocator_t *allocator = NULL;*/
axis2_char_t *address = NULL;
axis2_char_t *wsa_action = NULL;
axis2_char_t *client_home = NULL;
@@ -46,12 +46,12 @@
axis2_msg_ctx_t *response_ctx = NULL;
/* set up the envioronment with allocator and log*/
- allocator = axis2_allocator_init (NULL);
+ /*allocator = axis2_allocator_init (NULL);
error = axis2_error_create(allocator);
- log = axis2_log_create(allocator, NULL, "addr_echo.log");
- env = axis2_env_create_with_error_log(allocator, error, log);
- env->log->level = AXIS2_LOG_LEVEL_TRACE;
- axis2_error_init();
+ log = axis2_log_create(allocator, NULL, "addr_echo.log");*/
+ env = axis2_env_create_all("echo_blocking.log", AXIS2_LOG_LEVEL_TRACE);
+ /*env->log->level = AXIS2_LOG_LEVEL_TRACE;
+ axis2_error_init();*/
/* Set up deploy folder. It is from the deploy folder, the configuration is picked up
* using the axis2.xml file.