| javax.servlet.http.HttpServlet org.apache.catalina.manager.host.HostManagerServlet
All known Subclasses: org.apache.catalina.manager.host.HTMLHostManagerServlet,
HostManagerServlet | public class HostManagerServlet extends HttpServlet implements ContainerServlet(Code) | | 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:
- /add?name={host-name}&aliases={host-aliases}&manager={manager} -
Create and add a new virtual host. The
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).
- /remove?name={host-name} - Remove a virtual host.
The
host-name attribute indicates the name of the host.
- /list - List the virtual hosts installed on the server.
Each host will be listed with the following format
host-name#host-aliases .
- /start?name={host-name} - Start the virtual host.
- /stop?name={host-name} - Stop the virtual host.
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:
- debug - The debugging detail level that controls the amount
of information that is logged by this servlet. Default is zero.
author: Craig R. McClanahan author: Remy Maucherat version: $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $ |
Method Summary | |
protected void | add(HttpServletRequest request, PrintWriter writer, String name, boolean htmlMode) Add host with the given parameters. | protected synchronized void | add(PrintWriter writer, String name, String aliases, 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(HttpServletRequest request, String parameter, boolean theDefault, boolean htmlMode) | public void | destroy() Finalize this servlet. | public void | doGet(HttpServletRequest request, HttpServletResponse response) Process a GET request for the specified resource. | protected File | getConfigBase(String hostName) Get config base. | public Wrapper | getWrapper() Return the Wrapper with which we are associated. | public void | init() Initialize this servlet. | protected void | list(PrintWriter writer) Render a list of the currently active Contexts in our virtual host. | protected synchronized void | remove(PrintWriter writer, String name) Remove the specified host. | public void | setWrapper(Wrapper wrapper) Set the Wrapper with which we are associated. | protected void | start(PrintWriter writer, String name) Start the host with the specified name. | protected void | stop(PrintWriter writer, String name) Start the host with the specified name. |
configBase | protected File configBase(Code) | | Path where context descriptors should be deployed.
|
context | protected Context context(Code) | | The Context container associated with our web application.
|
debug | protected int debug(Code) | | The debugging detail level for this servlet.
|
host | protected Host host(Code) | | The associated host.
|
wrapper | protected Wrapper wrapper(Code) | | The Wrapper container associated with this servlet.
|
add | protected void add(HttpServletRequest request, PrintWriter writer, String name, boolean htmlMode)(Code) | | Add host with the given parameters.
Parameters: request - The request Parameters: writer - The output writer Parameters: name - The host name Parameters: htmlMode - Flag value |
add | protected synchronized void add(PrintWriter writer, String name, String aliases, String appBase, boolean manager, boolean autoDeploy, boolean deployOnStartup, boolean deployXML, boolean unpackWARs, boolean xmlNamespaceAware, boolean xmlValidation)(Code) | | Add a host using the specified parameters.
Parameters: writer - Writer to render results to Parameters: name - host name Parameters: aliases - comma separated alias list Parameters: appBase - application base for the host Parameters: manager - should the manager webapp be deployed to the new host ? |
booleanParameter | protected boolean booleanParameter(HttpServletRequest request, String parameter, boolean theDefault, boolean htmlMode)(Code) | | extract boolean value from checkbox with default
Parameters: request - Parameters: parameter - Parameters: theDefault - Parameters: htmlMode - |
destroy | public void destroy()(Code) | | Finalize this servlet.
|
getConfigBase | protected File getConfigBase(String hostName)(Code) | | Get config base.
|
getWrapper | public Wrapper getWrapper()(Code) | | Return the Wrapper with which we are associated.
|
list | protected void list(PrintWriter writer)(Code) | | Render a list of the currently active Contexts in our virtual host.
Parameters: writer - Writer to render to |
remove | protected synchronized void remove(PrintWriter writer, String name)(Code) | | Remove the specified host.
Parameters: writer - Writer to render results to Parameters: name - host name |
setWrapper | public void setWrapper(Wrapper wrapper)(Code) | | Set the Wrapper with which we are associated.
Parameters: wrapper - The new wrapper |
start | protected void start(PrintWriter writer, String name)(Code) | | Start the host with the specified name.
Parameters: writer - Writer to render to Parameters: name - Host name |
stop | protected void stop(PrintWriter writer, String name)(Code) | | Start the host with the specified name.
Parameters: writer - Writer to render to Parameters: name - Host name |
Methods inherited from javax.servlet.http.HttpServlet | protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doTrace(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected long getLastModified(HttpServletRequest req)(Code)(Java Doc) protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException(Code)(Java Doc)
|
|
|