|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jk.config.BaseJkConfig
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 boolean |
append
|
protected java.io.File |
configHome
|
protected boolean |
forwardAll
|
protected java.lang.String |
jkDebug
|
protected java.io.File |
jkLog
|
protected java.lang.String |
jkWorker
|
protected boolean |
legacy
|
protected boolean |
noRoot
|
protected boolean |
regenerate
|
protected java.lang.String |
tomcatHome
|
protected java.io.File |
workersConfig
|
Constructor Summary | |
BaseJkConfig()
|
Method Summary | |
protected boolean |
addExtensionMapping(java.lang.String ctxPath,
java.lang.String ext,
java.io.PrintWriter pw)
Add an extension mapping. |
protected boolean |
addMapping(java.lang.String fullPath,
java.io.PrintWriter pw)
Add a fulling specified mapping. |
void |
execute(LifecycleEvent evt)
Generate configuration files. |
void |
executeContext(Context context,
java.io.PrintWriter mod_jk)
executes the ApacheConfig interceptor. |
protected void |
executeEngine(Engine egn,
java.io.PrintWriter mod_jk)
Generate configuration files. |
protected void |
executeHost(Host hst,
java.io.PrintWriter mod_jk)
Generate configuration files. |
void |
executeServer(Server svr,
java.io.PrintWriter mod_jk)
Generate configuration files. |
protected void |
generateContextMappings(Context context,
java.io.PrintWriter mod_jk)
|
protected boolean |
generateJkHead(java.io.PrintWriter mod_jk)
Generate general options |
protected void |
generateJkTail(java.io.PrintWriter mod_jk)
Generate general options |
protected void |
generateSSLConfig(java.io.PrintWriter mod_jk)
Generate SSL options |
protected void |
generateStupidMappings(Context context,
java.io.PrintWriter mod_jk)
|
protected void |
generateVhostHead(Host host,
java.io.PrintWriter mod_jk)
Generate Virtual Host start |
protected void |
generateVhostTail(Host host,
java.io.PrintWriter mod_jk)
Generate Virtual Host end |
protected java.lang.String |
getAbsoluteDocBase(Context context)
|
static java.io.File |
getConfigFile(java.io.File base,
java.io.File configDir,
java.lang.String defaultF)
|
protected Host |
getHost(Container child)
Get the host associated with this Container (if any). |
protected java.io.PrintWriter |
getWriter()
Get the output Writer. |
protected void |
initProperties()
Initialize defaults for properties that are not set explicitely |
static boolean |
isAbsolute(java.lang.String path)
|
void |
lifecycleEvent(LifecycleEvent evt)
Generate the configuration - only when the server is completely initialized ( before starting ) |
static java.lang.String |
patch(java.lang.String path)
|
void |
setAppend(boolean apnd)
Append to config file. |
void |
setConfigHome(java.lang.String dir)
set a path to the parent directory of the conf folder. |
void |
setForwardAll(boolean b)
If false, we'll try to generate a config that will let apache serve static files. |
void |
setJkDebug(java.lang.String level)
Set the verbosity level ( use debug, error, etc. ) If not set, no log is written. |
void |
setJkLog(java.lang.String path)
set the path to the log file |
void |
setJkWorker(java.lang.String worker)
Sets the JK worker. |
void |
setLegacy(boolean legacy)
|
void |
setNoRoot(boolean b)
Special option - do not generate mappings for the ROOT context. |
void |
setWorkersConfig(java.lang.String path)
set a path to the workers.properties file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.io.File configHome
protected java.io.File workersConfig
protected java.io.File jkLog
protected java.lang.String jkDebug
protected java.lang.String jkWorker
protected boolean noRoot
protected boolean forwardAll
protected java.lang.String tomcatHome
protected boolean regenerate
protected boolean append
protected boolean legacy
Constructor Detail |
public BaseJkConfig()
Method Detail |
public void lifecycleEvent(LifecycleEvent evt)
lifecycleEvent
in interface LifecycleListener
evt
- LifecycleEvent that has occurredpublic void execute(LifecycleEvent evt)
public void executeServer(Server svr, java.io.PrintWriter mod_jk)
protected void generateSSLConfig(java.io.PrintWriter mod_jk)
protected boolean generateJkHead(java.io.PrintWriter mod_jk)
protected void generateJkTail(java.io.PrintWriter mod_jk)
protected void generateVhostHead(Host host, java.io.PrintWriter mod_jk)
protected void generateVhostTail(Host host, java.io.PrintWriter mod_jk)
protected void executeEngine(Engine egn, java.io.PrintWriter mod_jk)
protected void executeHost(Host hst, java.io.PrintWriter mod_jk)
public void executeContext(Context context, java.io.PrintWriter mod_jk)
context
- a Context object.mod_jk
- Writer for output.protected void generateStupidMappings(Context context, java.io.PrintWriter mod_jk)
protected void generateContextMappings(Context context, java.io.PrintWriter mod_jk)
protected java.io.PrintWriter getWriter() throws java.io.IOException
java.io.IOException
protected Host getHost(Container child)
public void setAppend(boolean apnd)
true
if the config information should be
appended.
public void setForwardAll(boolean b)
public void setNoRoot(boolean b)
public void setConfigHome(java.lang.String dir)
However, if the path is set to an absolute path, this attribute is ignored.
If not set, execute() will set this to TOMCAT_HOME.
dir
- - path to a directorypublic void setWorkersConfig(java.lang.String path)
path
- String path to workers.properties filepublic void setJkLog(java.lang.String path)
path
- String path to a filepublic void setJkDebug(java.lang.String level)
public void setJkWorker(java.lang.String worker)
worker
- The workerpublic void setLegacy(boolean legacy)
protected void initProperties()
protected boolean addExtensionMapping(java.lang.String ctxPath, java.lang.String ext, java.io.PrintWriter pw)
protected boolean addMapping(java.lang.String fullPath, java.io.PrintWriter pw)
protected java.lang.String getAbsoluteDocBase(Context context)
public static java.io.File getConfigFile(java.io.File base, java.io.File configDir, java.lang.String defaultF)
public static java.lang.String patch(java.lang.String path)
public static boolean isAbsolute(java.lang.String path)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |