|
EAF 7.4 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.lutris.appserver.server.httpPresentation.servlet.HttpPresentationServlet
public class HttpPresentationServlet
Presentation server implemented as a servlet. Translates servlet requests into HttpPresentationManager requests. There is a one to one correspondence between an instance of this servlet and an Enhydra application. An instance of the application is created by the servlet. The servlet requires a single init parameter `configFile', that contains the path to the application's configuration file. This file must define the following fields:
server.classPath
- The class path for the application,
as a comma separated list. This should not contain the class path
for the Java runtime classes or the Lutris classes.
server.appClass
- The full class name of the application
class. This must implement
com.lutris.appserver.server.Application
.
server.presentationPrefix
- This is the path that is used as
a prefixed for all URL references within the application. It must use
a `/' separator (as with URLs).
server.autoReload
- A flag to indicate whether or not
the application should be automatically reloaded when any class or
jar file changes in the application's classpath. NOTE: THIS IS
A DEBUGGING OPTION AND MAY SLOW DOWN THE APPLICATION!
This servlet also implements the ListenableServlet
interface. This allows other objects to register with this servlet and
be notified every time service
is called. These remote
listeners may ignore the notification, examine the request, or even
replace the request and/or response with extended versions. This is
used by the debugging and monitoring servlets.
Field Summary | |
---|---|
protected javax.servlet.ServletContext |
context
Servlet is started under this context |
static java.lang.String |
XMLC_DOM_STATS_LOG_LEVEL
Log level for DOM statistics. |
Constructor Summary | |
---|---|
HttpPresentationServlet()
Create a new HttpPresentationServlet. |
Method Summary | |
---|---|
void |
destroy()
Destroys the servlet. |
void |
ensureAppIsRunning()
This method is public for use by the ServletManager to run the application startup() method after init(). |
protected com.lutris.util.Config |
getAppConfigInitParam()
Returns the application configuration init parameter. |
protected java.lang.String |
getAppConfigInitParamName()
Returns the application configuration init parameter name. |
com.lutris.appserver.server.Application |
getApplication()
Returns the application being run by this instance of the servlet. |
protected com.lutris.appserver.server.httpPresentation.HttpPresentationRequest |
getHttpPresentationRequest(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
This method instantiates the HttpPresentationRequest object that the presentation manager expects when servicing a request. |
protected com.lutris.appserver.server.httpPresentation.HttpPresentationResponse |
getHttpPresentationResponse(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
This method instantiates the HttpPresentationResponse object that the presentation manager expects when servicing a request. |
java.lang.String |
getServletInfo()
Return information specific to this servlet. |
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. |
void |
init(javax.servlet.ServletConfig config)
|
void |
service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handle a service request. |
void |
serviceDirect(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
This is an HTTP-specific version of the Servlet.service method that translates that request into a request to a presentation manager. |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String XMLC_DOM_STATS_LOG_LEVEL
protected javax.servlet.ServletContext context
Constructor Detail |
---|
public HttpPresentationServlet()
Method Detail |
---|
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Servlet
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
public void serviceDirect(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
As part of implementing the FiterableServlet interface, the real work is done here in serviceDirect(), while calls to service() result in filters being applied and called. The end of the filter chain is a glue servlet that directly calls this method.
req
- encapsulates the request to the servletresp
- encapsulates the response from the servlet
javax.servlet.ServletException
- if the request could not be handled
java.io.IOException
- if detected when handling the requestpublic void ensureAppIsRunning() throws javax.servlet.ServletException
javax.servlet.ServletException
- If any error occurs on startup.public java.lang.String getServletInfo()
getServletInfo
in interface javax.servlet.Servlet
getServletInfo
in class javax.servlet.GenericServlet
protected com.lutris.appserver.server.httpPresentation.HttpPresentationRequest getHttpPresentationRequest(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
req
- The servlet request object.resp
- The servlet response object.
protected com.lutris.appserver.server.httpPresentation.HttpPresentationResponse getHttpPresentationResponse(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
req
- The servlet request object.resp
- The servlet response object.
public com.lutris.appserver.server.Application getApplication()
protected com.lutris.util.Config getAppConfigInitParam()
protected java.lang.String getAppConfigInitParamName()
public void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
service()
on the outermost results.
service
in class javax.servlet.http.HttpServlet
request
- The original servlet request object.response
- The original servlet response object.
javax.servlet.ServletException
java.io.IOException
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 destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
|
EAF 7.4 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |