You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2002/05/14 19:01:00 UTC
cvs commit: jakarta-tomcat-connectors/jk/native2/include jk_config.h
costin 02/05/14 10:01:00
Modified: jk/native2/include jk_config.h
Log:
Moved the reconfiguration where it belongs, in jk_config ( from worker_lb ).
This will be a generic mechansim. Added mtime to store the modified time for
the config file. We could implement reconfig by using a periodic check - but
at the moment using jkstatus is much better.
Every time jkstatus is invoked, it'll check the mtime of the config and triger
a reload if needed. To reconfigure jk2 ( well, whatever options we support -
full reconfiguration is too expensive in performance since it would require
many syncs ) you modify the config file and access jkstatus.
Other mechanism will be provided, but that should be easy enough ( and
easy to automate ).
Revision Changes Path
1.6 +12 -3 jakarta-tomcat-connectors/jk/native2/include/jk_config.h
Index: jk_config.h
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_config.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- jk_config.h 9 May 2002 20:52:54 -0000 1.5
+++ jk_config.h 14 May 2002 17:00:59 -0000 1.6
@@ -62,6 +62,8 @@
#ifndef JK_CONFIG_H
#define JK_CONFIG_H
+#include "jk_global.h"
+#include "jk_mt.h"
#include "jk_pool.h"
#include "jk_env.h"
#include "jk_logger.h"
@@ -81,6 +83,7 @@
*/
struct jk_config {
struct jk_bean *mbean;
+ int ver;
/* Parse and process a property. It'll locate the object and call the
* setAttribute on it.
@@ -102,7 +105,10 @@
*/
int (*save)( struct jk_env *env, struct jk_config *cfg,
char *targetFile);
-
+
+ /** Check if the config changed, and update the workers.
+ */
+ int (*update)( struct jk_env *env, struct jk_config *cfg, int *didReload);
/* Private data */
struct jk_pool *pool;
@@ -113,14 +119,17 @@
char *file;
char *section;
+
+ /* Only one thread can update the config
+ */
+ JK_CRIT_SEC cs;
+ time_t mtime;
};
char *jk2_config_replaceProperties(struct jk_env *env, struct jk_map *m,
struct jk_pool *resultPool,
char *value);
-int jk2_config_read(struct jk_env *env, struct jk_config *cfg,
- struct jk_map *map, const char *f);
#ifdef __cplusplus
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>