|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.servlet.GenericServlet | +--javax.servlet.http.HttpServlet | +--com.lutris.appserver.server.httpPresentation.servlet.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 seperated 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 withing the application. It must use
a `/' seperator (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
|
static org.apache.log4j.Level |
XMLC_DOM_STATS_LOG_LEVEL
Log level for DOM statistics. |
Constructor Summary | |
HttpPresentationServlet()
Create a new HttpPresentationServlet. |
Method Summary | |
void |
addFilter(Filter filter)
Add a filter to the end of the list of filters. |
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 Config |
getAppConfigInitParam()
Returns the application configuration init parameter. |
protected java.lang.String |
getAppConfigInitParamName()
Returns the application configuration init parameter name. |
Application |
getApplication()
Returns the application being run by this instance of the servlet. |
protected 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 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. |
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 |
removeFilter(Filter filter)
Remove a filter from the list of current filters. |
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, 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 org.apache.log4j.Level 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.
serviceDirect
in interface FilterableServlet
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 HttpPresentationRequest getHttpPresentationRequest(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
req
- The servlet request object.resp
- The servlet response object.
protected HttpPresentationResponse getHttpPresentationResponse(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
req
- The servlet request object.resp
- The servlet response object.
public Application getApplication()
protected Config getAppConfigInitParam()
protected java.lang.String getAppConfigInitParamName()
public void addFilter(Filter filter)
addFilter
in interface FilterableServlet
filter
- The filter to add.public void removeFilter(Filter filter)
removeFilter
in interface FilterableServlet
filter
- The filter to remove.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 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
|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |