dblevins    2004/12/20 01:56:41

  Modified:    modules/core/src/java/org/openejb/server/httpd
                        HttpListener.java HttpRequestImpl.java
  Log:

  Added IOException to onMessage.  Fixed the assert methods in the tests.  
Implemented a couple methods in HttpRequestImpl.
  
  Revision  Changes    Path
  1.2       +4 -2      
openejb/modules/core/src/java/org/openejb/server/httpd/HttpListener.java
  
  Index: HttpListener.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/server/httpd/HttpListener.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HttpListener.java 17 Dec 2004 05:10:23 -0000      1.1
  +++ HttpListener.java 20 Dec 2004 06:56:41 -0000      1.2
  @@ -44,6 +44,8 @@
    */
   package org.openejb.server.httpd;
   
  +import java.io.IOException;
  +
   public interface HttpListener {
  -    void onMessage(HttpRequest req, HttpResponse res);
  +    void onMessage(HttpRequest req, HttpResponse res) throws IOException;
   }
  
  
  
  1.2       +7 -6      
openejb/modules/core/src/java/org/openejb/server/httpd/HttpRequestImpl.java
  
  Index: HttpRequestImpl.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/server/httpd/HttpRequestImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HttpRequestImpl.java      17 Dec 2004 05:10:23 -0000      1.1
  +++ HttpRequestImpl.java      20 Dec 2004 06:56:41 -0000      1.2
  @@ -184,15 +184,15 @@
       }
   
       public int getContentLength() {
  -        return 0;  //To change body of implemented methods use File | 
Settings | File Templates.
  +        return length;
       }
   
       public String getContentType() {
  -        return null;  //To change body of implemented methods use File | 
Settings | File Templates.
  +        return contentType;
       }
   
       public InputStream getInputStream() throws IOException {
  -        return null;  //To change body of implemented methods use File | 
Settings | File Templates.
  +        return (InputStream) this.in;
       }
   
       /*------------------------------------------------------------*/
  @@ -221,7 +221,7 @@
       private void readRequestLine(DataInput in) throws IOException {
           try {
               line = in.readLine();
  -//            System.out.println(line);
  +            System.out.println(line);
           } catch (Exception e) {
               throw new IOException("Could not read the HTTP Request Line :"
                       + e.getClass().getName()
  @@ -336,7 +336,7 @@
   
               try {
                   hf = in.readLine();
  -                //System.out.println(hf);
  +                System.out.println(hf);
               } catch (Exception e) {
                   throw new IOException("Could not read the HTTP Request 
Header Field :"
                           + e.getClass().getName()
  @@ -383,6 +383,7 @@
           // Content-type: application/x-www-form-urlencoded
           // or multipart/form-data
           length = parseContentLength();
  +
           contentType = getHeader(HttpRequest.HEADER_CONTENT_TYPE);
   
           if (FORM_URL_ENCODED.equals(contentType)) {
  
  
  

Reply via email to