summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-05-26 17:09:16 (EDT)
committerEike Stepper2008-05-26 17:09:16 (EDT)
commit613285042019849fde0a0e3b5fd19e126a174199 (patch)
tree60a3ad48e3c56960eddf580f17546273271deb29
parentc20f2eb5a813419d58c32869be33567ee1068100 (diff)
downloadcdo-613285042019849fde0a0e3b5fd19e126a174199.zip
cdo-613285042019849fde0a0e3b5fd19e126a174199.tar.gz
cdo-613285042019849fde0a0e3b5fd19e126a174199.tar.bz2
[232648] Provide an HTTPConnector
https://bugs.eclipse.org/bugs/show_bug.cgi?id=232648
-rw-r--r--plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPChannel.java12
-rw-r--r--plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPConnector.java11
2 files changed, 21 insertions, 2 deletions
diff --git a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPChannel.java b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPChannel.java
index 6e5d205..804d642 100644
--- a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPChannel.java
+++ b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPChannel.java
@@ -31,6 +31,8 @@ public class HTTPChannel extends Channel
private CountDownLatch openAck = new CountDownLatch(1);
+ private boolean inverseRemoved;
+
public HTTPChannel()
{
}
@@ -81,6 +83,16 @@ public class HTTPChannel extends Channel
}
}
+ public boolean isInverseRemoved()
+ {
+ return inverseRemoved;
+ }
+
+ public void setInverseRemoved()
+ {
+ inverseRemoved = true;
+ }
+
@Override
protected void doDeactivate() throws Exception
{
diff --git a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPConnector.java b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPConnector.java
index c470916..71ed9bc 100644
--- a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPConnector.java
+++ b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPConnector.java
@@ -198,8 +198,13 @@ public abstract class HTTPConnector extends Connector implements IHTTPConnector
{
if (super.removeChannel(channel))
{
- ChannelOperation operation = new CloseChannelOperation((HTTPChannel)channel);
- outputOperations.add(operation);
+ HTTPChannel httpChannel = (HTTPChannel)channel;
+ if (!httpChannel.isInverseRemoved())
+ {
+ ChannelOperation operation = new CloseChannelOperation(httpChannel);
+ outputOperations.add(operation);
+ }
+
return true;
}
@@ -455,6 +460,8 @@ public abstract class HTTPConnector extends Connector implements IHTTPConnector
@Override
public void doEexecute(HTTPChannel channel)
{
+ // TODO Fix protocol between Channel.close and Connector.removeChannel/inverserRemoveChannel
+ channel.setInverseRemoved();
inverseRemoveChannel(channel.getChannelID(), channel.getChannelIndex());
}
}