org.apache.catalina.util
クラス ProcessEnvironment

java.lang.Object
  |
  +--org.apache.catalina.util.ProcessEnvironment
直系の既知のサブクラス:
CGIProcessEnvironment

public class ProcessEnvironment
extends java.lang.Object

Encapsulates the Process environment and rules to derive that environment from the servlet container and request information.

導入されたバージョン:
Tomcat 4.0
バージョン:
$Revision: 1.2 $, $Date: 2001/07/22 20:25:13 $
作成者:
Martin Dengler [root@martindengler.com]

フィールドの概要
protected  java.lang.String command
          command to be invoked
protected  int debug
          the debugging detail level for this instance.
protected  java.util.Hashtable env
          derived process environment
protected  java.lang.String pathInfo
          pathInfo for the current request
protected  boolean valid
          whether or not this object is valid or not
protected  java.io.File workingDirectory
          process' desired working directory
 
コンストラクタの概要
ProcessEnvironment(javax.servlet.http.HttpServletRequest req, javax.servlet.ServletContext context)
          Creates a ProcessEnvironment and derives the necessary environment, working directory, command, etc.
ProcessEnvironment(javax.servlet.http.HttpServletRequest req, javax.servlet.ServletContext context, int debug)
          Creates a ProcessEnvironment and derives the necessary environment, working directory, command, etc.
 
メソッドの概要
protected  java.lang.String blanksToString(java.lang.String couldBeBlank, java.lang.String subForBlanks)
          Converts blank strings to another string
protected  boolean deriveProcessEnvironment(javax.servlet.http.HttpServletRequest req)
          Constructs the Process environment to be supplied to the invoked process.
 java.lang.String getCommand()
          Gets derived command string
 javax.servlet.ServletContext getContext()
           
 java.lang.String getContextPath()
           
 java.util.Hashtable getEnvironment()
          Gets process' environment
 java.lang.String getServletPath()
           
 java.lang.String getWebAppRootDir()
          Gets the root directory of the web application to which this process\ belongs
 java.io.File getWorkingDirectory()
          Gets this process' derived working directory
 boolean isValid()
          Gets validity status
protected  void log(java.lang.String s)
           
protected  java.lang.String nullsToBlanks(java.lang.String s)
          Converts null strings to blank strings ("")
protected  java.lang.String nullsToString(java.lang.String couldBeNull, java.lang.String subForNulls)
          Converts null strings to another string
protected  java.lang.String setCommand(java.lang.String command)
          Sets the desired command string
 java.util.Hashtable setEnvironment(java.util.Hashtable env)
          Sets process' environment
protected  void setupFromContext(javax.servlet.ServletContext context)
          Uses the ServletContext to set some process variables
protected  void setupFromRequest(javax.servlet.http.HttpServletRequest req)
          Uses the HttpServletRequest to set most process variables
 java.lang.String toString()
          Print important process environment information in an easy-to-read HTML table
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

pathInfo

protected java.lang.String pathInfo
pathInfo for the current request

env

protected java.util.Hashtable env
derived process environment

command

protected java.lang.String command
command to be invoked

valid

protected boolean valid
whether or not this object is valid or not

debug

protected int debug
the debugging detail level for this instance.

workingDirectory

protected java.io.File workingDirectory
process' desired working directory
コンストラクタの詳細

ProcessEnvironment

public ProcessEnvironment(javax.servlet.http.HttpServletRequest req,
                          javax.servlet.ServletContext context)
Creates a ProcessEnvironment and derives the necessary environment, working directory, command, etc.
パラメータ:
req - HttpServletRequest for information provided by the Servlet API
context - ServletContext for information provided by the Servlet API

ProcessEnvironment

public ProcessEnvironment(javax.servlet.http.HttpServletRequest req,
                          javax.servlet.ServletContext context,
                          int debug)
Creates a ProcessEnvironment and derives the necessary environment, working directory, command, etc.
パラメータ:
req - HttpServletRequest for information provided by the Servlet API
context - ServletContext for information provided by the Servlet API
debug - int debug level (0 == none, 4 == medium, 6 == lots)
メソッドの詳細

setupFromContext

protected void setupFromContext(javax.servlet.ServletContext context)
Uses the ServletContext to set some process variables
パラメータ:
context - ServletContext for information provided by the Servlet API

setupFromRequest

protected void setupFromRequest(javax.servlet.http.HttpServletRequest req)
Uses the HttpServletRequest to set most process variables
パラメータ:
req - HttpServletRequest for information provided by the Servlet API

toString

public java.lang.String toString()
Print important process environment information in an easy-to-read HTML table
オーバーライド:
クラス java.lang.Object 内の toString
戻り値:
HTML string containing process environment info

getCommand

public java.lang.String getCommand()
Gets derived command string
戻り値:
command string

setCommand

protected java.lang.String setCommand(java.lang.String command)
Sets the desired command string
パラメータ:
String - command as desired
戻り値:
command string

getWorkingDirectory

public java.io.File getWorkingDirectory()
Gets this process' derived working directory
戻り値:
working directory

getEnvironment

public java.util.Hashtable getEnvironment()
Gets process' environment
戻り値:
process' environment

setEnvironment

public java.util.Hashtable setEnvironment(java.util.Hashtable env)
Sets process' environment
パラメータ:
process' - environment
戻り値:
Hashtable to which the process' environment was set

isValid

public boolean isValid()
Gets validity status
戻り値:
true if this environment is valid, false otherwise

nullsToBlanks

protected java.lang.String nullsToBlanks(java.lang.String s)
Converts null strings to blank strings ("")
パラメータ:
string - to be converted if necessary
戻り値:
a non-null string, either the original or the empty string ("") if the original was null

nullsToString

protected java.lang.String nullsToString(java.lang.String couldBeNull,
                                         java.lang.String subForNulls)
Converts null strings to another string
パラメータ:
string - to be converted if necessary
string - to return instead of a null string
戻り値:
a non-null string, either the original or the substitute string if the original was null

blanksToString

protected java.lang.String blanksToString(java.lang.String couldBeBlank,
                                          java.lang.String subForBlanks)
Converts blank strings to another string
パラメータ:
string - to be converted if necessary
string - to return instead of a blank string
戻り値:
a non-null string, either the original or the substitute string if the original was null or empty ("")

log

protected void log(java.lang.String s)

deriveProcessEnvironment

protected boolean deriveProcessEnvironment(javax.servlet.http.HttpServletRequest req)
Constructs the Process environment to be supplied to the invoked process. Defines an environment no environment variables.

Should be overriden by subclasses to perform useful setup.

パラメータ:
HttpServletRequest - request associated with the Process' invocation
戻り値:
true if environment was set OK, false if there was a problem and no environment was set

getWebAppRootDir

public java.lang.String getWebAppRootDir()
Gets the root directory of the web application to which this process\ belongs
戻り値:
root directory

getContextPath

public java.lang.String getContextPath()

getContext

public javax.servlet.ServletContext getContext()

getServletPath

public java.lang.String getServletPath()


Copyright ? 2000-2001 Apache Software Foundation. All Rights Reserved.