Return-Path: Delivered-To: apmail-xml-axis-dev-archive@xml.apache.org Received: (qmail 21741 invoked by uid 500); 1 Aug 2002 16:16:53 -0000 Mailing-List: contact axis-dev-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@xml.apache.org Received: (qmail 21732 invoked by uid 500); 1 Aug 2002 16:16:53 -0000 Delivered-To: apmail-xml-axis-cvs@apache.org Date: 1 Aug 2002 16:16:52 -0000 Message-ID: <20020801161652.43327.qmail@icarus.apache.org> From: rubys@apache.org To: xml-axis-cvs@apache.org Subject: cvs commit: xml-axis/java/src/org/apache/axis/transport/http SimpleAxisServer.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N rubys 2002/08/01 09:16:52 Modified: java/src/org/apache/axis/transport/http SimpleAxisServer.java Log: Restore single threading to SimpleAxisServer. See first comment line in this source file. We can argue later over what the default should be, but for now, I'm trying to eliminate variables in tracking down the intermittent gump failures. Revision Changes Path 1.70 +19 -7 xml-axis/java/src/org/apache/axis/transport/http/SimpleAxisServer.java Index: SimpleAxisServer.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/SimpleAxisServer.java,v retrieving revision 1.69 retrieving revision 1.70 diff -u -r1.69 -r1.70 --- SimpleAxisServer.java 10 Jul 2002 19:32:14 -0000 1.69 +++ SimpleAxisServer.java 1 Aug 2002 16:16:51 -0000 1.70 @@ -94,6 +94,9 @@ // cleanup policy). private Hashtable sessions = new Hashtable(); + // Are we doing threads? + private static boolean doThreads = false; + // Are we doing sessions? // Set this to false if you don't want any session overhead. private static boolean doSessions = true; @@ -156,9 +159,13 @@ } if (socket != null) { SimpleAxisWorker worker = new SimpleAxisWorker(this, socket); - Thread thread = new Thread(worker); - thread.setDaemon(true); - thread.start(); + if (doThreads) { + Thread thread = new Thread(worker); + thread.setDaemon(true); + thread.start(); + } else { + worker.run(); + } } } log.info(JavaUtils.getMessage("quit00", "SimpleAxisServer")); @@ -166,7 +173,6 @@ // per thread socket information private ServerSocket serverSocket; - private volatile Thread worker = null; /** * Obtain the serverSocket that that SimpleAxisServer is listening on. @@ -192,9 +198,13 @@ * @param daemon a boolean indicating if the thread should be a daemon. */ public void start(boolean daemon) throws Exception { - worker = new Thread(this); - worker.setDaemon(daemon); - worker.start(); + if (doThreads) { + Thread thread = new Thread(this); + thread.setDaemon(daemon); + thread.start(); + } else { + run(); + } } /** @@ -243,6 +253,8 @@ } try { + doThreads = (opts.isFlagSet('t') > 0); + int port = opts.getPort(); ServerSocket ss = null; // Try five times