costin 02/03/18 09:56:40
Modified: jk/native2/include jk_channel.h jk_logger.h jk_uriEnv.h
jk_uriMap.h jk_vm.h jk_worker.h jk_workerEnv.h
Log:
Modified to match the new config mechanism.
The configuration is set using the jk_bean, which is managed by jk_config.
In theory jk_config doesn't need to know about the details of the object -
the name of the module and the name of the property is enough.
I also made the init() more consistent ( both internally and with the java
patterns ).
Revision Changes Path
1.7 +1 -14 jakarta-tomcat-connectors/jk/native2/include/jk_channel.h
Index: jk_channel.h
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_channel.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- jk_channel.h 2 Mar 2002 05:43:28 -0000 1.6
+++ jk_channel.h 18 Mar 2002 17:56:40 -0000 1.7
@@ -100,7 +100,7 @@
* @author Costin Manolache
*/
struct jk_channel {
- char *name;
+ struct jk_bean *mbean;
/* JK_TRUE if the channel is 'stream' based, i.e. it works using
send() followed by blocking reads().
@@ -163,19 +163,6 @@
struct jk_endpoint *endpoint,
struct jk_ws_service *r );
-
-
- /** Set a channel property. Properties are used to configure the
- * communication channel ( example: port, host, file, shmem_name, etc).
- */
- int (JK_METHOD *setProperty)(struct jk_env *env, jk_channel_t *_this,
- char *name, char *value);
-
- /** Get a channel property
- */
- char *(JK_METHOD *getProperty)(struct jk_env *env, jk_channel_t *_this,
- char *name);
-
void *_privatePtr;
};
1.5 +4 -14 jakarta-tomcat-connectors/jk/native2/include/jk_logger.h
Index: jk_logger.h
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_logger.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- jk_logger.h 16 Dec 2001 23:17:23 -0000 1.4
+++ jk_logger.h 18 Mar 2002 17:56:40 -0000 1.5
@@ -58,7 +58,7 @@
/***************************************************************************
* Description: Logger object definitions *
* Author: Gal Shachor <[EMAIL PROTECTED]> *
- * Version: $Revision: 1.4 $ *
+ * Version: $Revision: 1.5 $ *
***************************************************************************/
#ifndef JK_LOGGER_H
@@ -83,22 +83,12 @@
* in the log ).
*/
struct jk_logger {
+ struct jk_bean *mbean;
+ char *name;
void *logger_private;
int level;
- void (JK_METHOD *setProperty)(struct jk_env *env,
- jk_logger_t *_this,
- const char *name,
- const char *value );
-
- char *(JK_METHOD *getProperty)(struct jk_env *env,
- jk_logger_t *_this,
- const char *name,
- const char *def );
-
- int (JK_METHOD *open)( struct jk_env *env,
- jk_logger_t *_this,
- struct jk_map *properties );
+ int (JK_METHOD *init)( struct jk_env *env, jk_logger_t *_this );
void (JK_METHOD *close)( struct jk_env *env, jk_logger_t *_this );
1.8 +2 -12 jakarta-tomcat-connectors/jk/native2/include/jk_uriEnv.h
Index: jk_uriEnv.h
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_uriEnv.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- jk_uriEnv.h 1 Mar 2002 00:45:58 -0000 1.7
+++ jk_uriEnv.h 18 Mar 2002 17:56:40 -0000 1.8
@@ -95,6 +95,8 @@
struct jk_uriEnv {
+ struct jk_bean *mbean;
+
struct jk_pool *pool;
struct jk_workerEnv *workerEnv;
@@ -168,18 +170,6 @@
int contextId;
/* -------------------- Methods -------------------- */
-
- int (*setProperty)( struct jk_env *env,
- struct jk_uriEnv *_this,
- const char *name, char *value);
-
- char *(*getProperty)( struct jk_env *env,
- struct jk_uriEnv *_this,
- const char *name);
-
- char **(*getPropertyNames)( struct jk_env *env,
- struct jk_uriEnv *_this );
-
int (*init)( struct jk_env *env, struct jk_uriEnv *_this);
1.10 +5 -14 jakarta-tomcat-connectors/jk/native2/include/jk_uriMap.h
Index: jk_uriMap.h
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_uriMap.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- jk_uriMap.h 2 Mar 2002 06:14:25 -0000 1.9
+++ jk_uriMap.h 18 Mar 2002 17:56:40 -0000 1.10
@@ -97,6 +97,8 @@
typedef struct jk_uriMap jk_uriMap_t;
struct jk_uriMap {
+ struct jk_bean *mbean;
+
/* map URI->WORKER */
struct jk_uriEnv **maps;
int size;
@@ -106,9 +108,6 @@
/* ---------- Methods ---------- */
- int (*setProperty)( struct jk_env *env, jk_uriMap_t *_this,
- char *name, char *value );
-
/** Initialize the map. This should be called after all workers
were added. It'll check if mappings have valid workers.
*/
@@ -116,17 +115,9 @@
void (*destroy)( struct jk_env *env, jk_uriMap_t *_this );
- struct jk_uriEnv *(*createUriEnv)(struct jk_env *env,
- struct jk_uriMap *_this,
- const char *vhost,
- const char *name );
-
- /** Add a servlet mapping. Can be done before init()
- */
- jk_uriEnv_t *(*addMapping)( struct jk_env *env, jk_uriMap_t *_this,
- const char *vhost,
- const char *uri,
- const char *worker);
+ int (*addUriEnv)(struct jk_env *env,
+ struct jk_uriMap *uriMap,
+ struct jk_uriEnv *uriEnv);
/** Check the uri for potential security problems
*/
1.2 +7 -3 jakarta-tomcat-connectors/jk/native2/include/jk_vm.h
Index: jk_vm.h
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_vm.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- jk_vm.h 12 Jan 2002 04:33:53 -0000 1.1
+++ jk_vm.h 18 Mar 2002 17:56:40 -0000 1.2
@@ -68,8 +68,14 @@
#include "jk_env.h"
#include "jk_logger.h"
#include "jk_service.h"
+#include "jk_map.h"
struct jk_vm {
+ struct jk_bean *mbean;
+
+ /* General name/value properties
+ */
+ struct jk_map *properties;
struct jk_pool *pool;
/** Should be JavaVM *, but we want this to be compilable
@@ -111,9 +117,7 @@
/** Process the properties and set internal structures
*/
- int (*init)(struct jk_env *env, struct jk_vm *p,
- struct jk_map *props, char *prefix);
-
+ int (*init)(struct jk_env *env, struct jk_vm *p );
/** Load the java libs, prepare for openning.
*/
1.13 +4 -11 jakarta-tomcat-connectors/jk/native2/include/jk_worker.h
Index: jk_worker.h
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_worker.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- jk_worker.h 2 Mar 2002 05:42:12 -0000 1.12
+++ jk_worker.h 18 Mar 2002 17:56:40 -0000 1.13
@@ -58,7 +58,7 @@
/***************************************************************************
* Description: Workers controller header file *
* Author: Gal Shachor <[EMAIL PROTECTED]> *
- * Version: $Revision: 1.12 $ *
+ * Version: $Revision: 1.13 $ *
***************************************************************************/
#ifndef JK_WORKER_H
@@ -124,11 +124,10 @@
*
*/
struct jk_worker {
-
+ struct jk_bean *mbean;
+
struct jk_workerEnv *workerEnv;
- char *name;
- char *type;
-
+
/** The id of the tomcat instance we connect to. We may have multiple
workers connecting to a single tomcat. If no route is defined,
the worker name will be the route name. The route can be the
@@ -185,12 +184,6 @@
jk_worker_t **lb_workers;
struct jk_map *lbWorkerMap;
int num_of_workers;
-
- int (JK_METHOD *setProperty)(struct jk_env *env, jk_worker_t *_this,
- char *name, char *value );
-
- char *(JK_METHOD *getProperty)(struct jk_env *env, jk_worker_t *_this,
- char *name );
/*
* Do whatever initialization needs to be done to start this worker up.
1.13 +12 -48 jakarta-tomcat-connectors/jk/native2/include/jk_workerEnv.h
Index: jk_workerEnv.h
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_workerEnv.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- jk_workerEnv.h 2 Mar 2002 05:43:28 -0000 1.12
+++ jk_workerEnv.h 18 Mar 2002 17:56:40 -0000 1.13
@@ -58,7 +58,7 @@
/***************************************************************************
* Description: Workers controller header file *
* Author: Gal Shachor <[EMAIL PROTECTED]> *
- * Version: $Revision: 1.12 $ *
+ * Version: $Revision: 1.13 $ *
***************************************************************************/
#ifndef JK_WORKERENV_H
@@ -66,6 +66,7 @@
#include "jk_logger.h"
#include "jk_endpoint.h"
+#include "jk_config.h"
#include "jk_worker.h"
#include "jk_map.h"
#include "jk_uriMap.h"
@@ -81,6 +82,7 @@
struct jk_worker;
struct jk_endpoint;
struct jk_env;
+struct jk_config;
struct jk_uriMap;
struct jk_uriEnv;
struct jk_map;
@@ -96,12 +98,7 @@
* about web-server, uri to worker map....
*/
struct jk_workerEnv {
- /* The URI to WORKER map. Set via JkMount in httpd.conf,
- uriworker.properties or autoconfiguration.
-
- It is empty if 'native' mapping is used ( SetHandler )
- */
- /* struct jk_map *uri_to_context; */
+ struct jk_bean *mbean;
/* Use this pool for all global settings
*/
@@ -189,6 +186,8 @@
int envvars_in_use;
struct jk_map * envvars;
+ struct jk_config *config;
+
/* Handlers. This is a dispatch table for messages, for
* each message id we have an entry containing the jk_handler_t.
* lastMessageId is the size of the table.
@@ -208,50 +207,15 @@
void *_private;
/* -------------------- Methods -------------------- */
- /** Set a jk property. This is similar with the mechanism
- * used by java side ( with individual setters for
- * various properties ), except we use a single method
- * and a big switch
- *
- * As in java beans, setting a property may have side effects
- * like changing the log level or reading a secondary
- * properties file.
- *
- * Changing a property at runtime will also be supported for
- * some properties.
- * XXX Document supported properties as part of
- * workers.properties doc.
- * XXX Implement run-time change in the status/ctl workers.
- */
- int (*setProperty)( struct jk_env *env,
- struct jk_workerEnv *_this,
- const char *name, char *value);
-
- char *(*getProperty)( struct jk_env *env,
- struct jk_workerEnv *_this,
- const char *name);
-
- /** Return a list of supported properties.
- Not all properties can be set ( some may be runtime
- status ).
- @experimental This is not a final API, I would use
- an external config ( DTD/schema or even MIB-like ? )
- */
- char **(*getPropertyNames)( struct jk_env *env,
- struct jk_workerEnv *_this );
-
- /** Get worker by name
- */
- struct jk_worker *(*getWorkerForName)(struct jk_env *env,
- struct jk_workerEnv *_this,
- const char *name);
+ int (*registerHandler)(struct jk_env *env,
+ struct jk_workerEnv *_this,
+ struct jk_handler *h);
- struct jk_worker *(*createWorker)(struct jk_env *env,
- struct jk_workerEnv *_this,
- const char *name,
- char *type);
+ int (*addWorker)(struct jk_env *env,
+ struct jk_workerEnv *_this,
+ struct jk_worker *w);
/** Call the handler associated with the message type.
*/
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>