Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tomcat.modules.config
Class PathSetter

    java.lang.Object
      org.apache.tomcat.core.BaseInterceptor
          org.apache.tomcat.modules.config.PathSetter

public final class PathSetter
extends BaseInterceptor

Set ( and guess ) the paths to absolute ( and canonical ) directories. This module must be added first ( before even ServerXmlReader ). If tomcat is embeded _and_ you are sure that all paths you set are OK - you may not need this ( but better to be safe and add it ). You don't have to insert this in server.xml - it's better to add it manually, to be sure it is first. Will set: tomcat.home, CM.home, CM.installDir, CM.workDir, Ctx.absolutePath ( based on DefaultCMSetter )

Author:
  Costin Manolache

Field Summary
`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
`PathSetter()`

Method Summary
`void` | `addContext(ContextManager cm, Context ctx)` Adjust paths for a context - make the base and all loggers point to canonical paths.
`void` | `addInterceptor(ContextManager cm, Context ctx, BaseInterceptor module)` Adjust context manager paths.
`void` | `engineInit(ContextManager cm)` After server.xml is read - make sure the workDir is absolute, and all global loggers are set to absolute paths and open.
`void` | `engineState(ContextManager cm, int state)` Notifies the module that the server changed it's state.

Methods inherited from class org.apache.tomcat.core.BaseInterceptor
`addContainer, addHandler, addSecurityConstraint, afterBody, authenticate, authorize, beforeBody, beforeCommit, contextInit, contextMap, contextShutdown, contextState, copyContext, engineShutdown, engineStart, engineStop, findSession, getContext, getContextManager, getDebug, getInfo, 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

Constructor Detail

### PathSetter

    public PathSetter()

Method Detail

### addInterceptor

    public void addInterceptor(ContextManager cm,
                               Context ctx,
                               BaseInterceptor module)
                        throws TomcatException

  Adjust context manager paths. This happens before anything else.

  Overrides:
    `addInterceptor` in class `BaseInterceptor`
  Parameters:
    `cm` - the server
    `ctx` - not null if this is a local interceptor
    `module` - the new added interceptor
  Throws:
    `TomcatException` - The module will not be added if any module throws an exception.

### engineInit

    public void engineInit(ContextManager cm)
                    throws TomcatException

  After server.xml is read - make sure the workDir is absolute, and all global loggers are set to absolute paths and open.

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

### engineState

    public void engineState(ContextManager cm,
                            int state)
                     throws TomcatException

  Description copied from class: `BaseInterceptor`
  Notifies the module that the server changed it's state. XXX this seems more flexible than init/start/stop/shutdown.

  Overrides:
    `engineState` in class `BaseInterceptor`
  Throws:
    `TomcatException`

### addContext

    public void addContext(ContextManager cm,
                           Context ctx)
                    throws TomcatException

  Adjust paths for a context - make the base and all loggers point to canonical paths.

  Overrides:
    `addContext` in class `BaseInterceptor`
  Throws:
    `TomcatException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001 Apache Software Foundation. All Rights Reserved.