Java Doc for CocoonServlet.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » cocoon » servlet » 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 » Content Management System » apache lenya 2.0 » org.apache.cocoon.servlet 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.servlet.http.HttpServlet
   org.apache.cocoon.servlet.CocoonServlet

CocoonServlet
public class CocoonServlet extends HttpServlet (Code)
This is the entry point for Cocoon execution as an HTTP Servlet.
author:
   Pierpaolo Fumagalli
author:
   (Apache Software Foundation)
author:
   Stefano Mazzocchi
author:
   Nicola Ken Barozzi
author:
   Berin Loritsch
author:
   Carsten Ziegeler
author:
   Leo Sutic
version:
   $Id: CocoonServlet.java 433543 2006-08-22 06:22:54Z crossley $


Field Summary
final protected static  booleanALLOW_RELOAD
    
final public static  StringCONTEXT_SERVLET_CONFIG
    
final static  floatHOUR
    
final static  floatMINUTE
    
final protected static  StringPROCESSED_BY
    
final static  floatSECOND
    
protected  booleanallowReload
    
protected  DefaultContextappContext
    
protected  ClassLoaderclassLoader
    
protected  Cocooncocoon
    
protected  longcreationTime
    
protected  Exceptionexception
    
protected  StringforceLoadParameter
    
protected  StringforceSystemProperty
    
protected  booleanhiddenShowTime
    
protected  booleaninitClassLoader
    
protected  RequestFactoryrequestFactory
    
protected  ServletContextservletContext
    
