/lib/docs/org/apache/xmlrpc/webserver/WebServer.html
HTML | 820 lines | 716 code | 80 blank | 24 comment | 0 complexity | fe08bc6ddcfd6d94c5febb653d942bbe MD5 | raw file
Possible License(s): LGPL-3.0, Apache-2.0, GPL-3.0, GPL-2.0, AGPL-3.0, JSON, BSD-3-Clause
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <!--NewPage-->
- <HTML>
- <HEAD>
- <!-- Generated by javadoc (build 1.6.0_0) on Mon Apr 20 21:45:59 CEST 2009 -->
- <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <TITLE>
- WebServer (Apache XML-RPC 3.1.2 API)
- </TITLE>
- <META NAME="date" CONTENT="2009-04-20">
- <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
- <SCRIPT type="text/javascript">
- function windowTitle()
- {
- if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="WebServer (Apache XML-RPC 3.1.2 API)";
- }
- }
- </SCRIPT>
- <NOSCRIPT>
- </NOSCRIPT>
- </HEAD>
- <BODY BGCOLOR="white" onload="windowTitle();">
- <HR>
- <!-- ========= START OF TOP NAVBAR ======= -->
- <A NAME="navbar_top"><!-- --></A>
- <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
- <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
- <TR>
- <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <A NAME="navbar_top_firstrow"><!-- --></A>
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
- <TR ALIGN="center" VALIGN="top">
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/WebServer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
- </TR>
- </TABLE>
- </TD>
- <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
- </EM>
- </TD>
- </TR>
- <TR>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../org/apache/xmlrpc/webserver/ServletWebServer.Exception.html" title="class in org.apache.xmlrpc.webserver"><B>PREV CLASS</B></A>
- <A HREF="../../../../org/apache/xmlrpc/webserver/XmlRpcServlet.html" title="class in org.apache.xmlrpc.webserver"><B>NEXT CLASS</B></A></FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../index.html?org/apache/xmlrpc/webserver/WebServer.html" target="_top"><B>FRAMES</B></A>
- <A HREF="WebServer.html" target="_top"><B>NO FRAMES</B></A>
- <SCRIPT type="text/javascript">
- <!--
- if(window==top) {
- document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
- }
- //-->
- </SCRIPT>
- <NOSCRIPT>
- <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
- </NOSCRIPT>
- </FONT></TD>
- </TR>
- <TR>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="skip-navbar_top"></A>
- <!-- ========= END OF TOP NAVBAR ========= -->
- <HR>
- <!-- ======== START OF CLASS DATA ======== -->
- <H2>
- <FONT SIZE="-1">
- org.apache.xmlrpc.webserver</FONT>
- <BR>
- Class WebServer</H2>
- <PRE>
- java.lang.Object
- <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.xmlrpc.webserver.WebServer</B>
- </PRE>
- <DL>
- <DT><B>All Implemented Interfaces:</B> <DD>java.lang.Runnable</DD>
- </DL>
- <DL>
- <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../org/apache/xmlrpc/webserver/ServletWebServer.html" title="class in org.apache.xmlrpc.webserver">ServletWebServer</A></DD>
- </DL>
- <HR>
- <DL>
- <DT><PRE>public class <B>WebServer</B><DT>extends java.lang.Object<DT>implements java.lang.Runnable</DL>
- </PRE>
- <P>
- <p>The <A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html" title="class in org.apache.xmlrpc.webserver"><CODE>WebServer</CODE></A> is a minimal HTTP server, that might be used
- as an embedded web server.</p>
- <p>Use of the <A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html" title="class in org.apache.xmlrpc.webserver"><CODE>WebServer</CODE></A> has grown very popular amongst users
- of Apache XML-RPC. Why this is the case, can hardly be explained,
- because the <A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html" title="class in org.apache.xmlrpc.webserver"><CODE>WebServer</CODE></A> is at best a workaround, compared to
- full blown servlet engines like Tomcat or Jetty. For example, under
- heavy load it will almost definitely be slower than a real servlet
- engine, because it does neither support proper keepalive (multiple
- requests per physical connection) nor chunked mode (in other words,
- it cannot stream requests).</p>
- <p>If you still insist in using the <A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html" title="class in org.apache.xmlrpc.webserver"><CODE>WebServer</CODE></A>, it is
- recommended to use its subclass, the <A HREF="../../../../org/apache/xmlrpc/webserver/ServletWebServer.html" title="class in org.apache.xmlrpc.webserver"><CODE>ServletWebServer</CODE></A> instead,
- which offers a minimal subset of the servlet API. In other words,
- you keep yourself the option to migrate to a real servlet engine
- later.</p>
- <p>Use of the <A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html" title="class in org.apache.xmlrpc.webserver"><CODE>WebServer</CODE></A> goes roughly like this: First of all,
- create a property file (for example "MyHandlers.properties") and
- add it to your jar file. The property keys are handler names and
- the property values are the handler classes. Once that is done,
- create an instance of WebServer:
- <pre>
- final int port = 8088;
- final String propertyFile = "MyHandler.properties";
- PropertyHandlerMapping mapping = new PropertyHandlerMapping();
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- mapping.load(cl, propertyFile);
- WebServer webServer = new WebServer(port);
- XmlRpcServerConfigImpl config = new XmlRpcServerConfigImpl();
- XmlRpcServer server = webServer.getXmlRpcServer();
- server.setConfig(config);
- server.setHandlerMapping(mapping);
- webServer.start();
- </pre>
- <P>
- <P>
- <HR>
- <P>
- <!-- =========== FIELD SUMMARY =========== -->
- <A NAME="field_summary"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
- <B>Field Summary</B></FONT></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected java.util.List</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#accept">accept</A></B></CODE>
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected java.util.List</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#deny">deny</A></B></CODE>
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected <A HREF="../../../../org/apache/xmlrpc/server/XmlRpcStreamServer.html" title="class in org.apache.xmlrpc.server">XmlRpcStreamServer</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#server">server</A></B></CODE>
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected java.net.ServerSocket</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#serverSocket">serverSocket</A></B></CODE>
- <BR>
- </TD>
- </TR>
- </TABLE>
-
- <!-- ======== CONSTRUCTOR SUMMARY ======== -->
- <A NAME="constructor_summary"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
- <B>Constructor Summary</B></FONT></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#WebServer(int)">WebServer</A></B>(int pPort)</CODE>
- <BR>
- Creates a web server at the specified port number.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#WebServer(int, java.net.InetAddress)">WebServer</A></B>(int pPort,
- java.net.InetAddress pAddr)</CODE>
- <BR>
- Creates a web server at the specified port number and IP address.</TD>
- </TR>
- </TABLE>
-
- <!-- ========== METHOD SUMMARY =========== -->
- <A NAME="method_summary"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
- <B>Method Summary</B></FONT></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#acceptClient(java.lang.String)">acceptClient</A></B>(java.lang.String pAddress)</CODE>
- <BR>
- Add an IP address to the list of accepted clients.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected boolean</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#allowConnection(java.net.Socket)">allowConnection</A></B>(java.net.Socket s)</CODE>
- <BR>
- Checks incoming connections to see if they should be allowed.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected java.net.ServerSocket</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#createServerSocket(int, int, java.net.InetAddress)">createServerSocket</A></B>(int pPort,
- int backlog,
- java.net.InetAddress addr)</CODE>
- <BR>
- Factory method to manufacture the server socket.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#denyClient(java.lang.String)">denyClient</A></B>(java.lang.String pAddress)</CODE>
- <BR>
- Add an IP address to the list of denied clients.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> int</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#getPort()">getPort</A></B>()</CODE>
- <BR>
- Returns the port, on which the web server is running.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> <A HREF="../../../../org/apache/xmlrpc/server/XmlRpcStreamServer.html" title="class in org.apache.xmlrpc.server">XmlRpcStreamServer</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#getXmlRpcServer()">getXmlRpcServer</A></B>()</CODE>
- <BR>
- Returns the <A HREF="../../../../org/apache/xmlrpc/server/XmlRpcServer.html" title="class in org.apache.xmlrpc.server"><CODE>XmlRpcServer</CODE></A>.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected boolean</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#isParanoid()">isParanoid</A></B>()</CODE>
- <BR>
- Returns the client filtering state.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#log(java.lang.String)">log</A></B>(java.lang.String pMessage)</CODE>
- <BR>
- Logs a message.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#log(java.lang.Throwable)">log</A></B>(java.lang.Throwable pError)</CODE>
- <BR>
- Logs an error.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected <A HREF="../../../../org/apache/xmlrpc/util/ThreadPool.Task.html" title="interface in org.apache.xmlrpc.util">ThreadPool.Task</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#newTask(org.apache.xmlrpc.webserver.WebServer, org.apache.xmlrpc.server.XmlRpcStreamServer, java.net.Socket)">newTask</A></B>(<A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html" title="class in org.apache.xmlrpc.webserver">WebServer</A> pServer,
- <A HREF="../../../../org/apache/xmlrpc/server/XmlRpcStreamServer.html" title="class in org.apache.xmlrpc.server">XmlRpcStreamServer</A> pXmlRpcServer,
- java.net.Socket pSocket)</CODE>
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected <A HREF="../../../../org/apache/xmlrpc/util/ThreadPool.html" title="class in org.apache.xmlrpc.util">ThreadPool</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#newThreadPool()">newThreadPool</A></B>()</CODE>
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected <A HREF="../../../../org/apache/xmlrpc/server/XmlRpcStreamServer.html" title="class in org.apache.xmlrpc.server">XmlRpcStreamServer</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#newXmlRpcStreamServer()">newXmlRpcStreamServer</A></B>()</CODE>
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#run()">run</A></B>()</CODE>
- <BR>
- Listens for client requests until stopped.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#setParanoid(boolean)">setParanoid</A></B>(boolean pParanoid)</CODE>
- <BR>
- Switch client filtering on/off.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#shutdown()">shutdown</A></B>()</CODE>
- <BR>
- Stop listening on the server port.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#start()">start</A></B>()</CODE>
- <BR>
- Spawns a new thread which binds this server to the port it's
- configured to accept connections on.</TD>
- </TR>
- </TABLE>
- <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
- <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
- </TR>
- </TABLE>
-
- <P>
- <!-- ============ FIELD DETAIL =========== -->
- <A NAME="field_detail"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
- <B>Field Detail</B></FONT></TH>
- </TR>
- </TABLE>
- <A NAME="serverSocket"><!-- --></A><H3>
- serverSocket</H3>
- <PRE>
- protected java.net.ServerSocket <B>serverSocket</B></PRE>
- <DL>
- <DL>
- </DL>
- </DL>
- <HR>
- <A NAME="accept"><!-- --></A><H3>
- accept</H3>
- <PRE>
- protected final java.util.List <B>accept</B></PRE>
- <DL>
- <DL>
- </DL>
- </DL>
- <HR>
- <A NAME="deny"><!-- --></A><H3>
- deny</H3>
- <PRE>
- protected final java.util.List <B>deny</B></PRE>
- <DL>
- <DL>
- </DL>
- </DL>
- <HR>
- <A NAME="server"><!-- --></A><H3>
- server</H3>
- <PRE>
- protected final <A HREF="../../../../org/apache/xmlrpc/server/XmlRpcStreamServer.html" title="class in org.apache.xmlrpc.server">XmlRpcStreamServer</A> <B>server</B></PRE>
- <DL>
- <DL>
- </DL>
- </DL>
- <!-- ========= CONSTRUCTOR DETAIL ======== -->
- <A NAME="constructor_detail"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
- <B>Constructor Detail</B></FONT></TH>
- </TR>
- </TABLE>
- <A NAME="WebServer(int)"><!-- --></A><H3>
- WebServer</H3>
- <PRE>
- public <B>WebServer</B>(int pPort)</PRE>
- <DL>
- <DD>Creates a web server at the specified port number.
- <P>
- <DL>
- <DT><B>Parameters:</B><DD><CODE>pPort</CODE> - Port number; 0 for a random port, choosen by the
- operating system.</DL>
- </DL>
- <HR>
- <A NAME="WebServer(int, java.net.InetAddress)"><!-- --></A><H3>
- WebServer</H3>
- <PRE>
- public <B>WebServer</B>(int pPort,
- java.net.InetAddress pAddr)</PRE>
- <DL>
- <DD>Creates a web server at the specified port number and IP address.
- <P>
- <DL>
- <DT><B>Parameters:</B><DD><CODE>pPort</CODE> - Port number; 0 for a random port, choosen by the
- operating system.<DD><CODE>pAddr</CODE> - Local IP address; null for all available IP addresses.</DL>
- </DL>
- <!-- ============ METHOD DETAIL ========== -->
- <A NAME="method_detail"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
- <B>Method Detail</B></FONT></TH>
- </TR>
- </TABLE>
- <A NAME="newXmlRpcStreamServer()"><!-- --></A><H3>
- newXmlRpcStreamServer</H3>
- <PRE>
- protected <A HREF="../../../../org/apache/xmlrpc/server/XmlRpcStreamServer.html" title="class in org.apache.xmlrpc.server">XmlRpcStreamServer</A> <B>newXmlRpcStreamServer</B>()</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="createServerSocket(int, int, java.net.InetAddress)"><!-- --></A><H3>
- createServerSocket</H3>
- <PRE>
- protected java.net.ServerSocket <B>createServerSocket</B>(int pPort,
- int backlog,
- java.net.InetAddress addr)
- throws java.io.IOException</PRE>
- <DL>
- <DD>Factory method to manufacture the server socket. Useful as a
- hook method for subclasses to override when they desire
- different flavor of socket (i.e. a <code>SSLServerSocket</code>).
- <P>
- <DD><DL>
- </DL>
- </DD>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>pPort</CODE> - Port number; 0 for a random port, choosen by the operating
- system.<DD><CODE>backlog</CODE> - <DD><CODE>addr</CODE> - If <code>null</code>, binds to
- <code>INADDR_ANY</code>, meaning that all network interfaces on
- a multi-homed host will be listening.
- <DT><B>Throws:</B>
- <DD><CODE>java.io.IOException</CODE> - Error creating listener socket.</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="start()"><!-- --></A><H3>
- start</H3>
- <PRE>
- public void <B>start</B>()
- throws java.io.IOException</PRE>
- <DL>
- <DD>Spawns a new thread which binds this server to the port it's
- configured to accept connections on.
- <P>
- <DD><DL>
- </DL>
- </DD>
- <DD><DL>
- <DT><B>Throws:</B>
- <DD><CODE>java.io.IOException</CODE> - Binding the server socket failed.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#run()"><CODE>run()</CODE></A></DL>
- </DD>
- </DL>
- <HR>
- <A NAME="setParanoid(boolean)"><!-- --></A><H3>
- setParanoid</H3>
- <PRE>
- public void <B>setParanoid</B>(boolean pParanoid)</PRE>
- <DL>
- <DD>Switch client filtering on/off.
- <P>
- <DD><DL>
- </DL>
- </DD>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>pParanoid</CODE> - True to enable filtering, false otherwise.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#acceptClient(java.lang.String)"><CODE>acceptClient(java.lang.String)</CODE></A>,
- <A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#denyClient(java.lang.String)"><CODE>denyClient(java.lang.String)</CODE></A></DL>
- </DD>
- </DL>
- <HR>
- <A NAME="isParanoid()"><!-- --></A><H3>
- isParanoid</H3>
- <PRE>
- protected boolean <B>isParanoid</B>()</PRE>
- <DL>
- <DD>Returns the client filtering state.
- <P>
- <DD><DL>
- </DL>
- </DD>
- <DD><DL>
- <DT><B>Returns:</B><DD>True, if client filtering is enabled, false otherwise.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#acceptClient(java.lang.String)"><CODE>acceptClient(java.lang.String)</CODE></A>,
- <A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#denyClient(java.lang.String)"><CODE>denyClient(java.lang.String)</CODE></A></DL>
- </DD>
- </DL>
- <HR>
- <A NAME="acceptClient(java.lang.String)"><!-- --></A><H3>
- acceptClient</H3>
- <PRE>
- public void <B>acceptClient</B>(java.lang.String pAddress)</PRE>
- <DL>
- <DD>Add an IP address to the list of accepted clients. The parameter can
- contain '*' as wildcard character, e.g. "192.168.*.*". You must call
- setParanoid(true) in order for this to have any effect.
- <P>
- <DD><DL>
- </DL>
- </DD>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>pAddress</CODE> - The IP address being enabled.
- <DT><B>Throws:</B>
- <DD><CODE>java.lang.IllegalArgumentException</CODE> - Parsing the address failed.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#denyClient(java.lang.String)"><CODE>denyClient(java.lang.String)</CODE></A>,
- <A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#setParanoid(boolean)"><CODE>setParanoid(boolean)</CODE></A></DL>
- </DD>
- </DL>
- <HR>
- <A NAME="denyClient(java.lang.String)"><!-- --></A><H3>
- denyClient</H3>
- <PRE>
- public void <B>denyClient</B>(java.lang.String pAddress)</PRE>
- <DL>
- <DD>Add an IP address to the list of denied clients. The parameter can
- contain '*' as wildcard character, e.g. "192.168.*.*". You must call
- setParanoid(true) in order for this to have any effect.
- <P>
- <DD><DL>
- </DL>
- </DD>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>pAddress</CODE> - The IP address being disabled.
- <DT><B>Throws:</B>
- <DD><CODE>java.lang.IllegalArgumentException</CODE> - Parsing the address failed.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#acceptClient(java.lang.String)"><CODE>acceptClient(java.lang.String)</CODE></A>,
- <A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#setParanoid(boolean)"><CODE>setParanoid(boolean)</CODE></A></DL>
- </DD>
- </DL>
- <HR>
- <A NAME="allowConnection(java.net.Socket)"><!-- --></A><H3>
- allowConnection</H3>
- <PRE>
- protected boolean <B>allowConnection</B>(java.net.Socket s)</PRE>
- <DL>
- <DD>Checks incoming connections to see if they should be allowed.
- If not in paranoid mode, always returns true.
- <P>
- <DD><DL>
- </DL>
- </DD>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>s</CODE> - The socket to inspect.
- <DT><B>Returns:</B><DD>Whether the connection should be allowed.</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="newTask(org.apache.xmlrpc.webserver.WebServer, org.apache.xmlrpc.server.XmlRpcStreamServer, java.net.Socket)"><!-- --></A><H3>
- newTask</H3>
- <PRE>
- protected <A HREF="../../../../org/apache/xmlrpc/util/ThreadPool.Task.html" title="interface in org.apache.xmlrpc.util">ThreadPool.Task</A> <B>newTask</B>(<A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html" title="class in org.apache.xmlrpc.webserver">WebServer</A> pServer,
- <A HREF="../../../../org/apache/xmlrpc/server/XmlRpcStreamServer.html" title="class in org.apache.xmlrpc.server">XmlRpcStreamServer</A> pXmlRpcServer,
- java.net.Socket pSocket)
- throws java.io.IOException</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- <DD><DL>
- <DT><B>Throws:</B>
- <DD><CODE>java.io.IOException</CODE></DL>
- </DD>
- </DL>
- <HR>
- <A NAME="run()"><!-- --></A><H3>
- run</H3>
- <PRE>
- public void <B>run</B>()</PRE>
- <DL>
- <DD>Listens for client requests until stopped. Call <A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#start()"><CODE>start()</CODE></A> to invoke this method, and <A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#shutdown()"><CODE>shutdown()</CODE></A> to
- break out of it.
- <P>
- <DD><DL>
- <DT><B>Specified by:</B><DD><CODE>run</CODE> in interface <CODE>java.lang.Runnable</CODE></DL>
- </DD>
- <DD><DL>
- <DT><B>Throws:</B>
- <DD><CODE>java.lang.RuntimeException</CODE> - Generally caused by either an
- <code>UnknownHostException</code> or <code>BindException</code>
- with the vanilla web server.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#start()"><CODE>start()</CODE></A>,
- <A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#shutdown()"><CODE>shutdown()</CODE></A></DL>
- </DD>
- </DL>
- <HR>
- <A NAME="newThreadPool()"><!-- --></A><H3>
- newThreadPool</H3>
- <PRE>
- protected <A HREF="../../../../org/apache/xmlrpc/util/ThreadPool.html" title="class in org.apache.xmlrpc.util">ThreadPool</A> <B>newThreadPool</B>()</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="shutdown()"><!-- --></A><H3>
- shutdown</H3>
- <PRE>
- public void <B>shutdown</B>()</PRE>
- <DL>
- <DD>Stop listening on the server port. Shutting down our <A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#listener"><CODE>listener</CODE></A> effectively breaks it out of its <A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#run()"><CODE>run()</CODE></A>
- loop.
- <P>
- <DD><DL>
- </DL>
- </DD>
- <DD><DL>
- <DT><B>See Also:</B><DD><A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#run()"><CODE>run()</CODE></A></DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getPort()"><!-- --></A><H3>
- getPort</H3>
- <PRE>
- public int <B>getPort</B>()</PRE>
- <DL>
- <DD>Returns the port, on which the web server is running.
- This method may be invoked after <A HREF="../../../../org/apache/xmlrpc/webserver/WebServer.html#start()"><CODE>start()</CODE></A> only.
- <P>
- <DD><DL>
- </DL>
- </DD>
- <DD><DL>
- <DT><B>Returns:</B><DD>Servers port number</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="log(java.lang.Throwable)"><!-- --></A><H3>
- log</H3>
- <PRE>
- public void <B>log</B>(java.lang.Throwable pError)</PRE>
- <DL>
- <DD>Logs an error.
- <P>
- <DD><DL>
- </DL>
- </DD>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>pError</CODE> - The error being logged.</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="log(java.lang.String)"><!-- --></A><H3>
- log</H3>
- <PRE>
- public void <B>log</B>(java.lang.String pMessage)</PRE>
- <DL>
- <DD>Logs a message.
- <P>
- <DD><DL>
- </DL>
- </DD>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>pMessage</CODE> - The being logged.</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getXmlRpcServer()"><!-- --></A><H3>
- getXmlRpcServer</H3>
- <PRE>
- public <A HREF="../../../../org/apache/xmlrpc/server/XmlRpcStreamServer.html" title="class in org.apache.xmlrpc.server">XmlRpcStreamServer</A> <B>getXmlRpcServer</B>()</PRE>
- <DL>
- <DD>Returns the <A HREF="../../../../org/apache/xmlrpc/server/XmlRpcServer.html" title="class in org.apache.xmlrpc.server"><CODE>XmlRpcServer</CODE></A>.
- <P>
- <DD><DL>
- </DL>
- </DD>
- <DD><DL>
- <DT><B>Returns:</B><DD>The server object.</DL>
- </DD>
- </DL>
- <!-- ========= END OF CLASS DATA ========= -->
- <HR>
- <!-- ======= START OF BOTTOM NAVBAR ====== -->
- <A NAME="navbar_bottom"><!-- --></A>
- <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
- <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
- <TR>
- <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <A NAME="navbar_bottom_firstrow"><!-- --></A>
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
- <TR ALIGN="center" VALIGN="top">
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/WebServer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
- </TR>
- </TABLE>
- </TD>
- <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
- </EM>
- </TD>
- </TR>
- <TR>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../org/apache/xmlrpc/webserver/ServletWebServer.Exception.html" title="class in org.apache.xmlrpc.webserver"><B>PREV CLASS</B></A>
- <A HREF="../../../../org/apache/xmlrpc/webserver/XmlRpcServlet.html" title="class in org.apache.xmlrpc.webserver"><B>NEXT CLASS</B></A></FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../index.html?org/apache/xmlrpc/webserver/WebServer.html" target="_top"><B>FRAMES</B></A>
- <A HREF="WebServer.html" target="_top"><B>NO FRAMES</B></A>
- <SCRIPT type="text/javascript">
- <!--
- if(window==top) {
- document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
- }
- //-->
- </SCRIPT>
- <NOSCRIPT>
- <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
- </NOSCRIPT>
- </FONT></TD>
- </TR>
- <TR>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="skip-navbar_bottom"></A>
- <!-- ======== END OF BOTTOM NAVBAR ======= -->
- <HR>
- Copyright © 2001-2009 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
- </BODY>
- </HTML>