org.apache.tomcat.modules.config
Class NSConfig

java.lang.Object
  |
  +--org.apache.tomcat.core.BaseInterceptor
        |
        +--org.apache.tomcat.modules.config.BaseJkConfig
              |
              +--org.apache.tomcat.modules.config.NSConfig

public class NSConfig
extends BaseJkConfig

Generates automatic Netscape nsapi_redirect configurations based on the Tomcat server.xml settings and the war contexts initialized during startup.

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

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

Version:
$Revision: 1.10 $
Author:
Costin Manolache, Larry Isaacs, Gal Shachor

Field Summary
static java.lang.String NS_CONFIG
           
static java.lang.String NSAPI_LOG_LOCATION
           
static java.lang.String NSAPI_REDIRECTOR
          default location of nsapi plug-in.
static java.lang.String WORKERS_CONFIG
           
 
Fields inherited from class org.apache.tomcat.modules.config.BaseJkConfig
configHome, forwardAll, jkDebug, jkLog, jkWorker, noRoot, regenerate, tomcatHome, workersConfig
 
Fields inherited from class org.apache.tomcat.core.BaseInterceptor
cm, ct, ctx, debug, DECLINED, loghelper, OK
 
Constructor Summary
NSConfig()
           
 
Method Summary
protected  boolean addExtensionMapping(java.lang.String ctxPath, java.lang.String ext, java.io.PrintWriter objfile)
          Add a Netscape extension mapping.
protected  boolean addMapping(java.lang.String fullPath, java.io.PrintWriter objfile)
          Add a fulling specified Netscape mapping.
 void execute(ContextManager cm)
          executes the NSConfig interceptor.
protected  void initProperties(ContextManager cm)
          Initialize defaults for properties that are not set explicitely
 void setNsapiJk(java.lang.String path)
          set the path to the nsapi plugin module
 void setObjConfig(java.lang.String path)
          set the path to the output file for the auto-generated isapi_redirect registry file.
 void setObjectName(java.lang.String name)
          Set the name for the Object that implements the jk_service call.
 
Methods inherited from class org.apache.tomcat.modules.config.BaseJkConfig
addInterceptor, addMapping, contextInit, engineState, getAbsoluteDocBase, initWorker, setConfigHome, setForwardAll, setJkDebug, setJkLog, setJkWorker, setNoRoot, setWorkersConfig
 
Methods inherited from class org.apache.tomcat.core.BaseInterceptor
addContainer, addContext, addHandler, addSecurityConstraint, afterBody, authenticate, authorize, beforeBody, beforeCommit, contextMap, contextShutdown, contextState, engineInit, engineShutdown, engineStart, engineStop, findSession, getContext, getContextManager, getDebug, getInfo, getLog, getNote, getNote, handleError, log, log, log, log, postReadRequest, postRequest, postService, postServletDestroy, postServletInit, preService, preServletDestroy, preServletInit, registerHooks, reload, removeContainer, removeContext, removeHandler, removeInterceptor, requestMap, sessionState, setContext, setContextManager, setDebug, setInfo, setNote, setNote
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WORKERS_CONFIG

public static final java.lang.String WORKERS_CONFIG

NS_CONFIG

public static final java.lang.String NS_CONFIG

NSAPI_LOG_LOCATION

public static final java.lang.String NSAPI_LOG_LOCATION

NSAPI_REDIRECTOR

public static java.lang.String NSAPI_REDIRECTOR
default location of nsapi plug-in.
Constructor Detail

NSConfig

public NSConfig()
Method Detail

setObjConfig

public void setObjConfig(java.lang.String 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.

Parameters:
path - String path to a file

setNsapiJk

public void setNsapiJk(java.lang.String path)
set the path to the nsapi plugin module
Parameters:
path - String path to a file

setObjectName

public void setObjectName(java.lang.String name)
Set the name for the Object that implements the jk_service call.
Parameters:
name - Name of the obj.conf Object

initProperties

protected void initProperties(ContextManager cm)
Initialize defaults for properties that are not set explicitely
Overrides:
initProperties in class BaseJkConfig

execute

public void execute(ContextManager cm)
             throws TomcatException
executes the NSConfig interceptor. This method generates Netscape configuration files for use with nsapi_redirect. If not already set, this method will setConfigHome() to the value returned from cm.getHome().

Overrides:
execute in class BaseJkConfig
Parameters:
cm - a ContextManager object.

addExtensionMapping

protected boolean addExtensionMapping(java.lang.String ctxPath,
                                      java.lang.String ext,
                                      java.io.PrintWriter objfile)
Add a Netscape extension mapping.
Overrides:
addExtensionMapping in class BaseJkConfig

addMapping

protected boolean addMapping(java.lang.String fullPath,
                             java.io.PrintWriter objfile)
Add a fulling specified Netscape mapping.
Overrides:
addMapping in class BaseJkConfig


Copyright © 2001 Apache Software Foundation. All Rights Reserved.