Java Doc for ManagerServlet.java in  » Web-Server » Rimfaxe-Web-Server » org » apache » catalina » servlets » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Server » Rimfaxe Web Server » org.apache.catalina.servlets 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.servlet.http.HttpServlet
   org.apache.catalina.servlets.ManagerServlet

All known Subclasses:   org.apache.catalina.servlets.HTMLManagerServlet,
ManagerServlet
public class ManagerServlet extends HttpServlet implements ContainerServlet(Code)
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:

  • /install?config={config-url} - Install and start a new web application, based on the contents of the context configuration file found at the specified URL. The docBase attribute of the context configuration file is used to locate the actual WAR or directory containing the application.
  • /install?config={config-url}&war={war-url}/ - Install and start a new web application, based on the contents of the context configuration file found at {config-url}, overriding the docBase attribute with the contents of the web application archive found at {war-url}.
  • /install?path=/xxx&war={war-url} - Install and start a new web application attached to context path /xxx, based on the contents of the web application archive found at the specified URL.
  • /list - List the context paths of all currently installed web applications for this virtual host. Each context will be listed with the following format path:status:sessions. Where path is the context path. Status is either running or stopped. Sessions is the number of active Sessions.
  • /reload?path=/xxx - Reload the Java classes and resources for the application at the specified path, but do not reread the web.xml configuration files.
  • /remove?path=/xxx - Shutdown and remove the web application attached to context path /xxx for this virtual host.
  • /resources?type=xxxx - Enumerate the available global JNDI resources, optionally limited to those of the specified type (fully qualified Java class name), if available.
  • /roles - Enumerate the available security role names and descriptions from the user database connected to the users resource reference.
  • /sessions?path=/xxx - List session information about the web application attached to context path /xxx for this virtual host.
  • /start?path=/xxx - Start the web application attached to context path /xxx for this virtual host.
  • /stop?path=/xxx - Stop the web application attached to context path /xxx for this virtual host.
  • /undeploy?path=/xxx - Shutdown and remove the web application attached to context path /xxx for this virtual host, and remove the underlying WAR file or document base directory. (NOTE - This is only allowed if the WAR file or document base is stored in the appBase directory of this host, typically as a result of being placed there via the /deploy command.

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:

  • file:/absolute/path/to/a/directory - You can specify the absolute path of a directory that contains the unpacked version of a web application. This directory will be attached to the context path you specify without any changes.
  • jar:file:/absolute/path/to/a/warfile.war!/ - You can specify a URL to a local web application archive file. The syntax must conform to the rules specified by the JarURLConnection class for a reference to an entire JAR file.
  • jar:http://hostname:port/path/to/a/warfile.war!/ - You can specify a URL to a remote (HTTP-accessible) web application archive file. The syntax must conform to the rules specified by the JarURLConnection class for a reference to an entire JAR file.

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:

  • debug - The debugging detail level that controls the amount of information that is logged by this servlet. Default is zero.

author:
   Craig R. McClanahan
version:
   $Revision: 1.24 $ $Date: 2002/05/31 21:08:03 $


Field Summary
protected  Contextcontext
     The Context container associated with our web application.
protected  intdebug
     The debugging detail level for this servlet.
protected  Filedeployed
     File object representing the directory into which the deploy() command will store the WAR and context configuration files that have been uploaded.
protected  Deployerdeployer
     The Deployer container that contains our own web application's Context, along with the associated Contexts for web applications that we are managing.
protected  javax.naming.Contextglobal
     The global JNDI NamingContext for this server, if available.
protected static  StringManagersm
     The string manager for this package.
protected  Wrapperwrapper
     The Wrapper container associated with this servlet.


Method Summary
protected synchronized  voiddeploy(PrintWriter writer, String path, HttpServletRequest request)
     Deploy a web application archive (included in the current request) at the specified context path.
public  voiddestroy()
     Finalize this servlet.
public  voiddoGet(HttpServletRequest request, HttpServletResponse response)
     Process a GET request for the specified resource.
public  voiddoPut(HttpServletRequest request, HttpServletResponse response)
     Process a PUT request for the specified resource.
protected  voidextractXml(File war, File xml)
     Extract the context configuration file from the specified WAR, if it is present.
public  WrappergetWrapper()
     Return the Wrapper with which we are associated.
public  voidinit()
     Initialize this servlet.
protected  voidinstall(PrintWriter writer, String config, String path, String war)
     Install an application for the specified path from the specified web application archive.
protected  voidlist(PrintWriter writer)
     Render a list of the currently active Contexts in our virtual host.
protected  voidprintResources(PrintWriter writer, String prefix, javax.naming.Context namingContext, String type, Class clazz)
     List the resources of the given context.
protected  voidreload(PrintWriter writer, String path)
     Reload the web application at the specified context path.
protected  voidremove(PrintWriter writer, String path)
     Remove the web application at the specified context path.
protected  voidresources(PrintWriter writer, String type)
     Render a list of available global JNDI resources.
protected  voidroles(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.
protected  voidsessions(PrintWriter writer, String path)
     Session information for the web application at the specified context path.
public  voidsetWrapper(Wrapper wrapper)
     Set the Wrapper with which we are associated.
protected  voidstart(PrintWriter writer, String path)
     Start the web application at the specified context path.
protected  voidstop(PrintWriter writer, String path)
     Stop the web application at the specified context path.
protected  voidundeploy(PrintWriter writer, String path)
     Undeploy the web application at the specified context path.
protected  voidundeployDir(File dir)
     Delete the specified directory, including all of its contents and subdirectories recursively.
protected  voiduploadWar(HttpServletRequest request, File war)
     Upload the WAR file included in this request, and store it at the specified file location.

Field Detail
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.



deployed
protected File deployed(Code)
File object representing the directory into which the deploy() command will store the WAR and context configuration files that have been uploaded.



deployer
protected Deployer deployer(Code)
The Deployer container that contains our own web application's Context, along with the associated Contexts for web applications that we are managing.



global
protected javax.naming.Context global(Code)
The global JNDI NamingContext for this server, if available.



sm
protected static StringManager sm(Code)
The string manager for this package.



wrapper
protected Wrapper wrapper(Code)
The Wrapper container associated with this servlet.





Method Detail
deploy
protected synchronized void deploy(PrintWriter writer, String path, HttpServletRequest request)(Code)
Deploy a web application archive (included in the current request) at the specified context path.
Parameters:
  writer - Writer to render results to
Parameters:
  path - Context path of the application to be installed
Parameters:
  request - Servlet request we are processing



destroy
public void destroy()(Code)
Finalize this servlet.



doGet
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException(Code)
Process a GET request for the specified resource.
Parameters:
  request - The servlet request we are processing
Parameters:
  response - The servlet response we are creating
exception:
  IOException - if an input/output error occurs
exception:
  ServletException - if a servlet-specified error occurs



doPut
public void doPut(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException(Code)
Process a PUT request for the specified resource.
Parameters:
  request - The servlet request we are processing
Parameters:
  response - The servlet response we are creating
exception:
  IOException - if an input/output error occurs
exception:
  ServletException - if a servlet-specified error occurs



extractXml
protected void extractXml(File war, File xml) throws IOException(Code)
Extract the context configuration file from the specified WAR, if it is present. If it is not present, ensure that the corresponding file does not exist.
Parameters:
  war - File object representing the WAR
Parameters:
  xml - File object representing where to store the extractedcontext configuration file (if it exists)
exception:
  IOException - if an i/o error occurs



getWrapper
public Wrapper getWrapper()(Code)
Return the Wrapper with which we are associated.



init
public void init() throws ServletException(Code)
Initialize this servlet.



install
protected void install(PrintWriter writer, String config, String path, String war)(Code)
Install an application for the specified path from the specified web application archive.
Parameters:
  writer - Writer to render results to
Parameters:
  config - URL of the context configuration file to be installed
Parameters:
  path - Context path of the application to be installed
Parameters:
  war - URL of the web application archive to be installed



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



printResources
protected void printResources(PrintWriter writer, String prefix, javax.naming.Context namingContext, String type, Class clazz)(Code)
List the resources of the given context.



reload
protected void reload(PrintWriter writer, String path)(Code)
Reload the web application at the specified context path.
Parameters:
  writer - Writer to render to
Parameters:
  path - Context path of the application to be restarted



remove
protected void remove(PrintWriter writer, String path)(Code)
Remove the web application at the specified context path.
Parameters:
  writer - Writer to render to
Parameters:
  path - Context path of the application to be removed



resources
protected void resources(PrintWriter writer, String type)(Code)
Render a list of available global JNDI resources.
Parameters:
  type - Fully qualified class name of the resource type of interest,or null to list resources of all types



roles
protected void roles(PrintWriter writer)(Code)
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.
Parameters:
  writer - Writer to render to



sessions
protected void sessions(PrintWriter writer, String path)(Code)
Session information for the web application at the specified context path. Displays a profile of session MaxInactiveInterval timeouts listing number of sessions for each 10 minute timeout interval up to 10 hours.
Parameters:
  writer - Writer to render to
Parameters:
  path - Context path of the application to list session information for



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 path)(Code)
Start the web application at the specified context path.
Parameters:
  writer - Writer to render to
Parameters:
  path - Context path of the application to be started



stop
protected void stop(PrintWriter writer, String path)(Code)
Stop the web application at the specified context path.
Parameters:
  writer - Writer to render to
Parameters:
  path - Context path of the application to be stopped



undeploy
protected void undeploy(PrintWriter writer, String path)(Code)
Undeploy the web application at the specified context path.
Parameters:
  writer - Writer to render to
Parameters:
  path - Context path of the application to be removed



undeployDir
protected void undeployDir(File dir)(Code)
Delete the specified directory, including all of its contents and subdirectories recursively.
Parameters:
  dir - File object representing the directory to be deleted



uploadWar
protected void uploadWar(HttpServletRequest request, File war) throws IOException(Code)
Upload the WAR file included in this request, and store it at the specified file location.
Parameters:
  request - The servlet request we are processing
Parameters:
  file - The file into which we should store the uploaded WAR
exception:
  IOException - if an I/O error occurs during processing



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)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.