com.xmlserv.main
Class XMLServBackendImpl

java.lang.Object
  |
  +--com.xmlserv.main.XMLServBackendImpl
All Implemented Interfaces:
XMLServBackend
Direct Known Subclasses:
AppBase, EmptyPageBackend, XMLServFileBackend

public abstract class XMLServBackendImpl
extends java.lang.Object
implements XMLServBackend

Implementation of the XMLServBackend interface with basic usage statistics and a HashMap based parameter store.

Version:
$Id: XMLServBackendImpl.java,v 1.13 2002/11/15 18:03:45 muecke Exp $
Author:
Wolfram Saringer

Constructor Summary
XMLServBackendImpl()
          Create object.
 
Method Summary
 void addParam(java.lang.String paramname, java.lang.String paramvalue)
          Store parameter.
 void destroy()
          Free resources.
 java.lang.String getParam(java.lang.String paramname)
          Get a parameter value.
protected  int getReqCount()
          Get number of requests serviced.
 java.lang.String getStatus()
          Status report.
 void init()
          Initialize.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLServBackendImpl

public XMLServBackendImpl()
Create object.
Method Detail

init

public void init()
          throws javax.servlet.ServletException
Initialize.
Specified by:
init in interface XMLServBackend

destroy

public void destroy()
Free resources.
Specified by:
destroy in interface XMLServBackend

getStatus

public java.lang.String getStatus()
Status report.
Specified by:
getStatus in interface XMLServBackend
Returns:
A single line status report containing the number of requests serviced.

process

public org.jdom.Document process(javax.servlet.ServletContext context,
                                 javax.servlet.http.HttpServletRequest req,
                                 SecurityManager securitymanager)
                          throws XMLServException,
                                 javax.servlet.ServletException,
                                 java.io.IOException
This is the method to override in subclasses.
Specified by:
process in interface XMLServBackend
Parameters:
context - The servlet context.
req - The HTTP request.
securitymanager - The SecurityManager instance associated with this object.
Returns:
An XML document.
Throws:
XMLServException - Indicates an error condition in the business logic.
javax.servlet.ServletException - A generic failure.
java.io.IOException - Any I/O error condition.

process

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
Description copied from interface: XMLServBackend
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.
Specified by:
process in interface XMLServBackend
Following copied from interface: com.xmlserv.main.XMLServBackend
Returns:
Always null.

addParam

public void addParam(java.lang.String paramname,
                     java.lang.String paramvalue)
Store parameter.
Specified by:
addParam in interface XMLServBackend
Following copied from interface: com.xmlserv.main.XMLServBackend
Parameters:
paramname - The name of this parameter.
paramvalue - The parameters value.

getParam

public java.lang.String getParam(java.lang.String paramname)
Get a parameter value.
Specified by:
getParam in interface XMLServBackend
Parameters:
paramname - The name of the parameter.
Returns:
The parameters value or null if not set.

getReqCount

protected int getReqCount()
Get number of requests serviced.
Returns:
The number of requests.