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

All Implemented Interfaces:
    ContainerServlet, Serializable, Servlet, ServletConfig

Direct Known Subclasses:
    HTMLManagerServlet

Servlet that enables remote management of the web applications installed within the same virtual host as this web application is. 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:

Use path=/ for the ROOT context.

The syntax of the URL for a web application archive must conform to one of the following patterns to be successfully deployed:

NOTE - Attempting to reload or remove the application containing this servlet itself will not succeed. Therefore, this servlet should generally be deployed as a separate web application within the virtual host to be managed.

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  File deployed    File object representing the directory into which the deploy() command will store the WAR and context configuration files that have been uploaded. 
protected  File versioned    Path used to store revisions of webapps. 
protected  File contextDescriptors    Path used to store context descriptors. 
protected  Host host    The associated host. 
protected  File appBase    The host appBase. 
protected  MBeanServer mBeanServer    MBean server. 
protected  ObjectName oname    The associated deployer ObjectName. 
protected  Context global    The global JNDI NamingContext for this server, if available. 
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.manager.ManagerServlet Summary:
addServiced,   check,   copy,   copyInternal,   deploy,   deploy,   deploy,   destroy,   doGet,   doPut,   expireSessions,   getAppBase,   getConfigFile,   getDocBase,   getWrapper,   init,   isDeployed,   isServiced,   list,   printResources,   reload,   removeServiced,   resources,   roles,   save,   serverinfo,   sessions,   sessions,   setWrapper,   start,   stop,   undeploy,   undeployDir,   uploadWar
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.manager.ManagerServlet Detail:
 protected  void addServiced(String name) throws Exception 
    Invoke the addServiced method on the deployer.
 protected  void check(String name) throws Exception 
    Invoke the check method on the deployer.
 public static boolean copy(File src,
    File dest) 
    Copy the specified file or directory to the destination.
 public static boolean copyInternal(File src,
    File dest,
    byte[] buf) 
    Copy the specified file or directory to the destination.
 protected  void deploy(PrintWriter writer,
    String path,
    String tag) 
    Install an application for the specified path from the specified web application archive.
 protected synchronized  void deploy(PrintWriter writer,
    String path,
    String tag,
    boolean update,
    HttpServletRequest request) 
    Deploy a web application archive (included in the current request) at the specified context path.
 protected  void deploy(PrintWriter writer,
    String config,
    String path,
    String war,
    boolean update) 
    Install an application for the specified path from the specified web application archive.
 public  void destroy() 
    Finalize this servlet.
 public  void doGet(HttpServletRequest request,
    HttpServletResponse response) throws IOException, ServletException 
    Process a GET request for the specified resource.
 public  void doPut(HttpServletRequest request,
    HttpServletResponse response) throws IOException, ServletException 
    Process a PUT request for the specified resource.
 protected  void expireSessions(PrintWriter writer,
    String path,
    HttpServletRequest req) 
    Extract the expiration request parameter
 protected File getAppBase() 
    Return a File object representing the "application root" directory for our associated Host.
 protected String getConfigFile(String path) 
    Given a context path, get the config file name.
 protected String getDocBase(String path) 
    Given a context path, get the config file name.
 public Wrapper getWrapper() 
    Return the Wrapper with which we are associated.
 public  void init() throws ServletException 
    Initialize this servlet.
 protected boolean isDeployed(String name) throws Exception 
    Invoke the isDeployed method on the deployer.
 protected boolean isServiced(String name) throws Exception 
    Invoke the isServiced method on the deployer.
 protected  void list(PrintWriter writer) 
    Render a list of the currently active Contexts in our virtual host.
 protected  void printResources(PrintWriter writer,
    String prefix,
    Context namingContext,
    String type,
    Class clazz) 
    List the resources of the given context.
 protected  void reload(PrintWriter writer,
    String path) 
    Reload the web application at the specified context path.
 protected  void removeServiced(String name) throws Exception 
    Invoke the removeServiced method on the deployer.
 protected  void resources(PrintWriter writer,
    String type) 
    Render a list of available global JNDI resources.
 protected  void roles(PrintWriter writer) 
    Render a list of security role names (and corresponding descriptions) from the org.apache.catalina.UserDatabase resource that is connected to the users resource reference. Typically, this will be the global user database, but can be adjusted if you have different user databases for different virtual hosts.
 protected synchronized  void save(PrintWriter writer,
    String path) 
    Store server configuration.
 protected  void serverinfo(PrintWriter writer) 
    Writes System OS and JVM properties.
 protected  void sessions(PrintWriter writer,
    String path) 
    Session information for the web application at the specified context path. Displays a profile of session lastAccessedTime listing number of sessions for each 10 minute interval up to 10 hours.
 protected  void sessions(PrintWriter writer,
    String path,
    int idle) 
    Session information for the web application at the specified context path. Displays a profile of session lastAccessedTime listing number of sessions for each 10 minute interval up to 10 hours.
 public  void setWrapper(Wrapper wrapper) 
    Set the Wrapper with which we are associated.
 protected  void start(PrintWriter writer,
    String path) 
    Start the web application at the specified context path.
 protected  void stop(PrintWriter writer,
    String path) 
    Stop the web application at the specified context path.
 protected  void undeploy(PrintWriter writer,
    String path) 
    Undeploy the web application at the specified context path.
 protected  void undeployDir(File dir) 
    Delete the specified directory, including all of its contents and subdirectories recursively.
 protected  void uploadWar(HttpServletRequest request,
    File war) throws IOException 
    Upload the WAR file included in this request, and store it at the specified file location.