wt.httpgw
Class HTTPGatewayServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bywt.httpgw.HTTPGatewayServlet
All Implemented Interfaces:
CGIConstants, Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
HTTPAuthGatewayServlet

public class HTTPGatewayServlet
extends javax.servlet.http.HttpServlet
implements CGIConstants

The servlet front end to the Windchill HTTP gateway. It's counter part is the CGI wrapper WTCGI.EXE. This servlet gathers and loads the HTTP request headers and parameters before instantiating the HTTPRequest and HTTPGateway objects which are passed to a method server for processing.

See Also:
Serialized Form

Field Summary
private static int AFFINITY_CACHE_SIZE
           
private static String FILTER_CLASS_LIST
           
private static Filter[] filters
           
private static String FORWARD_TAG
           
private static int initializedInstanceCount
           
private static boolean LOG_APPEND
           
private static boolean LOG_ENABLED
           
private static String LOG_FILE
           
private  String myPathInfo
           
private  ServerAffinityCache serverAffinityCache
           
private  javax.servlet.ServletContext servletContext
           
private static boolean VERBOSE
           
private static int VERBOSITY
           
 
Fields inherited from class javax.servlet.http.HttpServlet
 
Fields inherited from class javax.servlet.GenericServlet
 
Fields inherited from interface wt.httpgw.CGIConstants
CGI_ACCEPT, CGI_ACCEPT_CHARSET, CGI_ACCEPT_LANGUAGE, CGI_AUTH_TYPE, CGI_AUTHORIZATION, CGI_CONNECTION, CGI_CONTENT_LENGTH, CGI_CONTENT_TYPE, CGI_CONTEXT_PATH, CGI_DELETE_METHOD, CGI_GATEWAY_INTERFACE, CGI_GET_METHOD, CGI_HEAD_METHOD, CGI_HOST, CGI_IF_MODIFIED_SINCE, CGI_MULTIPART_BOUNDARY, CGI_PATH_INFO, CGI_PATH_TRANSLATED, CGI_POST_METHOD, CGI_PRAGMA, CGI_PROPERTY_PREFIX, CGI_PROTOCOL, CGI_PUT_METHOD, CGI_QUERY_STRING, CGI_REFERER, CGI_REMOTE_ADDR, CGI_REMOTE_HOST, CGI_REMOTE_IDENT, CGI_REMOTE_USER, CGI_REQUEST_METHOD, CGI_SCHEME, CGI_SCRIPT_NAME, CGI_SERVER_NAME, CGI_SERVER_PORT, CGI_SERVER_PROTOCOL, CGI_SERVER_SOFTWARE, CGI_SERVLET_SESSION, CGI_TRACE_METHOD, CGI_UA_COLOR, CGI_UA_CPU, CGI_UA_OS, CGI_UA_PIXELS, CGI_URI, CGI_URL, CGI_USER_AGENT, versionID
 
Constructor Summary
HTTPGatewayServlet()
           
 
Method Summary
 void destroy()
          Perform any and all necessary cleanup after init().
private static void destroyFilters()
          Destroy and drop filter list (to prepare for potential subsequent init() call).
protected  String getName()
           
 void init(javax.servlet.ServletConfig config)
          Calls super.init(), remembers ServletContext and initializes filters.
private static void initFilters(javax.servlet.ServletContext servletContext)
          Initialize filters member variable.
 void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          This method calls any filters which have been configured for this servlet and finally calls serviceWithoutFilters() if the filters pass the request through by calling FilterChain.doFilter().
protected  void serviceWithoutFilters(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Our protected serviceWithoutFilters method gathers and loads the HTTP headers etc.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERBOSE

private static final boolean VERBOSE

VERBOSITY

private static final int VERBOSITY

LOG_FILE

private static final String LOG_FILE

LOG_ENABLED

private static final boolean LOG_ENABLED

LOG_APPEND

private static final boolean LOG_APPEND

AFFINITY_CACHE_SIZE

private static final int AFFINITY_CACHE_SIZE

FILTER_CLASS_LIST

private static final String FILTER_CLASS_LIST

FORWARD_TAG

private static final String FORWARD_TAG

filters

private static Filter[] filters

initializedInstanceCount

private static int initializedInstanceCount

serverAffinityCache

private ServerAffinityCache serverAffinityCache

servletContext

private javax.servlet.ServletContext servletContext

myPathInfo

private String myPathInfo
Constructor Detail

HTTPGatewayServlet

public HTTPGatewayServlet()
Method Detail

getName

protected String getName()

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Calls super.init(), remembers ServletContext and initializes filters.

Specified by:
init in interface javax.servlet.Servlet
Parameters:
config - received from the hosting web server.
Throws:
javax.servlet.ServletException

destroy

public void destroy()
Perform any and all necessary cleanup after init().

Specified by:
destroy in interface javax.servlet.Servlet

service

public void service(javax.servlet.http.HttpServletRequest req,
                    javax.servlet.http.HttpServletResponse res)
             throws javax.servlet.ServletException,
                    IOException
This method calls any filters which have been configured for this servlet and finally calls serviceWithoutFilters() if the filters pass the request through by calling FilterChain.doFilter().

Throws:
javax.servlet.ServletException
IOException

initFilters

private static void initFilters(javax.servlet.ServletContext servletContext)
Initialize filters member variable. To be called only from init().


destroyFilters

private static void destroyFilters()
Destroy and drop filter list (to prepare for potential subsequent init() call). To be called only from destroy().


serviceWithoutFilters

protected void serviceWithoutFilters(javax.servlet.http.HttpServletRequest req,
                                     javax.servlet.http.HttpServletResponse res)
                              throws javax.servlet.ServletException,
                                     IOException
Our protected serviceWithoutFilters method gathers and loads the HTTP headers etc. into a Properties structure that is passed to the request object constructor. It then instantiates both HTTPRequest and HTTPGateway objects before calling the method server to process the request.

The intent of this method as opposed to service() is that it this method is the raw servlet service handler without any filter application. It is called by service when filters pass the right request to the end of the filter chain.

Throws:
javax.servlet.ServletException
IOException