commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbe...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/server SimpleHttpServer.java SimpleHttpServerConnection.java
Date Wed, 19 Nov 2003 00:23:30 GMT
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


Mime
View raw message