[jboss-remoting-commits] JBoss Remoting SVN: r3990 - in remoting3/trunk: http/src/main/java/org/jboss/cx/remoting/http and 2 other directories.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Mon Apr 14 12:53:21 EDT 2008


Author: david.lloyd at jboss.com
Date: 2008-04-14 12:53:21 -0400 (Mon, 14 Apr 2008)
New Revision: 3990

Modified:
   remoting3/trunk/build.xml
   remoting3/trunk/http-se6/src/main/java/org/jboss/cx/remoting/http/se6/ServerInstance.java
   remoting3/trunk/http-urlconnection/src/main/java/org/jboss/cx/remoting/http/urlconnection/HttpUrlChannel.java
   remoting3/trunk/http/src/main/java/org/jboss/cx/remoting/http/RemotingHttpSession.java
Log:
Various temporary compile fixes, also lib deps for http modules

Modified: remoting3/trunk/build.xml
===================================================================
--- remoting3/trunk/build.xml	2008-04-14 16:49:53 UTC (rev 3989)
+++ remoting3/trunk/build.xml	2008-04-14 16:53:21 UTC (rev 3990)
@@ -355,6 +355,7 @@
             <compilerarg value="-Xlint:unchecked"/>
             <classpath>
                 <path refid="api.classpath"/>
+                <path refid="log-jul.classpath"/>
                 <path refid="util.classpath"/>
             </classpath>
         </javac>
@@ -365,7 +366,7 @@
         <delete dir="http/target"/>
     </target>
 
-    <target name="http" description="Build the http module" depends="api,util,http.compile">
+    <target name="http" description="Build the http module" depends="api,log-jul,util,http.compile">
         <path id="http.classpath">
             <pathelement location="http/target/main/classes"/>
         </path>
@@ -566,6 +567,7 @@
             <classpath>
                 <path refid="api.classpath"/>
                 <path refid="http.classpath"/>
+                <path refid="log-jul.classpath"/>
                 <path refid="util.classpath"/>
             </classpath>
         </javac>
@@ -576,7 +578,7 @@
         <delete dir="http-urlconnection/target"/>
     </target>
 
-    <target name="http-urlconnection" description="Build the http-urlconnection module" depends="api,http,util,http-urlconnection.compile">
+    <target name="http-urlconnection" description="Build the http-urlconnection module" depends="api,http,log-jul,util,http-urlconnection.compile">
         <path id="http-urlconnection.classpath">
             <pathelement location="http-urlconnection/target/main/classes"/>
         </path>

Modified: remoting3/trunk/http/src/main/java/org/jboss/cx/remoting/http/RemotingHttpSession.java
===================================================================
--- remoting3/trunk/http/src/main/java/org/jboss/cx/remoting/http/RemotingHttpSession.java	2008-04-14 16:49:53 UTC (rev 3989)
+++ remoting3/trunk/http/src/main/java/org/jboss/cx/remoting/http/RemotingHttpSession.java	2008-04-14 16:53:21 UTC (rev 3990)
@@ -174,7 +174,7 @@
         public void closeStream(final StreamIdentifier streamIdentifier) throws IOException {
         }
 
