org.tentackle.appworx.rmi
Class ApplicationServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.tentackle.appworx.rmi.ApplicationServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ApplicationServlet
extends javax.servlet.http.HttpServlet

RMI HTTP-tunneling servlet.

The servlet can operate in two modes:

  1. If the servlet parameter "applicationServer" is given the servlet will start an ApplicationServer. All servlet parameters are converted to server properties, so there's no need for an extra property file. However, the "tentackle.properties" is supported via <env-entry> as in WebApplication.
  2. If thers is no such servlet parameter the servlet will only forward RMI requests.
The logger can be set by the servlet parameter "logger". If not set the DefaultLogger will be used.

See Also:
Serialized Form

Constructor Summary
ApplicationServlet()
           
 
Method Summary
protected  Logger createLogger()
          Creates the logger for this servlet.
 void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
           
 void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Execute the command given in the servlet request query string.
 void doPut(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
           
 String getServletInfo()
           
 void init(javax.servlet.ServletConfig config)
          Initializes the servlet.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, 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
 

Constructor Detail

ApplicationServlet

public ApplicationServlet()
Method Detail

createLogger

protected Logger createLogger()
Creates the logger for this servlet.

Override this method if not using the default logger.

Returns:
the logger

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Initializes the servlet.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
config - Standard configuration object for an http servlet.
Throws:
javax.servlet.ServletException - Calling super.init(config) may cause a servlet exception to be thrown.

doPost

public void doPost(javax.servlet.http.HttpServletRequest req,
                   javax.servlet.http.HttpServletResponse res)
            throws javax.servlet.ServletException,
                   IOException
Execute the command given in the servlet request query string. The string before the first '=' in the queryString is interpreted as the command name, and the string after the first '=' is the parameters to the command.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters:
req - HTTP servlet request, contains incoming command and arguments
res - HTTP servlet response
Throws:
javax.servlet.ServletException - and IOException when invoking methods of req or res.
IOException

doGet

public void doGet(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse res)
           throws javax.servlet.ServletException,
                  IOException
Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
IOException

doPut

public void doPut(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse res)
           throws javax.servlet.ServletException,
                  IOException
Overrides:
doPut in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
IOException

getServletInfo

public String getServletInfo()
Specified by:
getServletInfo in interface javax.servlet.Servlet
Overrides:
getServletInfo in class javax.servlet.GenericServlet


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de