Author: damitha
Date: Sun Jan 8 20:51:45 2006
New Revision: 367197
URL: http://svn.apache.org/viewcvs?rev=367197&view=rev
Log:
Added new file
Added:
webservices/axis2/trunk/c/include/axis2_module.h
Added: webservices/axis2/trunk/c/include/axis2_module.h
URL:
http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_module.h?rev=367197&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_module.h (added)
+++ webservices/axis2/trunk/c/include/axis2_module.h Sun Jan 8 20:51:45 2006
@@ -0,0 +1,103 @@
+/*
+ * 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_MODULE_H
+#define AXIS2_MODULE_H
+
+/**
+ * @file axis2_module.h
+ * @brief axis2 module interface
+ * Every module provides an implementation of this class. Modules are in one of
+ * three states: "available" and "initialized". All modules that the runtime
+ * detects (from the system modules/ directory or from other means) are said to
+ * be in the "available" state. If some service indicates a dependency on this
+ * module then the module is initialized (once for the life of the system) and
+ * the state changes to "initialized".
+ * <p/>
+ * <p/>Any module which is in the "initialized" state can be engaged as needed
+ * by the engine to respond to a message. Currently module engagement is done
+ * via deployment (using module.xml). In the future we may engage modules
+ * programmatically by introducing an engage() method to this interface,
thereby
+ * allowing more dynamic scenarios.
+ */
+
+#include <axis2.h>
+#include <axis2_error.h>
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axis2_allocator.h>
+#include <axis2_string.h>
+#include <axis2_conf.h>
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** @defgroup axis2_module Module
+ * @ingroup axis2_module
+ * @{
+ */
+
+struct axis2_conf;
+typedef struct axis2_module_ops axis2_module_ops_t;
+typedef struct axis2_module axis2_module_t;
+
+AXIS2_DECLARE_DATA struct axis2_module_ops
+{
+ /* initialize the module */
+ axis2_status_t (AXIS2_CALL *
+ init) (struct axis2_conf *axis2_system,
+ axis2_env_t **env);
+
+ /* 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);
+
+
+} ;
+
+AXIS2_DECLARE_DATA struct axis2_module
+{
+ axis2_module_ops_t *ops;
+};
+
+/**
+ * Creates axis2_module struct
+ * @return pointer to newly created axis2_module
+ */
+AXIS2_DECLARE(axis2_module_t *)
+axis2_module_create (axis2_env_t **env);
+
+/*************************** Function macros
**********************************/
+
+#define AXIS2_MODULE_INIT(module, env) \
+ ((module->ops)->init (module, env))
+
+#define AXIS2_MODULE_SHUTDOWN(module, env) \
+ ((module->ops)->free (module, env))
+
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* AXIS2_MODULE_H */