Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-07-25 09:04:28 +0000
committerEike Stepper2008-07-25 09:04:28 +0000
commitb1611bf83d76f370507bed18e24890d074730018 (patch)
treefca19b6148da7ceee88f0c4a4a3de794b4e0b7b7 /plugins/org.eclipse.net4j.http.common/src
parenta794a6abf0151fb09232ca30c593f26044dc7d93 (diff)
downloadcdo-b1611bf83d76f370507bed18e24890d074730018.tar.gz
cdo-b1611bf83d76f370507bed18e24890d074730018.tar.xz
cdo-b1611bf83d76f370507bed18e24890d074730018.zip
[241463] Make timeout in Connector.openChannel(IProtocol protocol) configurablecommitters/estepper/pop-20080726
https://bugs.eclipse.org/bugs/show_bug.cgi?id=241463
Diffstat (limited to 'plugins/org.eclipse.net4j.http.common/src')
-rw-r--r--plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPChannel.java5
-rw-r--r--plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java6
2 files changed, 6 insertions, 5 deletions
diff --git a/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPChannel.java b/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPChannel.java
index 1ade346795..93530788ce 100644
--- a/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPChannel.java
+++ b/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPChannel.java
@@ -17,6 +17,7 @@ import org.eclipse.internal.net4j.channel.Channel;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
/**
* @author Eike Stepper
@@ -72,11 +73,11 @@ public class HTTPChannel extends Channel
openAck.countDown();
}
- public void waitForOpenAck()
+ public void waitForOpenAck(long timeout)
{
try
{
- openAck.await();
+ openAck.await(timeout, TimeUnit.MILLISECONDS);
}
catch (InterruptedException ignore)
{
diff --git a/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java b/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java
index 8e1527762a..2a4d59a329 100644
--- a/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java
+++ b/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java
@@ -189,14 +189,14 @@ public abstract class HTTPConnector extends Connector implements IHTTPConnector
}
@Override
- protected void registerChannelWithPeer(final int channelID, final short channelIndex, final IProtocol protocol)
- throws ConnectorException
+ protected void registerChannelWithPeer(final int channelID, final short channelIndex, final IProtocol protocol,
+ long timeout) throws ConnectorException
{
ChannelOperation operation = new OpenChannelOperation(channelIndex, channelID, protocol.getType());
outputOperations.add(operation);
HTTPChannel channel = (HTTPChannel)getChannel(channelIndex);
- channel.waitForOpenAck();
+ channel.waitForOpenAck(timeout);
}
@Override

Back to the top