Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 10133 invoked by uid 500); 10 May 2001 09:03:15 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: tomcat-dev@jakarta.apache.org Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 9952 invoked by uid 500); 10 May 2001 09:02:59 -0000 Delivered-To: apmail-jakarta-tomcat-4.0-cvs@apache.org Date: 10 May 2001 09:02:48 -0000 Message-ID: <20010510090248.9850.qmail@apache.org> From: pier@apache.org To: jakarta-tomcat-4.0-cvs@apache.org Subject: cvs commit: jakarta-tomcat-4.0/connectors/include wa_main.h pier 01/05/10 02:02:48 Modified: connectors/include wa_main.h Log: Moved the wa_provider structure from wa_provider.h Revision Changes Path 1.3 +101 -4 jakarta-tomcat-4.0/connectors/include/wa_main.h Index: wa_main.h =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/connectors/include/wa_main.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- wa_main.h 2001/05/10 06:25:58 1.2 +++ wa_main.h 2001/05/10 09:02:45 1.3 @@ -58,7 +58,7 @@ /** * @package Main * @author Pier Fumagalli - * @version $Id: wa_main.h,v 1.2 2001/05/10 06:25:58 pier Exp $ + * @version $Id: wa_main.h,v 1.3 2001/05/10 09:02:45 pier Exp $ */ #ifndef _WA_MAIN_H_ #define _WA_MAIN_H_ @@ -76,6 +76,90 @@ }; /** + * The WebApp Library connection provider structure. + *
+ * This structure contains all data and function pointers to be implemented + * by a connection provider. + */ +struct wa_provider { + /** + * The name of this provider. + */ + const char *name; + + /** + * Initialize a provider. + *
+ * This function is called when the WebApp Library is initialized, before + * any web application is deployed. + * + * @return An error message or NULL. + */ + const char *(*init)(void); + + /** + * Notify the provider of its imminent startup. + *
+ * After all configurations are generated, this function is called to + * notify the provider to expect requests to be handled. + */ + void (*startup)(void); + + /** + * Cleans up all resources allocated by the provider. + *
+ * The provider is notified that no further requests will be handled, and + * the WebApp library is being destroyed. + */ + void (*destroy)(void); + + /** + * Configure a connection with the parameter from the web server + * configuration file. + * + * @param conn The connection to configure. + * @param param The extra parameter from web server configuration. + * @return An error message or NULL. + */ + const char *(*connect)(wa_connection *conn, const char *param); + + /** + * Receive notification of the deployment of an application. + * + * @param appl The application being deployed. + * @return An error message or NULL. + */ + const char *(*deploy)(wa_application *appl); + + /** + * Describe the configuration member found in a connection. + * + * @param conn The connection for wich a description must be produced. + * @param pool The memory pool where the returned string must be allocated. + * @return The description for a connection configuration or NULL. + */ + char *(*conninfo)(wa_connection *conn, apr_pool_t *pool); + + /** + * Describe the configuration member found in a web application. + * + * @param appl The application for wich a description must be produced. + * @param pool The memory pool where the returned string must be allocated. + * @return The description for an application configuration or NULL. + */ + char *(*applinfo)(wa_application *appl, apr_pool_t *pool); + + /** + * Handle a connection from the web server. + * + * @param req The request data. + * @param appl The application associated with the request. + * @param return The HTTP status code of the response. + */ + int (*handle)(wa_request *req, wa_application *appl); +}; + +/** * Initialize the WebApp Library. * This function must be called before any other calls to any other * function to set up the APR and WebApp Library internals. If any other @@ -92,12 +176,19 @@ * and must be called before the underlying web server process exits. Any call * to any other WebApp Library function after this function has been invoked * will result in impredictable results. - * - * @return NULL on success or an error message on faliure. */ -const char *wa_destroy(void); +void wa_startup(void); /** + * Clean up the WebApp Library. + * This function releases all memory and resouces used by the WebApp library + * and must be called before the underlying web server process exits. Any call + * to any other WebApp Library function after this function has been invoked + * will result in impredictable results. + */ +void wa_destroy(void); + +/** * Deploy a web-application. * * @param a The wa_application member of the web-application to @@ -140,5 +231,11 @@ * members can be retrieved. */ extern wa_chain *wa_configuration; + +/** + * A NULL-terminated array of all compiled-in wa_provider + * members. + */ +extern wa_provider *wa_providers[]; #endif /* ifndef _WA_MAIN_H_ */