| Method from org.apache.jk.config.IISConfig Detail: |
protected boolean addMapping(String fullPath,
PrintWriter uri_worker) {
if( log.isDebugEnabled() )
log.debug( "Adding map for " + fullPath );
uri_worker.println(fullPath + "=$(default.worker)" );
return true;
}
Add a fulling specified IIS mapping. |
protected boolean addMapping(String ctxPath,
String ext,
PrintWriter uri_worker) {
if( log.isDebugEnabled() )
log.debug( "Adding extension map for " + ctxPath + "/*." + ext );
if(! ext.startsWith("/") )
ext = "/" + ext;
if(ext.length() > 1)
uri_worker.println(ctxPath + "/*." + ext + "=$(default.worker)");
return true;
}
Add an IIS extension mapping. |
protected void generateContextMappings(Context context,
PrintWriter uri_worker) {
String ctxPath = context.getPath();
String nPath=("".equals(ctxPath)) ? "/" : ctxPath;
if( noRoot && "".equals(ctxPath) ) {
log.debug("Ignoring root context in forward-all mode ");
return;
}
// Static files will be served by IIS
uri_worker.println();
uri_worker.println("#########################################################");
uri_worker.println("# Auto configuration for the " + nPath + " context.");
uri_worker.println("#########################################################");
uri_worker.println();
// Static mappings are not set in uriworkermap, but must be set with IIS admin.
// InvokerInterceptor - it doesn't have a container,
// but it's implemented using a special module.
// XXX we need to better collect all mappings
if(context.getLoginConfig() != null) {
String loginPage = context.getLoginConfig().getLoginPage();
if(loginPage != null) {
int lpos = loginPage.lastIndexOf("/");
String jscurl = loginPage.substring(0,lpos+1) + "j_security_check";
addMapping( ctxPath, jscurl, uri_worker);
}
}
String [] servletMaps=context.findServletMappings();
for( int ii=0; ii < servletMaps.length ; ii++) {
addMapping( ctxPath , servletMaps[ii] , uri_worker );
}
}
|
protected boolean generateJkHead(PrintWriter mod_jk) {
try {
PrintWriter regfile = new PrintWriter(new FileWriter(regConfig));
log.info("Generating IIS registry file = "+regConfig );
generateRegistrySettings(regfile);
regfile.close();
} catch(IOException iex) {
log.warn("Unable to generate registry file " +regConfig);
return false;
}
log.info("Generating IIS URI worker map file = "+uriConfig );
generateUriWorkerHeader(mod_jk);
return true;
}
|
protected void generateStupidMappings(Context context,
PrintWriter uri_worker) {
String ctxPath = context.getPath();
String nPath=("".equals(ctxPath)) ? "/" : ctxPath;
if( noRoot && "".equals(ctxPath) ) {
log.debug("Ignoring root context in forward-all mode ");
return;
}
// map all requests for this context to Tomcat
uri_worker.println(nPath +"=$(default.worker)");
if( "".equals(ctxPath) ) {
uri_worker.println(nPath +"*=$(default.worker)");
uri_worker.println(
"# Note: To correctly serve the Tomcat's root context, IIS's Home Directory must");
uri_worker.println(
"# must be set to: \"" + getAbsoluteDocBase(context) + "\"");
}
else
uri_worker.println(nPath +"/*=$(default.worker)");
}
Forward all requests for a context to tomcat.
The default. |
protected PrintWriter getWriter() throws IOException {
String abUriConfig = uriConfig.getAbsolutePath();
return new PrintWriter(new FileWriter(abUriConfig,append));
}
|
protected void initProperties() {
super.initProperties();
regConfig=getConfigFile( regConfig, configHome, ISAPI_REG_FILE);
workersConfig=getConfigFile( workersConfig, configHome, WORKERS_CONFIG);
uriConfig=getConfigFile( uriConfig, configHome, URI_WORKERS_MAP_CONFIG);
jkLog=getConfigFile( jkLog, configHome, ISAPI_LOG_LOCATION);
}
Initialize defaults for properties that are not set
explicitely |
public void setRegConfig(String path) {
regConfig= (path==null)?null:new File(path);
}
set the path to the output file for the auto-generated
isapi_redirect registry file. If this path is relative
then getRegConfig() will resolve it absolutely against
the getConfigHome() path.
|
public void setUriConfig(String path) {
uriConfig= (path==null?null:new File(path));
}
set a path to the uriworkermap.properties file. |