-        public ObjectMessageOutput sendStreamData(final StreamIdentifier streamIdentifier, final long sequence, final Executor streamExecutor) throws IOException {
+        public ObjectMessageOutput sendStreamData(final StreamIdentifier streamIdentifier, final Executor streamExecutor) throws IOException {
             return null;
         }
 

Modified: remoting3/trunk/http-se6/src/main/java/org/jboss/cx/remoting/http/se6/ServerInstance.java
===================================================================
--- remoting3/trunk/http-se6/src/main/java/org/jboss/cx/remoting/http/se6/ServerInstance.java	2008-04-14 16:49:53 UTC (rev 3989)
+++ remoting3/trunk/http-se6/src/main/java/org/jboss/cx/remoting/http/se6/ServerInstance.java	2008-04-14 16:53:21 UTC (rev 3990)
@@ -1,20 +1,11 @@
 package org.jboss.cx.remoting.http.se6;
 
 import java.io.IOException;
-import java.io.OutputStream;
-import java.io.InputStream;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
-import java.net.URI;
 import java.util.concurrent.Executor;
-import org.jboss.cx.remoting.http.spi.RemotingHttpSessionContext;
-import org.jboss.cx.remoting.http.spi.OutgoingHttpMessage;
-import org.jboss.cx.remoting.http.spi.AbstractIncomingHttpMessage;
-import org.jboss.cx.remoting.spi.ByteMessageInput;
-import org.jboss.cx.remoting.spi.ByteMessageOutput;
 
 import com.sun.net.httpserver.BasicAuthenticator;
-import com.sun.net.httpserver.Headers;
 import com.sun.net.httpserver.HttpContext;
 import com.sun.net.httpserver.HttpExchange;
 import com.sun.net.httpserver.HttpHandler;
@@ -60,90 +51,90 @@
 
     private class MyHttpHandler implements HttpHandler {
         public void handle(final HttpExchange httpExchange) throws IOException {
-            final URI requestURI = httpExchange.getRequestURI();
-            final Headers requestHeaders = httpExchange.getRequestHeaders();
-            final InetSocketAddress inetSocketAddress = httpExchange.getRemoteAddress();
-            final InetAddress remoteAddress = inetSocketAddress.getAddress();
-            final int remotePort = inetSocketAddress.getPort();
-            RemotingHttpSessionContext httpSessionContext = null; // todo locate
-            httpSessionContext.queueMessage(new AbstractIncomingHttpMessage() {
-                public ByteMessageInput getMessageData() {
-                    final InputStream inputStream = httpExchange.getRequestBody();
-                    return new ByteMessageInput() {
-                        public int read() throws IOException {
-                            return inputStream.read();
-                        }
-
-                        public int read(byte[] data) throws IOException {
-                            return inputStream.read(data);
-                        }
-
-                        public int read(byte[] data, int offs, int len) throws IOException {
-                            return inputStream.read(data, offs, len);
-                        }
-
-                        public int remaining() {
-                            return -1;
-                        }
-
-                        public void close() throws IOException {
-                            inputStream.close();
-                        }
-                    };
-                }
-            });
-            // todo - WAIT untit the input stream is consumed? or - just don't close the output until the input is done
-            // todo - consume all of input stream
-            OutgoingHttpMessage httpReply = null;
-            try {
-                // todo - magic # - timeout should be configurable
-                httpReply = httpSessionContext.getNextMessage(8000L);
-            } catch (InterruptedException e) {
-                Thread.currentThread().interrupt();
-            }
-            if (httpReply == null) {
-                // send empty OK
-                httpExchange.sendResponseHeaders(200, 0);
-            } else {
-                // send reply
-                final Headers responseHeaders = httpExchange.getResponseHeaders();
-                for (final String name : httpReply.getHeaderNames()) {
-                    for (final String value : httpReply.getHeaderValues(name)) {
-                        responseHeaders.set(name, value);
-                    }
-                }
-                httpExchange.sendResponseHeaders(200, 0); // todo - preset response size?
-                final OutputStream outputStream = httpExchange.getResponseBody();
-                httpReply.writeMessageData(new ByteMessageOutput() {
-                    public void write(int b) throws IOException {
-                        outputStream.write(b);
-                    }
-
-                    public void write(byte[] b) throws IOException {
-                        outputStream.write(b);
-                    }
-
-                    public void write(byte[] b, int offs, int len) throws IOException {
-                        outputStream.write(b, offs, len);
-                    }
-
-                    public void commit() throws IOException {
-                    }
-
-                    public int getBytesWritten() throws IOException {
-                        return -1;
-                    }
-
-                    public void close() throws IOException {
-                        outputStream.close();
-                    }
-
-                    public void flush() throws IOException {
-                        outputStream.flush();
-                    }
-                });
-            }
-            httpExchange.close();
+//            final URI requestURI = httpExchange.getRequestURI();
+//            final Headers requestHeaders = httpExchange.getRequestHeaders();
+//            final InetSocketAddress inetSocketAddress = httpExchange.getRemoteAddress();
+//            final InetAddress remoteAddress = inetSocketAddress.getAddress();
+//            final int remotePort = inetSocketAddress.getPort();
+//            RemotingHttpSessionContext httpSessionContext = null; // todo locate
+//            httpSessionContext.queueMessage(new AbstractIncomingHttpMessage() {
+//                public ByteMessageInput getMessageData() {
+//                    final InputStream inputStream = httpExchange.getRequestBody();
+//                    return new ByteMessageInput() {
+//                        public int read() throws IOException {
+//                            return inputStream.read();
+//                        }
+//
+//                        public int read(byte[] data) throws IOException {
+//                            return inputStream.read(data);
+//                        }
+//
+//                        public int read(byte[] data, int offs, int len) throws IOException {
+//                            return inputStream.read(data, offs, len);
+//                        }
+//
+//                        public int remaining() {
+//                            return -1;
+//                        }
+//
+//                        public void close() throws IOException {
+//                            inputStream.close();
+//                        }
+//                    };
+//                }
+//            });
+//            // todo - WAIT untit the input stream is consumed? or - just don't close the output until the input is done
+//            // todo - consume all of input stream
+//            OutgoingHttpMessage httpReply = null;
+//            try {
+//                // todo - magic # - timeout should be configurable
+//                httpReply = httpSessionContext.getNextMessage(8000L);
+//            } catch (InterruptedException e) {
+//                Thread.currentThread().interrupt();
+//            }
+//            if (httpReply == null) {
+//                // send empty OK
+//                httpExchange.sendResponseHeaders(200, 0);
+//            } else {
+//                // send reply
+//                final Headers responseHeaders = httpExchange.getResponseHeaders();
+//                for (final String name : httpReply.getHeaderNames()) {
+//                    for (final String value : httpReply.getHeaderValues(name)) {
+//                        responseHeaders.set(name, value);
+//                    }
+//                }
+//                httpExchange.sendResponseHeaders(200, 0); // todo - preset response size?
+//                final OutputStream outputStream = httpExchange.getResponseBody();
+//                httpReply.writeMessageData(new ByteMessageOutput() {
+//                    public void write(int b) throws IOException {
+//                        outputStream.write(b);
+//                    }
+//
+//                    public void write(byte[] b) throws IOException {
+//                        outputStream.write(b);
+//                    }
+//
+//                    public void write(byte[] b, int offs, int len) throws IOException {
+//                        outputStream.write(b, offs, len);
+//                    }
+//
+//                    public void commit() throws IOException {
+//                    }
+//
+//                    public int getBytesWritten() throws IOException {
+//                        return -1;
+//                    }
+//
+//                    public void close() throws IOException {
+//                        outputStream.close();
+//                    }
+//
+//                    public void flush() throws IOException {
+//                        outputStream.flush();
+//                    }
+//                });
+//            }
+//            httpExchange.close();
         }
     }
 }

