|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tomcat.core.ContextManager
A collection class representing the Contexts associated with a particular Server. The managed Contexts can be accessed by path. It also store global default properties - the server name and port ( returned by getServerName(), etc) and workdir.
Field Summary | |
static java.lang.String |
DEFAULT_HOSTNAME
|
static int |
DEFAULT_PORT
|
static java.lang.String |
DEFAULT_WORK_DIR
|
Constructor Summary | |
ContextManager()
Construct a new ContextManager instance with default values. |
Method Summary | |
void |
addContainer(Container container)
|
void |
addContext(Context ctx)
Adds a new Context to the set managed by this ContextManager. |
void |
addContextInterceptor(ContextInterceptor ci)
|
void |
addLogger(org.apache.tomcat.logging.Logger logger)
|
void |
addRequestInterceptor(RequestInterceptor ri)
|
void |
addServerConnector(ServerConnector con)
Add the specified server connector to the those attached to this server. |
void |
doLog(java.lang.String msg)
|
void |
doLog(java.lang.String msg,
java.lang.Throwable t)
|
java.util.Enumeration |
getConnectors()
|
Context |
getContext(java.lang.String name)
Gets a context by it's name, or null if there is
no such context. |
ContextInterceptor[] |
getContextInterceptors()
Return the context interceptors as an array. |
java.util.Enumeration |
getContextNames()
Get the names of all the contexts in this server. |
int |
getDebug()
|
java.lang.String |
getHome()
The root directory of tomcat |
java.lang.String |
getHostName()
Deprecated. |
int |
getPort()
Deprecated. |
RequestInterceptor[] |
getRequestInterceptors()
Return the context interceptors as an array. |
java.lang.String |
getTomcatHome()
Tomcat installation directory, where libraries and default files are located |
java.lang.String |
getWorkDir()
|
void |
init()
Init() is called after the context manager is set up and configured. |
void |
initContext(Context ctx)
Initializes this context to take on requests. |
void |
log(java.lang.String msg)
|
void |
removeContainer(Container container)
|
void |
removeContext(java.lang.String name)
Shut down and removes a context from service. |
void |
service(Request rrequest,
Response rresponse)
Common for all connectors, needs to be shared in order to avoid code duplication |
void |
setDebug(int level)
|
void |
setDefaults()
Set default settings ( interceptors, connectors, loader, manager ) It is called from init if no connector is set up - note that we try to avoid any "magic" - you either set up everything ( using server.xml or alternatives) or you don't set up and then defaults will be used. |
void |
setHome(java.lang.String home)
Set installation directory. |
void |
setHostName(java.lang.String host)
Deprecated. |
void |
setPort(int port)
Deprecated. |
void |
setTomcatHome(java.lang.String tH)
|
void |
setWorkDir(java.lang.String wd)
WorkDir property - where all temporary files will be created |
void |
shutdownContext(Context ctx)
|
void |
start()
Will start the connectors and begin serving requests |
void |
stop()
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String DEFAULT_HOSTNAME
public static final int DEFAULT_PORT
public static final java.lang.String DEFAULT_WORK_DIR
Constructor Detail |
public ContextManager()
Method Detail |
public void setDefaults()
public java.util.Enumeration getContextNames()
public void init() throws TomcatException
public void initContext(Context ctx) throws TomcatException
This method may only be called once and must be called before any requests are handled by this context and after setContextManager() is called.
public void shutdownContext(Context ctx) throws TomcatException
public void start() throws java.lang.Exception
public void stop() throws java.lang.Exception
public Context getContext(java.lang.String name)
null
if there is
no such context.name
- Name of the requested contextpublic void addContext(Context ctx) throws TomcatException
ctx
- context to be added.public void removeContext(java.lang.String name) throws TomcatException
name
- Name of the Context to be removedpublic void addContainer(Container container) throws TomcatException
public void removeContainer(Container container) throws TomcatException
public void addServerConnector(ServerConnector con)
con
- The new server connectorpublic java.util.Enumeration getConnectors()
public void addRequestInterceptor(RequestInterceptor ri)
public RequestInterceptor[] getRequestInterceptors()
public void addContextInterceptor(ContextInterceptor ci)
public ContextInterceptor[] getContextInterceptors()
public void addLogger(org.apache.tomcat.logging.Logger logger)
public java.lang.String getHome()
public java.lang.String getTomcatHome()
public void setTomcatHome(java.lang.String tH)
public void setHome(java.lang.String home)
public void setPort(int port)
port
- The new port numberpublic int getPort()
public void setHostName(java.lang.String host)
host
- The new virtual host namepublic java.lang.String getHostName()
public void setWorkDir(java.lang.String wd)
public java.lang.String getWorkDir()
public void service(Request rrequest, Response rresponse)
public void setDebug(int level)
public int getDebug()
public final void log(java.lang.String msg)
public final void doLog(java.lang.String msg)
public final void doLog(java.lang.String msg, java.lang.Throwable t)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |