Ontimize 5.2072EN

com.ontimize.util.rmitunneling
Class ServletHandler

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bycom.ontimize.util.rmitunneling.ServletHandler
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ServletHandler
extends javax.servlet.http.HttpServlet

See Also:
Serialized Form

Nested Class Summary
protected static interface ServletHandler.RMICommandHandler
           
protected static class ServletHandler.ServletClientException
          ServletClientException is thrown when an error is detected in a client's request.
protected static class ServletHandler.ServletForwardCommand
          Class that has an execute command to forward request body to local port on the server and send server reponse back to client.
protected static class ServletHandler.ServletGethostnameCommand
          Class that has an execute method to return the host name of the server as the response body.
protected static class ServletHandler.ServletPingCommand
          Class that has an execute method to return an OK status to indicate that connection was successful.
protected static class ServletHandler.ServletServerException
          ServletServerException is thrown when an error occurs here on the server.
protected static class ServletHandler.ServletTryHostnameCommand
          Class that has an execute method to return a human readable message describing which host name is available to local Java VMs.
 
Field Summary
protected static java.net.InetAddress connectHost
           
static boolean DEBUG
           
static java.lang.String DEBUG_PARAM
           
protected  boolean httpSession
           
protected static int[] ports
           
 
Constructor Summary
ServletHandler()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Provide more intelligible errors for methods that are likely to be called.
 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)
           
 java.lang.String getServletInfo()
           
 void init(javax.servlet.ServletConfig config)
          Once loaded, Java Servlets continue to run until they are unloaded or the webserver is stopped.
 
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
 

Field Detail

DEBUG

public static boolean DEBUG

ports

protected static int[] ports

connectHost

protected static java.net.InetAddress connectHost

httpSession

protected boolean httpSession

DEBUG_PARAM

public static final java.lang.String DEBUG_PARAM
See Also:
Constant Field Values
Constructor Detail

ServletHandler

public ServletHandler()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Once loaded, Java Servlets continue to run until they are unloaded or the webserver is stopped. This example takes advantage of the extended Servlet life-cycle and runs a remote object in the Servlet VM. To initialize this remote object the Servlet Administrator should specify a set of parameters which will be used to download and install an initial remote server (see readme.txt). If configuration parameters are valid (not blank), the servlet will attempt to load and start a remote object and a registry in which the object may be bound.

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,
                   java.io.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.

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.
java.io.IOException

doGet

public void doGet(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse res)
           throws javax.servlet.ServletException,
                  java.io.IOException
Provide more intelligible errors for methods that are likely to be called. Let unsupported HTTP "do*" methods result in an error generated by the super class.

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.
java.io.IOException

doPut

public void doPut(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse res)
           throws javax.servlet.ServletException,
                  java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

getServletInfo

public java.lang.String getServletInfo()

Ontimize