void invokeReadReadyCallback(final ClientExchange result) { if(readyCallback != null) { readyCallback.completed(result); readyCallback = null; } } }
void setResponse(ClientResponse response) { this.response = response; if (responseCallback != null) { this.responseCallback.completed(this); } }
void invokeReadReadyCallback() { if(readyCallback != null) { readyCallback.completed(this); readyCallback = null; } } }
void setResponse(ClientResponse response) { this.response = response; if (responseCallback != null) { this.responseCallback.completed(this); } }
@Override public void setResponseListener(ClientCallback<ClientExchange> listener) { this.responseCallback = listener; if (listener != null) { if (failedReason != null) { listener.failed(failedReason); } else if (response != null) { listener.completed(this); } } }
void responseReady(Http2StreamSourceChannel result) { this.response = result; ClientResponse clientResponse = createResponse(result); this.clientResponse = clientResponse; if (responseListener != null) { responseListener.completed(this); } }
@Override public void setResponseListener(ClientCallback<ClientExchange> listener) { this.responseCallback = listener; if (listener != null) { if (failedReason != null) { listener.failed(failedReason); } else if (response != null) { listener.completed(this); } } }
private void handleConnected(final StreamConnection connection, final ClientCallback<ClientConnection> listener, final ByteBufferPool bufferPool, final OptionMap options, URI uri) { boolean h2 = options.get(UndertowOptions.ENABLE_HTTP2, false); if(connection instanceof SslConnection && (h2)) { List<ALPNClientSelector.ALPNProtocol> protocolList = new ArrayList<>(); if(h2) { protocolList.add(Http2ClientProvider.alpnProtocol(listener, uri, bufferPool, options)); } ALPNClientSelector.runAlpn((SslConnection) connection, new ChannelListener<SslConnection>() { @Override public void handleEvent(SslConnection connection) { listener.completed(new HttpClientConnection(connection, options, bufferPool)); } }, listener, protocolList.toArray(new ALPNClientSelector.ALPNProtocol[protocolList.size()])); } else { if(connection instanceof SslConnection) { try { ((SslConnection) connection).startHandshake(); } catch (Throwable t) { listener.failed((t instanceof IOException) ? (IOException) t : new IOException(t)); } } listener.completed(new HttpClientConnection(connection, options, bufferPool)); } } }
return; listener.completed(new Http2ClientConnection(new Http2Channel(connection, null, bufferPool, null, true, false, options), false, defaultHost, clientStatistics, false)); } catch (Throwable t) { IOException e = t instanceof IOException ? (IOException) t : new IOException(t);
@Override public void handleEvent(StreamConnection channel) { final ClientStatisticsImpl clientStatistics; //first we set up statistics, if required if (options.get(UndertowOptions.ENABLE_STATISTICS, false)) { clientStatistics = new ClientStatisticsImpl(); channel.getSinkChannel().setConduit(new BytesSentStreamSinkConduit(channel.getSinkChannel().getConduit(), new ByteActivityCallback() { @Override public void activity(long bytes) { clientStatistics.written += bytes; } })); channel.getSourceChannel().setConduit(new BytesReceivedStreamSourceConduit(channel.getSourceChannel().getConduit(), new ByteActivityCallback() { @Override public void activity(long bytes) { clientStatistics.read += bytes; } })); } else { clientStatistics = null; } Http2Channel http2Channel = new Http2Channel(channel, null, bufferPool, null, true, true, options); Http2ClientConnection http2ClientConnection = new Http2ClientConnection(http2Channel, true, defaultHost, clientStatistics, false); listener.completed(http2ClientConnection); } }
clientCallback.completed(exchange);
private void handleConnected(StreamConnection connection, ClientCallback<ClientConnection> listener, URI uri, XnioSsl ssl, ByteBufferPool bufferPool, OptionMap options) { final ClientStatisticsImpl clientStatistics; //first we set up statistics, if required if (options.get(UndertowOptions.ENABLE_STATISTICS, false)) { clientStatistics = new ClientStatisticsImpl(); connection.getSinkChannel().setConduit(new BytesSentStreamSinkConduit(connection.getSinkChannel().getConduit(), new ByteActivityCallback() { @Override public void activity(long bytes) { clientStatistics.written += bytes; } })); connection.getSourceChannel().setConduit(new BytesReceivedStreamSourceConduit(connection.getSourceChannel().getConduit(), new ByteActivityCallback() { @Override public void activity(long bytes) { clientStatistics.read += bytes; } })); } else { clientStatistics = null; } listener.completed(new AjpClientConnection(new AjpClientChannel(connection, bufferPool, options), options, bufferPool, clientStatistics)); }
void setResponse(ClientResponse response) { this.response = response; if (responseCallback != null) { this.responseCallback.completed(this); } }
void setResponse(ClientResponse response) { this.response = response; if (responseCallback != null) { this.responseCallback.completed(this); } }
void setResponse(ClientResponse response) { this.response = response; if (responseCallback != null) { this.responseCallback.completed(this); } }
void invokeReadReadyCallback(final ClientExchange result) { if(readyCallback != null) { readyCallback.completed(result); readyCallback = null; } } }
void responseReady(Http2StreamSourceChannel result) { this.response = result; ClientResponse clientResponse = createResponse(result); this.clientResponse = clientResponse; if (responseListener != null) { responseListener.completed(this); } }
@Override public void setResponseListener(ClientCallback<ClientExchange> listener) { this.responseCallback = listener; if (listener != null) { if (failedReason != null) { listener.failed(failedReason); } else if (response != null) { listener.completed(this); } } }
@Override public void setResponseListener(ClientCallback<ClientExchange> listener) { this.responseCallback = listener; if (listener != null) { if (failedReason != null) { listener.failed(failedReason); } else if (response != null) { listener.completed(this); } } }
@Override public void setResponseListener(ClientCallback<ClientExchange> listener) { this.responseCallback = listener; if (listener != null) { if (failedReason != null) { listener.failed(failedReason); } else if (response != null) { listener.completed(this); } } }