Java Doc for HttpPresentationManager.java in  » J2EE » Enhydra-Application-Framework » com » lutris » appserver » server » httpPresentation » 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 » J2EE » Enhydra Application Framework » com.lutris.appserver.server.httpPresentation 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.lutris.appserver.server.httpPresentation.HttpPresentationManager

HttpPresentationManager
public class HttpPresentationManager (Code)
Presentation manager class. Handles loading and execution of presentation objects.
version:
   $Revision: 1.3 $
author:
   Mark Diekhans



Constructor Summary
public  HttpPresentationManager(String appPresentationPrefix, Application presApplication, ClassLoader applicationClassLoader, boolean cacheClasses, boolean cacheFiles)
     Construct a HTTP presentation manager.
Parameters:
  appPresentationPrefix - Prefix added to the file name portionof the URL.

Method Summary
public  voidRun(HttpPresentationRequest request, HttpPresentationResponse response)
     The method is invoked to fulfill an HTTP request.
public  voidaddMimeType(String mimeType, String extension)
     Add a new mime type to extension mapping.
public  voidflushCache()
     Flush the presentation object and resource caches.
public  ClassLoadergetAppClassLoader()
     Get the application class loader.
public  InputStreamgetAppFileAsStream(String appFileName)
     Get a file associated with the application.
public  ServletgetServlet()
     Get the servlet we are running in.
public  ServletContextgetServletContext()
     Get the servlet context used to initialize the servlet we are running in.
public  SessiongetSession(ServletRequest request)
     Looks up the session object (if any) that would be used to process the request.
public  booleanisPOCacheEnabled()
     Determine if the PO cache is enabled.
public  booleanisPresentationRequest(HttpPresentationRequest request)
     Determine if a request URL references a presentation object.
Parameters:
  request - The request for the presentation.
public  booleanisResourceCacheEnabled()
     Determine if the file resource class cache is enabled.
public  booleanservletRequestPreprocessor(Servlet me, ServletContext context, HttpServletRequest request, HttpServletResponse response)
     This is an internal use only hook, see the description in Application.java.
public  voidsetServletAndContext(Servlet servlet, ServletContext servletContext)
     Notify the presentation manager which servlet we are running in. This will be done immediatly after this object is created, if this ojbject is created by an HttpPresentationServlet (currently the only creator).
public  intsizeofPOCache()
     Return the number of entries in the PO cache.
public  intsizeofResourceCache()
     Return the number of entries in the resource cache.


Constructor Detail
HttpPresentationManager
public HttpPresentationManager(String appPresentationPrefix, Application presApplication, ClassLoader applicationClassLoader, boolean cacheClasses, boolean cacheFiles) throws HttpPresentationException(Code)
Construct a HTTP presentation manager.
Parameters:
  appPresentationPrefix - Prefix added to the file name portionof the URL. The resulting names is used to search for classes andfiles on the class path.
Parameters:
  presApplication - Application object that this presentation isassociated with.
Parameters:
  applicationClassLoader - the class loader to use for the application.
Parameters:
  cacheClasses - Enables or disables caching of presentation objectclasses in memory.
Parameters:
  cacheFiles - Enables or disables caching of files (html, gif, etc)that are servered as part of the application.




Method Detail
Run
public void Run(HttpPresentationRequest request, HttpPresentationResponse response) throws HttpPresentationException, IOException(Code)
The method is invoked to fulfill an HTTP request. This function is thread-safe and does not need synchronization. It is expected that the protocol layer invoking this function provide multi-threading to handle requests. The alogrithm for handling a request is:
 presObj = requestUrl
 while request-not-handled {
 if not error-handler-redirect
 invoke-application-request-preprocessor presObj
 load-presentation-object-class
 invoke-presentation-object
 if not error-handler-redirect
 invoke-application-request-postprocessor presObj
 if (client-side-page-redirect-exception) {
 send-redirect-to-client
 break
 }
 if (server-side-page-redirect-exception) {
 (Not implemented yet)
 set-request-to-redirectUrl
 presObj = redirectUrl
 continue
 }
 if (401-unauthorized-exception) {
 set-header-and-response-code
 break
 }
 if (other-exception) {
 presObj = find-error-handler
 }
 }
 

