Add a overridable method 'onClose' in HttpClientTransportOverHTTP2.

- able to look GoAwayFrame through 'onClose' method.

Signed-off-by: Jinho Shin <drdoteam@gmail.com>
This commit is contained in:
Jinho Shin 2016-03-05 12:51:25 +09:00
parent 6808953561
commit 3facfb6066
1 changed files with 5 additions and 1 deletions

View File

@ -137,6 +137,10 @@ public class HttpClientTransportOverHTTP2 extends ContainerLifeCycle implements
return new HttpConnectionOverHTTP2(destination, session); return new HttpConnectionOverHTTP2(destination, session);
} }
protected void onClose(HttpConnectionOverHTTP2 connection, GoAwayFrame frame) {
connection.close();
}
private class SessionListenerPromise extends Session.Listener.Adapter implements Promise<Session> private class SessionListenerPromise extends Session.Listener.Adapter implements Promise<Session>
{ {
private final HttpDestinationOverHTTP2 destination; private final HttpDestinationOverHTTP2 destination;
@ -181,7 +185,7 @@ public class HttpClientTransportOverHTTP2 extends ContainerLifeCycle implements
@Override @Override
public void onClose(Session session, GoAwayFrame frame) public void onClose(Session session, GoAwayFrame frame)
{ {
connection.close(); HttpClientTransportOverHTTP2.this.onClose(connection, frame);
} }
@Override @Override