protected  StringservletContextPath
     This is the path to the servlet context (or the result of calling getRealPath('/') on the ServletContext.
protected  StringservletContextURL
    
protected  booleanshowTime
    


Method Summary
protected  voidaddClassLoaderDirectory(String dir)
     Adds a directory to the classloader.
protected  voidaddClassLoaderURL(URL URL)
     Adds an URL to the classloader.
protected synchronized  voidcreateCocoon()
     Creates the Cocoon object and handles exception handling.
public  voiddestroy()
    
final protected  voiddisposeCocoon()
    
protected  StringgetClassPath()
     This builds the important ClassPath used by this Servlet.
protected  EnvironmentgetEnvironment(String uri, HttpServletRequest req, HttpServletResponse res)
    
protected  StringgetExtraClassPath()
     Retreives the "extra-classpath" attribute, that needs to be added to the class path.
public  StringgetInitParameter(String name)
     Get an initialisation parameter.
protected  StringgetInitParameter(String name, String defaultValue)
    
protected  booleangetInitParameterAsBoolean(String name, boolean defaultValue)
    
protected  intgetInitParameterAsInteger(String name, int defaultValue)
    
protected  LoggergetLogger()
    
protected  LoggerManagergetLoggerManager()
    
protected synchronized  ComponentManagergetParentComponentManager()
     Instatiates the parent component manager, as specified in the parent-component-manager init parameter.
public  voidinit(ServletConfig conf)
     Initialize this CocoonServlet instance.
protected  voidinitLogger()
     Set up the log level and path.
protected  voidmanageException(HttpServletRequest req, HttpServletResponse res, Environment env, String uri, int errorStatus, String title, String message, String description, Exception e)
    
public  voidservice(HttpServletRequest req, HttpServletResponse res)
     Process the specified HttpServletRequest producing output on the specified HttpServletResponse.
protected  voidupdateEnvironment()
     Method to update the environment before Cocoon instances are created. This is also useful if you wish to customize any of the 'protected' variables from this class before a Cocoon instance is built in a derivative of this class (eg.

Field Detail
ALLOW_RELOAD
final protected static boolean ALLOW_RELOAD(Code)
Default value for CocoonServlet.allowReload parameter (false)



CONTEXT_SERVLET_CONFIG
final public static String CONTEXT_SERVLET_CONFIG(Code)
Application Context Key for the servlet configuration
since:
   2.1.3



HOUR
final static float HOUR(Code)



MINUTE
final static float MINUTE(Code)



PROCESSED_BY
final protected static String PROCESSED_BY(Code)



SECOND
final static float SECOND(Code)



allowReload
protected boolean allowReload(Code)
Allow reloading of cocoon by specifying the cocoon-reload=true parameter with a request



appContext
protected DefaultContext appContext(Code)
Avalon application context



classLoader
protected ClassLoader classLoader(Code)
The classloader that will be set as the context classloader if init-classloader is true



cocoon
protected Cocoon cocoon(Code)
The Cocoon instance



creationTime
protected long creationTime(Code)
The time the cocoon instance was created



exception
protected Exception exception(Code)
Holds exception happened during initialization (if any)



forceLoadParameter
protected String forceLoadParameter(Code)



forceSystemProperty
protected String forceSystemProperty(Code)



hiddenShowTime
protected boolean hiddenShowTime(Code)
If true, processing time will be added as an HTML comment



initClassLoader
protected boolean initClassLoader(Code)



requestFactory
protected RequestFactory requestFactory(Code)
The RequestFactory is responsible for wrapping multipart-encoded forms and for handing the file payload of incoming requests



servletContext
protected ServletContext servletContext(Code)



servletContextPath
protected String servletContextPath(Code)
This is the path to the servlet context (or the result of calling getRealPath('/') on the ServletContext. Note, that this can be null.



servletContextURL
protected String servletContextURL(Code)
This is the url to the servlet context directory



showTime
protected boolean showTime(Code)
Allow adding processing time to the response





Method Detail
addClassLoaderDirectory
protected void addClassLoaderDirectory(String dir)(Code)
Adds a directory to the classloader. Does nothing here, but is overriden in ParanoidCocoonServlet .



addClassLoaderURL
protected void addClassLoaderURL(URL URL)(Code)
Adds an URL to the classloader. Does nothing here, but is overriden in ParanoidCocoonServlet .



createCocoon
protected synchronized void createCocoon() throws ServletException(Code)
Creates the Cocoon object and handles exception handling.



destroy
public void destroy()(Code)
Dispose Cocoon when servlet is destroyed



disposeCocoon
final protected void disposeCocoon()(Code)
Destroy Cocoon



getClassPath
protected String getClassPath() throws ServletException(Code)
This builds the important ClassPath used by this Servlet. It does so in a Servlet Engine neutral way. It uses the ServletContext's getRealPath method to get the Servlet 2.2 identified classes and lib directories. It iterates in alphabetical order through every file in the lib directory and adds it to the classpath. Also, we add the files to the ClassLoader for the Cocoon system. In order to protect ourselves from skitzofrantic classloaders, we need to work with a known one. We need to get this to work properly when Cocoon is in a war.
throws:
  ServletException -



getEnvironment
protected Environment getEnvironment(String uri, HttpServletRequest req, HttpServletResponse res) throws Exception(Code)
Create the environment for the request



getExtraClassPath
protected String getExtraClassPath() throws ServletException(Code)
Retreives the "extra-classpath" attribute, that needs to be added to the class path.
throws:
  ServletException -



getInitParameter
public String getInitParameter(String name)(Code)
Get an initialisation parameter. The value is trimmed, and null is returned if the trimmed value is empty.



getInitParameter
protected String getInitParameter(String name, String defaultValue)(Code)
Convenience method to access servlet parameters



getInitParameterAsBoolean
protected boolean getInitParameterAsBoolean(String name, boolean defaultValue)(Code)
Convenience method to access boolean servlet parameters



getInitParameterAsInteger
protected int getInitParameterAsInteger(String name, int defaultValue)(Code)



getLogger
protected Logger getLogger()(Code)



getLoggerManager
protected LoggerManager getLoggerManager()(Code)



getParentComponentManager
protected synchronized ComponentManager getParentComponentManager()(Code)
Instatiates the parent component manager, as specified in the parent-component-manager init parameter. If none is specified, the method returns null. the parent component manager, or null.



init
public void init(ServletConfig conf) throws ServletException(Code)
Initialize this CocoonServlet instance. You will notice that I have broken the init into sub methods to make it easier to maintain (BL). The context is passed to a couple of the subroutines. This is also because it is better to explicitly pass variables than implicitely. It is both more maintainable, and more elegant.
Parameters:
  conf - The ServletConfig object from the servlet engine.
throws:
  ServletException -



initLogger
protected void initLogger()(Code)
Set up the log level and path. The default log level is Priority.ERROR, although it can be overwritten by the parameter "log-level". The log system goes to both a file and the Servlet container's log system. Only messages that are Priority.ERROR and above go to the servlet context. The log messages can be as restrictive (Priority.FATAL_ERROR and above) or as liberal (Priority.DEBUG and above) as you want that get routed to the file.



manageException
protected void manageException(HttpServletRequest req, HttpServletResponse res, Environment env, String uri, int errorStatus, String title, String message, String description, Exception e) throws IOException(Code)



service
public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException(Code)
Process the specified HttpServletRequest producing output on the specified HttpServletResponse.



updateEnvironment
protected void updateEnvironment() throws ServletException(Code)
Method to update the environment before Cocoon instances are created. This is also useful if you wish to customize any of the 'protected' variables from this class before a Cocoon instance is built in a derivative of this class (eg. Cocoon Context).



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.