summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-05-24 06:45:59 (EDT)
committerEike Stepper2008-05-24 06:45:59 (EDT)
commita9a714903539d4bd34938acb23b5e58bed10ec84 (patch)
treece3a0ed0ea8a6694bf8925967a3b479f45c69f25
parent46a51d27d7db53246054fd258e598d0c2f30576f (diff)
downloadcdo-a9a714903539d4bd34938acb23b5e58bed10ec84.zip
cdo-a9a714903539d4bd34938acb23b5e58bed10ec84.tar.gz
cdo-a9a714903539d4bd34938acb23b5e58bed10ec84.tar.bz2
[232648] Provide an HTTPConnector
https://bugs.eclipse.org/bugs/show_bug.cgi?id=232648
-rw-r--r--plugins/org.eclipse.net4j.http/plugin.xml2
-rw-r--r--plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPAcceptorFactory.java2
-rw-r--r--plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPConnectorFactory.java4
-rw-r--r--plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/Net4jTransportServlet.java11
4 files changed, 10 insertions, 9 deletions
diff --git a/plugins/org.eclipse.net4j.http/plugin.xml b/plugins/org.eclipse.net4j.http/plugin.xml
index b82ebb4..9db2275 100644
--- a/plugins/org.eclipse.net4j.http/plugin.xml
+++ b/plugins/org.eclipse.net4j.http/plugin.xml
@@ -32,7 +32,7 @@
<extension
point="org.eclipse.equinox.http.registry.servlets">
<servlet
- alias="net4j.transport"
+ alias="/net4j"
class="org.eclipse.net4j.internal.http.Net4jTransportServlet">
</servlet>
</extension>
diff --git a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPAcceptorFactory.java b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPAcceptorFactory.java
index 97ee530..70e350a 100644
--- a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPAcceptorFactory.java
+++ b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPAcceptorFactory.java
@@ -17,7 +17,7 @@ import org.eclipse.internal.net4j.acceptor.AcceptorFactory;
*/
public class HTTPAcceptorFactory extends AcceptorFactory
{
- public static final String TYPE = "tcp";
+ public static final String TYPE = "http";
private static final String SEPARATOR = ":"; //$NON-NLS-1$
diff --git a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPConnectorFactory.java b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPConnectorFactory.java
index 5781b6c..a54f60b 100644
--- a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPConnectorFactory.java
+++ b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPConnectorFactory.java
@@ -17,7 +17,7 @@ import org.eclipse.internal.net4j.connector.ConnectorFactory;
*/
public class HTTPConnectorFactory extends ConnectorFactory
{
- public static final String TYPE = "tcp";
+ public static final String TYPE = "http";
private static final String URL_SCHEME = "http://";
@@ -30,8 +30,6 @@ public class HTTPConnectorFactory extends ConnectorFactory
{
// try
// {
- // // TODO Don't use URL
- // // Scheme "tcp://" would be rejected!
// URL url = new URL(URL_SCHEME + description);
// String userID = url.getUserInfo();
// String host = url.getHost();
diff --git a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/Net4jTransportServlet.java b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/Net4jTransportServlet.java
index 4151d09..d153ec5 100644
--- a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/Net4jTransportServlet.java
+++ b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/Net4jTransportServlet.java
@@ -60,6 +60,11 @@ public class Net4jTransportServlet extends HttpServlet implements INet4jTranspor
protected void handleRequest(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
+ if (requestHandler == null)
+ {
+ throw new ServletException("No request handler installed");
+ }
+
ServletInputStream servletInputStream = req.getInputStream();
ExtendedDataInputStream in = new ExtendedDataInputStream(servletInputStream);
@@ -71,12 +76,10 @@ public class Net4jTransportServlet extends HttpServlet implements INet4jTranspor
{
case OPCODE_CONNECT:
handleConnect(in, out);
-
- break;
-
- default:
break;
}
+
+ out.flush();
}
protected void handleConnect(ExtendedDataInputStream in, ExtendedDataOutputStream out) throws ServletException,