org.apache.tomcat.modules.config
Class WorkDirSetup

java.lang.Object
  extended byorg.apache.tomcat.core.BaseInterceptor
      extended byorg.apache.tomcat.modules.config.WorkDirSetup

public class WorkDirSetup
extends BaseInterceptor

Handles work dir setup/removal.

Author:
cmanolache@yahoo.com

Field Summary
static java.lang.String ATTRIB_WORKDIR
          Workdir - a place where the servlets are allowed to write
static java.lang.String DEFAULT_WORK_DIR
          Default work dir, relative to home
 
Fields inherited from class org.apache.tomcat.core.BaseInterceptor
cm, ct, ctx, debug, DECLINED, loghelper, OK
 
Constructor Summary
WorkDirSetup()
           
 
Method Summary
 void addContext(ContextManager cm, Context ctx)
          Called when a context is added to a CM.
 void contextShutdown(Context ctx)
          Called when a context is stoped, before removeContext.
 void engineInit(ContextManager cm)
          Initialize the module.
 java.lang.Object getInfo(Context ctx, Request req, int info, java.lang.String k)
          Hook for lazy evaluation of request info.
 void setCleanWorkDir(boolean b)
          Auto-remove the work dir when tomcat is (grecefully) stoped and when tomcat starts.
 void setOldStyle(boolean b)
           
 void setUseWebInf(boolean useWebInf)
           
 void setWorkDirBase(java.lang.String s)
          Allow the user to customize the base directory for workdirs ( /var/tomcat/workdir for example )
 
Methods inherited from class org.apache.tomcat.core.BaseInterceptor
addContainer, addHandler, addInterceptor, addSecurityConstraint, afterBody, authenticate, authorize, beforeBody, beforeCommit, contextInit, contextMap, contextState, copyContext, engineShutdown, engineStart, engineState, engineStop, findSession, getContext, getContextManager, getDebug, getLog, getNote, getNote, handleError, log, log, log, log, postInitCheck, postReadRequest, postRequest, postService, postServletDestroy, postServletInit, preInitCheck, 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

DEFAULT_WORK_DIR

public static final java.lang.String DEFAULT_WORK_DIR
Default work dir, relative to home

See Also:
Constant Field Values

ATTRIB_WORKDIR

public static final java.lang.String ATTRIB_WORKDIR
Workdir - a place where the servlets are allowed to write

See Also:
Constant Field Values
Constructor Detail

WorkDirSetup

public WorkDirSetup()
Method Detail

setCleanWorkDir

public void setCleanWorkDir(boolean b)
Auto-remove the work dir when tomcat is (grecefully) stoped and when tomcat starts. IMHO this shouldn't be used - if true, we'll loose all jsp compiled files. The workdir is the only directory where the servlet is allowed to write anyway ( if policy is used ).


setWorkDirBase

public void setWorkDirBase(java.lang.String s)
Allow the user to customize the base directory for workdirs ( /var/tomcat/workdir for example )


setUseWebInf

public void setUseWebInf(boolean useWebInf)

setOldStyle

public void setOldStyle(boolean b)

engineInit

public void engineInit(ContextManager cm)
                throws TomcatException
Description copied from class: BaseInterceptor
Initialize the module.

Overrides:
engineInit in class BaseInterceptor
Throws:
TomcatException - The module will not be added if any exception is thrown by engineInit.

addContext

public void addContext(ContextManager cm,
                       Context ctx)
Description copied from class: BaseInterceptor
Called when a context is added to a CM. The context is probably not initialized yet, only path, docRoot, host, and properties set before adding the context ( in server.xml for example ) are available. At this stage mappers can start creating structures for the context ( the actual loading of the context may be delayed in future versions of tomcat until the first access ). DefaultCMSetter will also adjust the logger and paths based on context manager properties. Any activity that depends on web.xml must be done at init time.

Overrides:
addContext in class BaseInterceptor

contextShutdown

public void contextShutdown(Context ctx)
Description copied from class: BaseInterceptor
Called when a context is stoped, before removeContext. You must free all resources associated with this context.

Overrides:
contextShutdown in class BaseInterceptor

getInfo

public final java.lang.Object getInfo(Context ctx,
                                      Request req,
                                      int info,
                                      java.lang.String k)
Description copied from class: BaseInterceptor
Hook for lazy evaluation of request info. This provides and uniform mechanism to allow modules to evaluate certain expensive request attributes/parameters when they are needed ( if ever ), and allows specialized modules and better integration with the web server/server modules. This replaces a number of hard-coded constructs and should clean up the core for un-needed dependencies, as well as provide flexibility in key areas as encoding, etc.

Overrides:
getInfo in class BaseInterceptor


Copyright ? 2001 Apache Software Foundation. All Rights Reserved.