Run endless loop in separate new thread, otherwise the

server field will never be assigned the Server object (because
the Server constructor never returns, because the calling thread
ends up in the loop checking for updates in apps.properties).
This commit is contained in:
hns 2002-03-19 19:35:40 +00:00
parent 95ed052f76
commit 027b63bde6

View file

@ -22,7 +22,7 @@ import com.sleepycat.db.*;
* Helma server main class. * Helma server main class.
*/ */
public class Server implements IPathElement { public class Server implements IPathElement, Runnable {
public static final String version = "1.2pre2 2002/03/07"; public static final String version = "1.2pre2 2002/03/07";
public static final long starttime = System.currentTimeMillis(); public static final long starttime = System.currentTimeMillis();
@ -48,7 +48,7 @@ import com.sleepycat.db.*;
static Hashtable dbSources; static Hashtable dbSources;
static Server server; private static Server server;
protected static File hopHome = null; protected static File hopHome = null;
@ -111,7 +111,6 @@ import com.sleepycat.db.*;
} }
server = new Server (homeDir); server = new Server (homeDir);
} }
public Server (String home) { public Server (String home) {
@ -186,8 +185,8 @@ import com.sleepycat.db.*;
// Start running, finishing setup and then entering a loop to check changes // Start running, finishing setup and then entering a loop to check changes
// in the apps.properties file. // in the apps.properties file.
mainThread = Thread.currentThread (); mainThread = new Thread (this);
run (); mainThread.start ();
} }
/** /**