electric.servlet
Class ServletEngine

java.lang.Object
  extended byelectric.servlet.ServletEngine

public final class ServletEngine
extends java.lang.Object

ServletEngine manages a collection of HTTPContexts and is responsible for delegating an incoming ServletRequest to the matching HTTPContext.

Author:
webMethods

Constructor Summary
ServletEngine(WebServer webServer)
          Construct a Servlet container with the specified environment.
 
Method Summary
 void addContext(java.lang.String path, HTTPContext context)
          Add a context and associate it with the specified path.
 void addContext(java.lang.String path, HTTPContext context, boolean startup)
          Add a context and associate it with the specified path.
 HTTPContext[] getAllContexts()
          Return all my contexts
 HTTPContext getContext(java.lang.String path)
          Return the context associated with the specified path, or null if there is none.
 WebServer getWebServer()
           
 HTTPContext removeContext(java.lang.String path)
          Remove the context with the specified path.
 HTTPContext service(java.lang.String uri, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
          Service the servlet request.
 void setWebServer(WebServer webServer)
           
 void shutdown()
          Shut down all contexts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletEngine

public ServletEngine(WebServer webServer)
Construct a Servlet container with the specified environment.

Parameters:
webServer - The web server.
Method Detail

getWebServer

public WebServer getWebServer()

setWebServer

public void setWebServer(WebServer webServer)
Parameters:
webServer -

service

public HTTPContext service(java.lang.String uri,
                           javax.servlet.ServletRequest request,
                           javax.servlet.ServletResponse response)
                    throws javax.servlet.ServletException,
                           java.io.IOException
Service the servlet request.

Parameters:
uri - The request URI.
request - The servlet request.
response - The servlet response.
Returns:
The context that service the request, or null if no match occurred.
Throws:
javax.servlet.ServletException - If a servlet exception occurred.
java.io.IOException - If an I/O exception occurred.

addContext

public void addContext(java.lang.String path,
                       HTTPContext context)
                throws javax.servlet.ServletException
Add a context and associate it with the specified path.

Parameters:
path - The path.
context - The context.
Throws:
javax.servlet.ServletException - If a servlet exception occurs.

addContext

public void addContext(java.lang.String path,
                       HTTPContext context,
                       boolean startup)
                throws javax.servlet.ServletException
Add a context and associate it with the specified path.

Parameters:
path - The path.
context - The context.
startup -
Throws:
javax.servlet.ServletException - If a servlet exception occurs.

removeContext

public HTTPContext removeContext(java.lang.String path)
Remove the context with the specified path.

Parameters:
path - The path.
Returns:
context mapped to the path or null otherwise

getContext

public HTTPContext getContext(java.lang.String path)
Return the context associated with the specified path, or null if there is none.

Parameters:
path - The path.

getAllContexts

public HTTPContext[] getAllContexts()
Return all my contexts


shutdown

public void shutdown()
Shut down all contexts.



copyright© 2001-2004 by webMethods All Rights Reserved.