edu.isi.ontosaurus.tomcat
Class PowerLoomTomcatServlet

java.lang.Object
  extended by HttpServlet
      extended by edu.isi.ontosaurus.tomcat.PowerLoomTomcatServlet
Direct Known Subclasses:
OntosaurusServlet, PowerLoomSOAPServlet

public class PowerLoomTomcatServlet
extends HttpServlet

An top-level Servlet class for PowerLoom to work with the Tomcat or other servers which follow the javax servlet standards


Field Summary
static java.lang.String KBHome
           
protected static java.util.List kbsLoaded
           
 
Constructor Summary
PowerLoomTomcatServlet()
           
 
Method Summary
 void configure()
          Configure the common stuff.
protected  void copyStream(java.io.InputStream from, java.io.OutputStream to)
           
protected  void doGet(HttpServletRequest req, HttpServletResponse res)
          Services a single GET request from the client Default action is to return an unsupported message.
protected  void doPost(HttpServletRequest req, HttpServletResponse res)
          Services a single POST request from the client.
 java.lang.String getServletInfo()
           
 void init()
          Default init method
 void initialize()
          This will initialize PowerLoom and Ontosaurus systems, and other required systems.
protected  void printErrorHeader(ServletOutputStream p, java.lang.String errorTitle)
           
protected  void printErrorTrailer(ServletOutputStream p)
           
protected  java.lang.String streamToString(java.io.InputStream from)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KBHome

public static java.lang.String KBHome

kbsLoaded

protected static java.util.List kbsLoaded
Constructor Detail

PowerLoomTomcatServlet

public PowerLoomTomcatServlet()
Method Detail

initialize

public void initialize()
                throws ServletException
This will initialize PowerLoom and Ontosaurus systems, and other required systems. It should be invoked from the init() method.

Throws:
ServletException

configure

public void configure()
               throws ServletException
Configure the common stuff. This should be called after initialize. It will initialize any additional systems and set the base directory for kbs. Information for setting these values comes from the config object. The following initialization parameters are supported: SystemInits Whitespace separated list of Stella/PowerLoom system initialization code to call. This must be the fully qualified name to invoke with now parameters. Encoding of whitespace and other unusual characters is like in URLs. KBHome Path to the top of the KB directory. Must end with a directory separator character. Encoding of whitespace and other unusual characters is like in URLs. KBs Whitespace separated list of paths (relative to kbhome) of knowledge bases to load. They will be loaded after any additional systems are initialized. Encoding of whitespace and other unusual characters is like in URLs.

Throws:
ServletException

init

public void init()
          throws ServletException
Default init method

Throws:
ServletException

getServletInfo

public java.lang.String getServletInfo()

doPost

protected void doPost(HttpServletRequest req,
                      HttpServletResponse res)
               throws ServletException,
                      java.io.IOException
Services a single POST request from the client. Default action is to do return an unsupported message.

Parameters:
req - the servlet request
req - the servlet response
Throws:
ServletException - when an exception has occurred
java.io.IOException

doGet

protected void doGet(HttpServletRequest req,
                     HttpServletResponse res)
              throws ServletException,
                     java.io.IOException
Services a single GET request from the client Default action is to return an unsupported message. to the Stella-generated Ontosaurus code.

Parameters:
req - the servlet request
req - the servlet response
Throws:
ServletException - when an exception has occurred
java.io.IOException

copyStream

protected void copyStream(java.io.InputStream from,
                          java.io.OutputStream to)
                   throws java.io.IOException
Throws:
java.io.IOException

streamToString

protected java.lang.String streamToString(java.io.InputStream from)
                                   throws java.io.IOException
Throws:
java.io.IOException

printErrorHeader

protected void printErrorHeader(ServletOutputStream p,
                                java.lang.String errorTitle)

printErrorTrailer

protected void printErrorTrailer(ServletOutputStream p)