Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 71545 invoked from network); 19 Nov 2003 00:23:35 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 19 Nov 2003 00:23:35 -0000 Received: (qmail 555 invoked by uid 500); 19 Nov 2003 00:23:16 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 479 invoked by uid 500); 19 Nov 2003 00:23:16 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 466 invoked by uid 500); 19 Nov 2003 00:23:16 -0000 Received: (qmail 463 invoked from network); 19 Nov 2003 00:23:16 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 19 Nov 2003 00:23:16 -0000 Received: (qmail 71521 invoked by uid 1633); 19 Nov 2003 00:23:30 -0000 Date: 19 Nov 2003 00:23:30 -0000 Message-ID: <20031119002330.71520.qmail@minotaur.apache.org> From: mbecke@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/server SimpleHttpServer.java SimpleHttpServerConnection.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N mbecke 2003/11/18 16:23:30 Modified: httpclient/src/test/org/apache/commons/httpclient/server Tag: HTTPCLIENT_2_0_BRANCH SimpleHttpServer.java SimpleHttpServerConnection.java Log: Fixed pre 1.4 compile errors. Revision Changes Path No revision No revision 1.1.2.2 +14 -11 jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/server/Attic/SimpleHttpServer.java Index: SimpleHttpServer.java =================================================================== RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/server/Attic/SimpleHttpServer.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- SimpleHttpServer.java 18 Nov 2003 12:26:38 -0000 1.1.2.1 +++ SimpleHttpServer.java 19 Nov 2003 00:23:30 -0000 1.1.2.2 @@ -82,7 +82,7 @@ * @author Christian Kohlschuetter */ public class SimpleHttpServer implements Runnable { - private static final Log log = LogFactory.getLog(SimpleHttpServer.class); + private static final Log LOG = LogFactory.getLog(SimpleHttpServer.class); private ServerSocket server = null; private Thread t; @@ -110,8 +110,8 @@ */ public SimpleHttpServer(int port) throws IOException { server = new ServerSocket(port); - if(log.isInfoEnabled()) { - log.info("New SimpleHttpServer on port " + getLocalPort()); + if(LOG.isInfoEnabled()) { + LOG.info("New SimpleHttpServer on port " + getLocalPort()); } tg = new ThreadGroup("SimpleHttpServer group"); t = new Thread(tg, this, "SimpleHttpServer connection handler"); @@ -149,8 +149,8 @@ } stopped = true; - if(log.isInfoEnabled()) { - log.info("Stopping SimpleHttpServer on port " + getLocalPort()); + if(LOG.isInfoEnabled()) { + LOG.info("Stopping SimpleHttpServer on port " + getLocalPort()); } tg.interrupt(); @@ -225,17 +225,20 @@ t.setDaemon(true); t.start(); } catch (IOException e) { - throw new RuntimeException(e); + LOG.error("SimpleHttpServer error", e); + throw new RuntimeException(e.getMessage()); } Thread.sleep(100); } } catch (InterruptedException accept) { } catch (SocketException e) { if (!stopped) { - throw new RuntimeException(e); + LOG.error("SimpleHttpServer error", e); + throw new RuntimeException(e.getMessage()); } } catch (IOException e) { - throw new RuntimeException(e); + LOG.error("SimpleHttpServer error", e); + throw new RuntimeException(e.getMessage()); } finally { destroy(); } 1.1.2.2 +10 -4 jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/server/Attic/SimpleHttpServerConnection.java Index: SimpleHttpServerConnection.java =================================================================== RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/server/Attic/SimpleHttpServerConnection.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- SimpleHttpServerConnection.java 18 Nov 2003 12:26:38 -0000 1.1.2.1 +++ SimpleHttpServerConnection.java 19 Nov 2003 00:23:30 -0000 1.1.2.2 @@ -71,6 +71,8 @@ import org.apache.commons.httpclient.Header; import org.apache.commons.httpclient.HttpParser; import org.apache.commons.httpclient.HttpStatus; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; /** * A connection to the SimpleHttpServer. @@ -78,6 +80,9 @@ * @author Christian Kohlschuetter */ public class SimpleHttpServerConnection implements Runnable { + + private static final Log LOG = LogFactory.getLog(SimpleHttpServerConnection.class); + private SimpleHttpServer server; private Socket socket; private InputStream in; @@ -120,7 +125,8 @@ } while(keepAlive); } catch (SocketException ignore) { } catch (IOException e) { - throw new RuntimeException(e); + LOG.error("ServerConnection read error", e); + throw new RuntimeException(e.getMessage()); } finally { destroy(); } --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org