import org.apache.xmlrpc.*;
import org.apache.xmlrpc.SystemHandler;

public class IntrospectionExample
{
    public String method_help = "method(string) -> string\n\nReturns its input";
    public String method(String input)
    {
	String output = input;
	return output;
    }

    public static void main(String[] args) throws Throwable
    {
	SystemHandler sh = new SystemHandler();
	sh.addDefaultSystemHandlers();
	sh.addIntrospectionSystemHandlers();

	XmlRpcServer xrs = new XmlRpcServer();
	DefaultHandlerMapping hm = (DefaultHandlerMapping)xrs.getHandlerMapping();
	hm.setUseInvokerIntrospection(true);

	WebServer ws = new WebServer(4242, null, xrs);
	ws.addHandler("test", new IntrospectionExample());
	ws.addHandler("system", sh);
	ws.start();

	Thread.sleep(100000);

	ws.shutdown();
    }
}