Modified: remoting3/trunk/http-urlconnection/src/main/java/org/jboss/cx/remoting/http/urlconnection/HttpUrlChannel.java
===================================================================
--- remoting3/trunk/http-urlconnection/src/main/java/org/jboss/cx/remoting/http/urlconnection/HttpUrlChannel.java	2008-04-14 16:49:53 UTC (rev 3989)
+++ remoting3/trunk/http-urlconnection/src/main/java/org/jboss/cx/remoting/http/urlconnection/HttpUrlChannel.java	2008-04-14 16:53:21 UTC (rev 3990)
@@ -6,9 +6,8 @@
 import java.net.HttpURLConnection;
 import java.net.URL;
 import java.util.LinkedHashMap;
-import java.util.Map;
 import java.util.List;
-import java.util.Iterator;
+import java.util.Map;
 import java.util.concurrent.ConcurrentMap;
 import org.jboss.cx.remoting.http.spi.AbstractIncomingHttpMessage;
 import org.jboss.cx.remoting.http.spi.OutgoingHttpMessage;
@@ -55,8 +54,8 @@
 //                        httpURLConnection.setReadTimeout();
                         httpConnection.setRequestMethod("POST"); // All remoting requests are POST
                         for (Map.Entry<String, String> entry : cookies.entrySet()) {
-                            httpConnection.setRequestProperty();
-                            entry.getKey()
+//                            httpConnection.setRequestProperty();
+//                            entry.getKey()
                         }
                         httpConnection.connect();
                         final OutputStream outputStream = httpConnection.getOutputStream();




More information about the jboss-remoting-commits mailing list