if (xmlrpc != null) xmlrpc.addHandler ("$default", appManager);
    public void run () {	try {	    if (websrvPort > 0 || ajp13Port > 0) {	        http = new HttpServer ();	        // disable Jetty logging  FIXME: seems to be a jetty bug; as soon	        // as the logging is disabled, the more is logged	        Log.instance().disableLog ();	        Log.instance().add (new LogSink ()	            {	                public String getOptions () { return null; }	                public void log (String formattedLog) {}	                public void log (String tag, Object msg, Frame frame, long time) {}	                public void setOptions (String options) {}	                public boolean isStarted () { return true; }	                public void start () {}	                public void stop () {}	            }	        );	    }	    // start embedded web server if port is specified	    if (websrvPort > 0) {	        http.addListener (new InetAddrPort (websrvPort));	    }	    // activate the ajp13-listener	    if (ajp13Port > 0) {	        // create AJP13Listener	        ajp13 = new AJP13Listener(new InetAddrPort (ajp13Port));	        ajp13.setHttpServer(http);	        String jkallow = sysProps.getProperty ("allowAJP13");	        // by default the AJP13-connection just accepts requests from 127.0.0.1	        if (jkallow == null)	            jkallow = "127.0.0.1";	        StringTokenizer st = new StringTokenizer (jkallow, " ,;");	        String[] jkallowarr  = new String [st.countTokens()];	        int cnt = 0;	        while (st.hasMoreTokens ()) {	            jkallowarr[cnt] = st.nextToken();	            cnt++;	        }	        ajp13.setRemoteServers(jkallowarr);	        getLogger().log ("Starting AJP13-Listener on port "+(ajp13Port));	    }	    if (xmlrpcPort > 0) {	        String xmlparser = sysProps.getProperty ("xmlparser");	        if (xmlparser != null)	            XmlRpc.setDriver (xmlparser);	        xmlrpc = new WebServer (xmlrpcPort);	        if (paranoid) {	            xmlrpc.setParanoid (true);	            String xallow = sysProps.getProperty ("allowXmlRpc");	            if (xallow != null) {	                StringTokenizer st = new StringTokenizer (xallow, " ,;");	                while (st.hasMoreTokens ())	                    xmlrpc.acceptClient (st.nextToken ());	            }	        }	        getLogger().log ("Starting XML-RPC server on port "+(xmlrpcPort));	    }	    if (rmiPort > 0) {	        if (paranoid) {	            HopSocketFactory factory = new HopSocketFactory ();	            String rallow = sysProps.getProperty ("allowWeb");	            if (rallow != null) {	                StringTokenizer st = new StringTokenizer (rallow, " ,;");	                while (st.hasMoreTokens ())	                    factory.addAddress (st.nextToken ());	            }	            RMISocketFactory.setSocketFactory (factory);	        }	        getLogger().log ("Starting RMI server on port "+rmiPort);	        LocateRegistry.createRegistry (rmiPort);	    }	    // create application manager	    appManager = new ApplicationManager (rmiPort, hopHome, appsProps, this);	} catch (Exception gx) {	    getLogger().log ("Error initializing embedded database: "+gx);	    gx.printStackTrace ();	    return;	}	// start applications	appManager.startAll ();	// start embedded web server	if (http != null) try {	    http.start ();	} catch (MultiException m) {	    getLogger().log ("Error starting embedded web server: "+m);	}	if (ajp13 != null) try {	    ajp13.start ();	} catch (Exception m) {	    getLogger().log ("Error starting AJP13 listener: "+m);	}	int count = 0;	while (Thread.currentThread () == mainThread) {	    try {	        mainThread.sleep (3000l);	    } catch (InterruptedException ie) {}	    try {	        appManager.checkForChanges ();	    } catch (Exception x) {	        getLogger().log ("Caught in app manager loop: "+x);	    }	}    }