Parameters:
  request - Request object for the protocol invoking the manager.
Parameters:
  response - Response object for the protocol invoking the manager.
exception:
  HttpPresentationException - All exceptions will be encapsulatedin an exception of this class.



addMimeType
public void addMimeType(String mimeType, String extension)(Code)
Add a new mime type to extension mapping.



flushCache
public void flushCache()(Code)
Flush the presentation object and resource caches.



getAppClassLoader
public ClassLoader getAppClassLoader()(Code)
Get the application class loader. The application class loader.



getAppFileAsStream
public InputStream getAppFileAsStream(String appFileName) throws IOException, HttpPresentationException(Code)
Get a file associated with the application. The file is located in the same manner as presentation objects are located. That is, prepending the presentationPrefix to the specified path and searching the class path for a directory or JAR containing the file.
Parameters:
  appfileName - The file name relative to theto the application's presentationPrefix. An input stream associated with the file.
exception:
  IOException - If the file can not be found or opened.



getServlet
public Servlet getServlet()(Code)
Get the servlet we are running in. Currently this class is only used in a servlet (HttpPresentationServlet), so this value will always be set. But in the future this class may be used in other non-servlet enviornments, in which case this method will return null. The servlet we are running in, if any.



getServletContext
public ServletContext getServletContext()(Code)
Get the servlet context used to initialize the servlet we are running in. Currently this class is only used in a servlet (HttpPresentationServlet), so this value will always be set. But in the future this class may be used in other non-servlet enviornments, in which case this method will return null. The servlet context used to initialize the servlet we arerunning in, if any.



getSession
public Session getSession(ServletRequest request)(Code)
Looks up the session object (if any) that would be used to process the request. This is will not used normally, because the session is give to the application's preprocessor method and the presentation objects. Also, it is not normal to have a raw ServletRequest. The debugger uses this to examine the session data before and after each request. Consider this an internal use onlyu method.
Parameters:
  request - The (raw) request that would be sent in to this application.The session object that would be associated with the request.Returns null if none is found; a new session is not created.



isPOCacheEnabled
public boolean isPOCacheEnabled()(Code)
Determine if the PO cache is enabled. true is the cache is enabled.



isPresentationRequest
public boolean isPresentationRequest(HttpPresentationRequest request) throws HttpPresentationException(Code)
Determine if a request URL references a presentation object.
Parameters:
  request - The request for the presentation. true if the URL has a presentation object MIME type.



isResourceCacheEnabled
public boolean isResourceCacheEnabled()(Code)
Determine if the file resource class cache is enabled. true is the cache is enabled.



servletRequestPreprocessor
public boolean servletRequestPreprocessor(Servlet me, ServletContext context, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException(Code)
This is an internal use only hook, see the description in Application.java. The call is passed through to the application.



setServletAndContext
public void setServletAndContext(Servlet servlet, ServletContext servletContext)(Code)
Notify the presentation manager which servlet we are running in. This will be done immediatly after this object is created, if this ojbject is created by an HttpPresentationServlet (currently the only creator). In the future, if this class is used in non-servlet situations, this need not be called.
Parameters:
  servlet - The servlet we are running in.
Parameters:
  servletContext - The ServletContext used to initialize the servlet we are running in.



sizeofPOCache
public int sizeofPOCache()(Code)
Return the number of entries in the PO cache. the number of entries in the cache or 0 is disabled.



sizeofResourceCache
public int sizeofResourceCache()(Code)
Return the number of entries in the resource cache. the number of entries in the cache or 0 is disabled.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.