Save This Page
Home » apache-tomcat-6.0.16-src » org.apache.jk » config » [javadoc | source]
org.apache.jk.config
public class: BaseJkConfig [javadoc | source]
java.lang.Object
   org.apache.jk.config.BaseJkConfig

All Implemented Interfaces:
    LifecycleListener

Direct Known Subclasses:
    IISConfig, NSConfig, ApacheConfig

Base class for automatic jk based configurations based on the Tomcat server.xml settings and the war contexts initialized during startup.

This config interceptor is enabled by inserting a Config element in the <ContextManager> tag body inside the server.xml file like so:

< ContextManager ... >
...
<???Config options />
...
< /ContextManager >
where options can include any of the following attributes:

Field Summary
protected  File configHome     
protected  File workersConfig     
protected  File jkLog     
protected  String jkDebug     
protected  String jkWorker     
protected  boolean noRoot     
protected  boolean forwardAll     
protected  String tomcatHome     
protected  boolean regenerate     
protected  boolean append     
protected  boolean legacy     
Method from org.apache.jk.config.BaseJkConfig Summary:
addExtensionMapping,   addMapping,   execute,   executeContext,   executeEngine,   executeHost,   executeServer,   generateContextMappings,   generateJkHead,   generateJkTail,   generateSSLConfig,   generateStupidMappings,   generateVhostHead,   generateVhostTail,   getAbsoluteDocBase,   getConfigFile,   getHost,   getWriter,   initProperties,   isAbsolute,   lifecycleEvent,   patch,   setAppend,   setConfigHome,   setForwardAll,   setJkDebug,   setJkLog,   setJkWorker,   setLegacy,   setNoRoot,   setWorkersConfig
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.jk.config.BaseJkConfig Detail:
 protected boolean addExtensionMapping(String ctxPath,
    String ext,
    PrintWriter pw) 
    Add an extension mapping. Override with method to generate web server specific configuration
 protected boolean addMapping(String fullPath,
    PrintWriter pw) 
    Add a fulling specified mapping. Override with method to generate web server specific configuration
 public  void execute(LifecycleEvent evt) 
    Generate configuration files. Override with method to generate web server specific configuration.
 public  void executeContext(Context context,
    PrintWriter mod_jk) 
    executes the ApacheConfig interceptor. This method generates apache configuration files for use with mod_jk.
 protected  void executeEngine(Engine egn,
    PrintWriter mod_jk) 
    Generate configuration files. Override with method to generate web server specific configuration.
 protected  void executeHost(Host hst,
    PrintWriter mod_jk) 
    Generate configuration files. Override with method to generate web server specific configuration.
 public  void executeServer(Server svr,
    PrintWriter mod_jk) 
    Generate configuration files. Override with method to generate web server specific configuration.
 protected  void generateContextMappings(Context context,
    PrintWriter mod_jk) 
 protected boolean generateJkHead(PrintWriter mod_jk) 
    Generate general options
 protected  void generateJkTail(PrintWriter mod_jk) 
    Generate general options
 protected  void generateSSLConfig(PrintWriter mod_jk) 
    Generate SSL options
 protected  void generateStupidMappings(Context context,
    PrintWriter mod_jk) 
 protected  void generateVhostHead(Host host,
    PrintWriter mod_jk) 
    Generate Virtual Host start
 protected  void generateVhostTail(Host host,
    PrintWriter mod_jk) 
    Generate Virtual Host end
 protected String getAbsoluteDocBase(Context context) 
 public static File getConfigFile(File base,
    File configDir,
    String defaultF) 
 protected Host getHost(Container child) 
    Get the host associated with this Container (if any).
 protected PrintWriter getWriter() throws IOException 
    Get the output Writer. Override with method to generate web server specific configuration.
 protected  void initProperties() 
    Initialize defaults for properties that are not set explicitely
 public static boolean isAbsolute(String path) 
 public  void lifecycleEvent(LifecycleEvent evt) 
    Generate the configuration - only when the server is completely initialized ( before starting )
 public static String patch(String path) 
 public  void setAppend(boolean apnd) 
    Append to config file. Set to true if the config information should be appended.
 public  void setConfigHome(String dir) 
    set a path to the parent directory of the conf folder. That is, the parent directory within which path setters would be resolved against, if relative. For example if ConfigHome is set to "/home/tomcat" and regConfig is set to "conf/mod_jk.conf" then the resulting path used would be: "/home/tomcat/conf/mod_jk.conf".

    However, if the path is set to an absolute path, this attribute is ignored.

    If not set, execute() will set this to TOMCAT_HOME.

 public  void setForwardAll(boolean b) 
    If false, we'll try to generate a config that will let apache serve static files. The default is true, forward all requests in a context to tomcat.
 public  void setJkDebug(String level) 
    Set the verbosity level ( use debug, error, etc. ) If not set, no log is written.
 public  void setJkLog(String path) 
    set the path to the log file
 public  void setJkWorker(String worker) 
    Sets the JK worker.
 public  void setLegacy(boolean legacy) 
 public  void setNoRoot(boolean b) 
    Special option - do not generate mappings for the ROOT context. The default is true, and will not generate the mappings, not redirecting all pages to tomcat (since /* matches everything). This means that the web server's root remains intact but isn't completely servlet/JSP enabled. If the ROOT webapp can be configured with the web server serving static files, there's no problem setting this option to false. If not, then setting it true means the web server will be out of picture for all requests.
 public  void setWorkersConfig(String path) 
    set a path to the workers.properties file.