Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » catalina » hostmanager » [javadoc | source]
org.apache.catalina.hostmanager
public class: HostManagerServlet [javadoc | source]
java.lang.Object
   javax.servlet.GenericServlet
      javax.servlet.http.HttpServlet
         org.apache.catalina.hostmanager.HostManagerServlet

All Implemented Interfaces:
    ContainerServlet, Serializable, Servlet, ServletConfig

Direct Known Subclasses:
    HTMLHostManagerServlet

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:

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  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  Host host    The associated host. 
protected  Engine engine    The associated engine. 
protected  MBeanServer mBeanServer    MBean server. 
protected static  StringManager sm    The string manager for this package. 
protected  Wrapper wrapper    The Wrapper container associated with this servlet. 
Method from org.apache.catalina.hostmanager.HostManagerServlet Summary:
add,   add,   booleanParameter,   destroy,   doGet,   getConfigBase,   getWrapper,   init,   list,   remove,   setWrapper,   start,   stop
Methods from javax.servlet.http.HttpServlet:
service
Methods from javax.servlet.GenericServlet:
destroy,   getInitParameter,   getInitParameterNames,   getServletConfig,   getServletContext,   getServletInfo,   getServletName,   init,   init,   log,   log,   service
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.hostmanager.HostManagerServlet Detail:
 protected  void add(HttpServletRequest request,
    PrintWriter writer,
    String name,
    boolean htmlMode) 
    Add host with all parameter
 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) 
    extract boolean value from checkbox with default
 public  void destroy() 
    Finalize this servlet.
 public  void doGet(HttpServletRequest request,
    HttpServletResponse response) throws IOException, ServletException 
    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() throws ServletException 
    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.