Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Becker2013-07-12 07:57:31 +0000
committerThomas Becker2013-07-12 07:57:31 +0000
commit64f4ad3b11c2f8e7c172afa9093ecd0e2c82e5d1 (patch)
treecbe7d92f61fe7b43d3ad7db90eab4615e282586f /jetty-spdy/spdy-client/src
parent891a2c2b36f40fb21e8566fbb9f6bfcf309e67fa (diff)
downloadorg.eclipse.jetty.project-64f4ad3b11c2f8e7c172afa9093ecd0e2c82e5d1.tar.gz
org.eclipse.jetty.project-64f4ad3b11c2f8e7c172afa9093ecd0e2c82e5d1.tar.xz
org.eclipse.jetty.project-64f4ad3b11c2f8e7c172afa9093ecd0e2c82e5d1.zip
Fix SPDYClient refactoring. Wrap FuturePromise<Session> in SessionPromise
Diffstat (limited to 'jetty-spdy/spdy-client/src')
-rw-r--r--jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYClient.java21
1 files changed, 19 insertions, 2 deletions
diff --git a/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYClient.java b/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYClient.java
index c866449dbb..364db9cad6 100644
--- a/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYClient.java
+++ b/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYClient.java
@@ -145,7 +145,7 @@ public class SPDYClient
channel.socket().setTcpNoDelay(true);
channel.configureBlocking(false);
- SessionPromise result = new SessionPromise(channel, this, listener);
+ SessionPromise result = new SessionPromise(promise, channel, this, listener);
channel.connect(address);
factory.selector.connect(channel, result);
@@ -390,14 +390,31 @@ public class SPDYClient
static class SessionPromise extends FuturePromise<Session>
{
private final SocketChannel channel;
+ private final Promise wrappedPromise;
final SPDYClient client;
final SessionFrameListener listener;
- private SessionPromise(SocketChannel channel, SPDYClient client, SessionFrameListener listener)
+ private SessionPromise(Promise<Session> promise, SocketChannel channel, SPDYClient client,
+ SessionFrameListener listener)
{
this.channel = channel;
this.client = client;
this.listener = listener;
+ this.wrappedPromise = promise;
+ }
+
+ @Override
+ public void succeeded(Session result)
+ {
+ wrappedPromise.succeeded(result);
+ super.succeeded(result);
+ }
+
+ @Override
+ public void failed(Throwable cause)
+ {
+ wrappedPromise.failed(cause);
+ super.failed(cause);
}
@Override

Back to the top