|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.xmlserv.main.XMLServBackendImpl | +--com.xmlserv.app.AppBase
This abstract class is intended as the baseclass for all applications
running under XMLServ. It creates a reference to a PostgreSQL connection
pool object which should be used by subclasses instead of individual
connections.
Subclasses must still implement the process(context, req, secman) method as when subclassing
XMLServBackendImpl directly.
Constructor Summary | |
AppBase()
Empty constructor. |
Method Summary | |
protected java.sql.Connection |
checkoutConn()
Aggregation method delegated to PGConnectionPool. |
void |
destroy()
Prepare object to go out of service. |
protected javax.xml.transform.Source |
errorPage(java.lang.String msg)
Create an ErrorPage. |
protected javax.xml.transform.Source |
errorPage(java.lang.String msg,
java.lang.String code)
Create an ErrorPage with an error code. |
java.lang.String |
getUrl(javax.servlet.http.HttpServletRequest req)
|
void |
init()
Initialize object when application is loaded by BackendRepository. |
protected org.jdom.Element |
newElement(java.lang.String name,
java.lang.String content)
Produce simple Element with text content. |
javax.xml.transform.Source |
process(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
SecurityManager securitymanager)
This variant of the main method is called when the BackendHandle indicates that this Backend produces binary data which should be sent to the client without further processing. |
org.jdom.Document |
process(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest req,
SecurityManager securitymanager)
This is the method to override in subclasses. |
org.jdom.Document |
redirect(javax.servlet.http.HttpServletRequest req)
Utility method to implement consistent redirection behaviour. |
void |
redirect(com.oreilly.servlet.MultipartRequest mreq,
javax.servlet.http.HttpServletRequest sreq)
Utility method to implement consistent redirection behaviour. |
protected void |
returnConn(java.sql.Connection conn)
Aggregation method delegated to PGConnectionPool. |
Methods inherited from class com.xmlserv.main.XMLServBackendImpl |
addParam, getParam, getReqCount, getStatus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AppBase()
Method Detail |
public void init() throws javax.servlet.ServletException
init
in class XMLServBackendImpl
javax.servlet.ServletException
- On any error.PGConnectionPool
public void destroy()
destroy
in class XMLServBackendImpl
public org.jdom.Document process(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest req, SecurityManager securitymanager) throws XMLServException, javax.servlet.ServletException, java.io.IOException
XMLServBackendImpl
process
in class XMLServBackendImpl
com.xmlserv.main.XMLServBackendImpl
context
- The servlet context.req
- The HTTP request.securitymanager
- The SecurityManager instance associated with this object.XMLServException
- Indicates an error condition in the business logic.javax.servlet.ServletException
- A generic failure.java.io.IOException
- Any I/O error condition.public javax.xml.transform.Source process(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, SecurityManager securitymanager) throws XMLServException, javax.servlet.ServletException, java.io.IOException
XMLServBackend
process
in class XMLServBackendImpl
com.xmlserv.main.XMLServBackend
public org.jdom.Document redirect(javax.servlet.http.HttpServletRequest req) throws RedirectException
public void redirect(com.oreilly.servlet.MultipartRequest mreq, javax.servlet.http.HttpServletRequest sreq) throws RedirectException
public java.lang.String getUrl(javax.servlet.http.HttpServletRequest req)
protected org.jdom.Element newElement(java.lang.String name, java.lang.String content)
name
- The name of the XML Element.content
- The text content for the Element.protected java.sql.Connection checkoutConn() throws java.sql.SQLException
java.sql.SQLException
- Error checking out Connection.protected void returnConn(java.sql.Connection conn)
conn
- The Connection object to return to the pool.java.sql.SQLException
- Error returning Connection.protected javax.xml.transform.Source errorPage(java.lang.String msg) throws javax.servlet.ServletException, java.io.IOException
msg
- The error message.javax.servlet.ServletException
- Any processing error.java.io.IOException
- Should not happen.ErrorPage
protected javax.xml.transform.Source errorPage(java.lang.String msg, java.lang.String code) throws javax.servlet.ServletException, java.io.IOException
msg
- The error message.code
- The Error code.javax.servlet.ServletException
- Any processing error.java.io.IOException
- Should not happen.ErrorPage
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |