|
EAF 7.4 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lutris.appserver.server.httpPresentation.HttpPresentationManager
public class HttpPresentationManager
Presentation manager class. Handles loading and execution of presentation objects.
Constructor Summary | |
---|---|
HttpPresentationManager(java.lang.String appPresentationPrefix,
com.lutris.appserver.server.Application presApplication,
java.lang.ClassLoader applicationClassLoader,
boolean cacheClasses,
boolean cacheFiles)
Construct a HTTP presentation manager. |
Method Summary | |
---|---|
void |
addMimeType(java.lang.String mimeType,
java.lang.String extension)
Add a new mime type to extension mapping. |
void |
flushCache()
Flush the presentation object and resource caches. |
java.lang.ClassLoader |
getAppClassLoader()
Get the application class loader. |
java.io.InputStream |
getAppFileAsStream(java.lang.String appFileName)
Get a file associated with the application. |
javax.servlet.Servlet |
getServlet()
Get the servlet we are running in. |
javax.servlet.ServletContext |
getServletContext()
Get the servlet context used to initialize the servlet we are running in. |
com.lutris.appserver.server.session.Session |
getSession(javax.servlet.ServletRequest request)
Looks up the session object (if any) that would be used to process the request. |
boolean |
isPOCacheEnabled()
Determine if the PO cache is enabled. |
boolean |
isPresentationRequest(com.lutris.appserver.server.httpPresentation.HttpPresentationRequest request)
Determine if a request URL references a presentation object. |
boolean |
isResourceCacheEnabled()
Determine if the file resource class cache is enabled. |
void |
Run(com.lutris.appserver.server.httpPresentation.HttpPresentationRequest request,
com.lutris.appserver.server.httpPresentation.HttpPresentationResponse response)
The method is invoked to fulfill an HTTP request. |
boolean |
servletRequestPreprocessor(javax.servlet.Servlet me,
javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
This is an internal use only hook, see the description in Application.java. |
void |
setServletAndContext(javax.servlet.Servlet servlet,
javax.servlet.ServletContext servletContext)
Notify the presentation manager which servlet we are running in. |
int |
sizeofPOCache()
Return the number of entries in the PO cache. |
int |
sizeofResourceCache()
Return the number of entries in the resource cache. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpPresentationManager(java.lang.String appPresentationPrefix, com.lutris.appserver.server.Application presApplication, java.lang.ClassLoader applicationClassLoader, boolean cacheClasses, boolean cacheFiles) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
appPresentationPrefix
- Prefix added to the file name portion
of the URL. The resulting names is used to search for classes and
files on the class path.presApplication
- Application object that this presentation is
associated with.applicationClassLoader
- the class loader to use for the application.cacheClasses
- Enables or disables caching of presentation object
classes in memory.cacheFiles
- Enables or disables caching of files (html, gif, etc)
that are servered as part of the application.
com.lutris.appserver.server.httpPresentation.HttpPresentationException
Method Detail |
---|
public void Run(com.lutris.appserver.server.httpPresentation.HttpPresentationRequest request, com.lutris.appserver.server.httpPresentation.HttpPresentationResponse response) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException, java.io.IOException
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 } }
request
- Request object for the protocol invoking the manager.response
- Response object for the protocol invoking the manager.
HttpPresentationException
- All exceptions will be encapsulated
in an exception of this class.
java.io.IOException
public boolean servletRequestPreprocessor(javax.servlet.Servlet me, javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
public boolean isPOCacheEnabled()
true
is the cache is enabled.public int sizeofPOCache()
public boolean isResourceCacheEnabled()
true
is the cache is enabled.public int sizeofResourceCache()
public java.io.InputStream getAppFileAsStream(java.lang.String appFileName) throws java.io.IOException, com.lutris.appserver.server.httpPresentation.HttpPresentationException
presentationPrefix
to the specified
path and searching the class path for a directory or JAR containing
the file.
appfileName
- The file name relative to the
to the application's presentationPrefix
.
java.io.IOException
- If the file can not be found or opened.
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public boolean isPresentationRequest(com.lutris.appserver.server.httpPresentation.HttpPresentationRequest request) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
request
- The request for the presentation.
com.lutris.appserver.server.httpPresentation.HttpPresentationException
public com.lutris.appserver.server.session.Session getSession(javax.servlet.ServletRequest request)
request
- The (raw) request that would be sent in to this application.
public void setServletAndContext(javax.servlet.Servlet servlet, javax.servlet.ServletContext servletContext)
servlet
- The servlet we are running in.servletContext
- The ServletContext used to initialize the servlet we are running in.public javax.servlet.Servlet getServlet()
public javax.servlet.ServletContext getServletContext()
public void flushCache()
public void addMimeType(java.lang.String mimeType, java.lang.String extension)
public java.lang.ClassLoader getAppClassLoader()
|
EAF 7.4 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |