|
Apache Tomcat 6.0.53 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet org.apache.catalina.manager.host.HostManagerServlet
public class HostManagerServlet
Servlet that enables remote management of the virtual hosts installed on the server. Normally, this functionality will be protected by a security constraint in the web application deployment descriptor. However, this requirement can be relaxed during testing.
This servlet examines the value returned by getPathInfo()
and related query parameters to determine what action is being requested.
The following actions and parameters (starting after the servlet path)
are supported:
host-name
attribute
indicates the name of the new host. The host-aliases
attribute is a comma separated list of the host alias names.
The manager
attribute is a boolean value indicating if the
webapp manager will be installed in the newly created host (optional,
false by default).host-name
attribute indicates the name of the host.
host-name#host-aliases
.NOTE - Attempting to stop or remove the host containing this servlet itself will not succeed. Therefore, this servlet should generally be deployed in a separate virtual host.
NOTE - For security reasons, this application will not operate when accessed via the invoker servlet. You must explicitly map this servlet with a servlet mapping, and you will always want to protect it with appropriate security constraints as well.
The following servlet initialization parameters are recognized:
Field Summary | |
---|---|
protected java.io.File |
configBase
Path where context descriptors should be deployed. |
protected Context |
context
The Context container associated with our web application. |
protected int |
debug
The debugging detail level for this servlet. |
protected Engine |
engine
The associated engine. |
protected Host |
host
The associated host. |
protected javax.management.MBeanServer |
mBeanServer
MBean server. |
protected static StringManager |
sm
The string manager for this package. |
protected Wrapper |
wrapper
The Wrapper container associated with this servlet. |
Constructor Summary | |
---|---|
HostManagerServlet()
|
Method Summary | |
---|---|
protected void |
add(javax.servlet.http.HttpServletRequest request,
java.io.PrintWriter writer,
java.lang.String name,
boolean htmlMode)
Add host with the given parameters. |
protected void |
add(java.io.PrintWriter writer,
java.lang.String name,
java.lang.String aliases,
java.lang.String appBase,
boolean manager,
boolean autoDeploy,
boolean deployOnStartup,
boolean deployXML,
boolean unpackWARs,
boolean xmlNamespaceAware,
boolean xmlValidation)
Add a host using the specified parameters. |
protected boolean |
booleanParameter(javax.servlet.http.HttpServletRequest request,
java.lang.String parameter,
boolean theDefault,
boolean htmlMode)
extract boolean value from checkbox with default |
void |
destroy()
Finalize this servlet. |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Process a GET request for the specified resource. |
protected java.io.File |
getConfigBase(java.lang.String hostName)
Get config base. |
Wrapper |
getWrapper()
Return the Wrapper with which we are associated. |
void |
init()
Initialize this servlet. |
protected void |
list(java.io.PrintWriter writer)
Render a list of the currently active Contexts in our virtual host. |
protected void |
remove(java.io.PrintWriter writer,
java.lang.String name)
Remove the specified host. |
void |
setWrapper(Wrapper wrapper)
Set the Wrapper with which we are associated. |
protected void |
start(java.io.PrintWriter writer,
java.lang.String name)
Start the host with the specified name. |
protected void |
stop(java.io.PrintWriter writer,
java.lang.String name)
Start the host with the specified name. |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.io.File configBase
protected Context context
protected int debug
protected Host host
protected Engine engine
protected javax.management.MBeanServer mBeanServer
protected static StringManager sm
protected Wrapper wrapper
Constructor Detail |
---|
public HostManagerServlet()
Method Detail |
---|
public Wrapper getWrapper()
getWrapper
in interface ContainerServlet
public void setWrapper(Wrapper wrapper)
setWrapper
in interface ContainerServlet
wrapper
- The new wrapperpublic void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException
doGet
in class javax.servlet.http.HttpServlet
request
- The servlet request we are processingresponse
- The servlet response we are creating
java.io.IOException
- if an input/output error occurs
javax.servlet.ServletException
- if a servlet-specified error occursServletResponse.setContentType(java.lang.String)
protected void add(javax.servlet.http.HttpServletRequest request, java.io.PrintWriter writer, java.lang.String name, boolean htmlMode)
request
- The requestwriter
- The output writername
- The host namehtmlMode
- Flag valueprotected boolean booleanParameter(javax.servlet.http.HttpServletRequest request, java.lang.String parameter, boolean theDefault, boolean htmlMode)
request
- parameter
- theDefault
- htmlMode
- public void init() throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
- if an exception occurs that
interrupts the servlet's
normal operationprotected void add(java.io.PrintWriter writer, java.lang.String name, java.lang.String aliases, java.lang.String appBase, boolean manager, boolean autoDeploy, boolean deployOnStartup, boolean deployXML, boolean unpackWARs, boolean xmlNamespaceAware, boolean xmlValidation)
writer
- Writer to render results toname
- host namealiases
- comma separated alias listappBase
- application base for the hostmanager
- should the manager webapp be deployed to the new host ?protected void remove(java.io.PrintWriter writer, java.lang.String name)
writer
- Writer to render results toname
- host nameprotected void list(java.io.PrintWriter writer)
writer
- Writer to render toprotected void start(java.io.PrintWriter writer, java.lang.String name)
writer
- Writer to render toname
- Host nameprotected void stop(java.io.PrintWriter writer, java.lang.String name)
writer
- Writer to render toname
- Host nameprotected java.io.File getConfigBase(java.lang.String hostName)
|
Apache Tomcat 6.0.53 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |