costin 01/08/23 08:01:57 Modified: src/share/org/apache/tomcat/modules/config BaseJkConfig.java Log: Added 'regenerate' property to config generator modules. If the attribute is set, config will be generated at startup. We can now inlcude the modules by default, since they'll do nothing ( the current behavior ). If -jkconf option is present on the command line ( or ContextManager properties ), the config modules will generate the config file ( -jkconf only generates config, it does not start tomcat !). Revision Changes Path 1.4 +25 -5 jakarta-tomcat/src/share/org/apache/tomcat/modules/config/BaseJkConfig.java Index: BaseJkConfig.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/BaseJkConfig.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- BaseJkConfig.java 2001/08/11 03:37:28 1.3 +++ BaseJkConfig.java 2001/08/23 15:01:57 1.4 @@ -1,4 +1,4 @@ -/* $Id: BaseJkConfig.java,v 1.3 2001/08/11 03:37:28 larryi Exp $ +/* $Id: BaseJkConfig.java,v 1.4 2001/08/23 15:01:57 costin Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -118,7 +118,7 @@ <p> @author Costin Manolache @author Larry Isaacs - @version $Revision: 1.3 $ + @version $Revision: 1.4 $ */ public class BaseJkConfig extends BaseInterceptor { protected File configHome = null; @@ -132,8 +132,22 @@ protected boolean forwardAll=true; protected String tomcatHome; - + protected boolean regenerate=false; + // -------------------- Tomcat callbacks -------------------- + + public void addInterceptor( ContextManager cm, + Context ctx, + BaseInterceptor bi ) + throws TomcatException + { + if( cm.getProperty( "jkconf" ) != null ) { + // we are in config generation mode - prevent tomcat + // from starting. + //??? cm.setNote("nostart", this ); + } + } + // Auto-config should be able to react to dynamic config changes, // and regenerate the config. @@ -145,7 +159,13 @@ { if( state != ContextManager.STATE_INIT ) return; - execute( cm ); + // Generate the config only if "regenerate" property is + // set on the module or if an explicit "jkconf" option has + // been set on context manager. + if( regenerate || + cm.getProperty("jkconf") !=null) { + execute( cm ); + } } public void contextInit(Context ctx) @@ -331,4 +351,4 @@ return docBase; } -} \ No newline at end of file +}