org.apache.xmlrpc.webserver
Class ServletWebServer

java.lang.Object
  extended by org.apache.xmlrpc.webserver.WebServer
      extended by org.apache.xmlrpc.webserver.ServletWebServer
All Implemented Interfaces:
java.lang.Runnable

public class ServletWebServer
extends WebServer

A subclass of WebServer, which emulates a servlet container. Mainly useful for debugging.


Nested Class Summary
static class ServletWebServer.Exception
          This exception is thrown by the request handling classes, advising the server, that it should return an error response.
 
Field Summary
 
Fields inherited from class org.apache.xmlrpc.webserver.WebServer
accept, deny, server, serverSocket
 
Constructor Summary
ServletWebServer(javax.servlet.http.HttpServlet pServlet, int pPort)
          Creates a new instance, which is listening on all local IP addresses and the given port.
ServletWebServer(javax.servlet.http.HttpServlet pServlet, int pPort, java.net.InetAddress pAddr)
          Creates a new instance, which is listening on the given IP address and the given port.
 
Method Summary
protected  ThreadPool.Task newTask(WebServer pWebServer, XmlRpcStreamServer pXmlRpcServer, java.net.Socket pSocket)
           
 
Methods inherited from class org.apache.xmlrpc.webserver.WebServer
acceptClient, allowConnection, createServerSocket, denyClient, getPort, getXmlRpcServer, log, log, newXmlRpcStreamServer, run, setParanoid, shutdown, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletWebServer

public ServletWebServer(javax.servlet.http.HttpServlet pServlet,
                        int pPort)
                 throws javax.servlet.ServletException
Creates a new instance, which is listening on all local IP addresses and the given port.

Parameters:
pServlet - The servlet, which is handling requests.
pPort - The servers port number; 0 for a random port being choosen.
Throws:
javax.servlet.ServletException - Initializing the servlet failed.

ServletWebServer

public ServletWebServer(javax.servlet.http.HttpServlet pServlet,
                        int pPort,
                        java.net.InetAddress pAddr)
                 throws javax.servlet.ServletException
Creates a new instance, which is listening on the given IP address and the given port.

Parameters:
pServlet - The servlet, which is handling requests.
pPort - The servers port number; 0 for a random port being choosen.
pAddr - The servers IP address.
Throws:
javax.servlet.ServletException - Initializing the servlet failed.
Method Detail

newTask

protected ThreadPool.Task newTask(WebServer pWebServer,
                                  XmlRpcStreamServer pXmlRpcServer,
                                  java.net.Socket pSocket)
                           throws java.io.IOException
Overrides:
newTask in class WebServer
Throws:
java.io.IOException


Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.