helma.xmlrpc
Class WebServer

java.lang.Object
  |
  +--helma.xmlrpc.WebServer
All Implemented Interfaces:
java.lang.Runnable

public class WebServer
extends java.lang.Object
implements java.lang.Runnable

A web server that exclusively handles XML-RPC requests.


Constructor Summary
WebServer(int port)
          Creates a Web server at the specified port number.
 
Method Summary
 void acceptClient(java.lang.String address)
          Add an IP address to the list of accepted clients.
 void addHandler(java.lang.String name, java.lang.Object target)
          Register a handler object with this name.
 void denyClient(java.lang.String address)
          Add an IP address to the list of denied clients.
static void main(java.lang.String[] args)
          This can be called from command line, but you'll have to edit and recompile to change the server port or handler objects.
 void removeHandler(java.lang.String name)
          Remove a handler object that was previously registered with this server.
 void run()
          Listens for client requests until stopped.
 void setParanoid(boolean p)
          Switch client filtering on/off.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebServer

public WebServer(int port)
          throws java.io.IOException
Creates a Web server at the specified port number.
Method Detail

main

public static void main(java.lang.String[] args)
This can be called from command line, but you'll have to edit and recompile to change the server port or handler objects. By default, it sets up the following responders:

addHandler

public void addHandler(java.lang.String name,
                       java.lang.Object target)
Register a handler object with this name. Methods of this objects will be callable over XML-RPC as "name.method".

removeHandler

public void removeHandler(java.lang.String name)
Remove a handler object that was previously registered with this server.

setParanoid

public void setParanoid(boolean p)
Switch client filtering on/off.
See Also:
acceptClient(java.lang.String), denyClient(java.lang.String)

acceptClient

public void acceptClient(java.lang.String address)
                  throws java.lang.IllegalArgumentException
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.
See Also:
denyClient(java.lang.String), setParanoid(boolean)

denyClient

public void denyClient(java.lang.String address)
                throws java.lang.IllegalArgumentException
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.
See Also:
acceptClient(java.lang.String), setParanoid(boolean)

run

public void run()
Listens for client requests until stopped.
Specified by:
run in interface java.lang.Runnable