@Override protected void onHttpHeadersEncoded(final HttpHeader httpHeader, final FilterChainContext ctx) { final HttpTransactionContext context = HttpTransactionContext.currentTransaction(httpHeader); final AsyncHandler handler = context.getAsyncHandler(); if (handler instanceof TransferCompletionHandler) { ((TransferCompletionHandler) handler).onHeaderWriteCompleted(); } }
@Override public void updated(WriteResult result) { final AsyncHandler ah = context.getAsyncHandler(); if (ah instanceof TransferCompletionHandler) { final long written = result.getWrittenSize(); context.totalBodyWritten += written; final long total = context.totalBodyWritten; ((TransferCompletionHandler) ah).onContentWriteProgress( written, total, requestPacket.getContentLength()); } } });
@Override protected void onHttpContentParsed(final HttpContent content, final FilterChainContext ctx) { final HttpTransactionContext context = HttpTransactionContext.currentTransaction(content.getHttpHeader()); final AsyncHandler handler = context.getAsyncHandler(); if (handler != null && context.currentState != AsyncHandler.STATE.ABORT) { try { context.currentState = handler.onBodyPartReceived( new GrizzlyResponseBodyPart(content, ctx.getConnection())); } catch (Exception e) { handler.onThrowable(e); } } }
@Override protected void onHttpContentEncoded(final HttpContent content, final FilterChainContext ctx) { final HttpTransactionContext context = HttpTransactionContext.currentTransaction(content.getHttpHeader()); final AsyncHandler handler = context.getAsyncHandler(); if (handler instanceof TransferCompletionHandler) { final int written = content.getContent().remaining(); context.totalBodyWritten += written; final long total = context.totalBodyWritten; ((TransferCompletionHandler) handler).onContentWriteProgress( written, total, content.getHttpHeader().getContentLength()); } }
final AsyncHandler h = httpTxCtx.getAsyncHandler();
final AsyncHandler handler = context.getAsyncHandler(); if (handler != null) { context.currentState = handler.onStatusReceived(responseStatus);
final AsyncHandler handler = context.getAsyncHandler(); final List<ResponseFilter> filters = provider.getClientConfig().getResponseFilters(); ws.onConnect(); WebSocketHolder.set(ctx.getConnection(), context.protocolHandler, ws); ((WebSocketUpgradeHandler) context.getAsyncHandler()).onSuccess(context.webSocket); final int wsTimeout = provider.getClientConfig().getWebSocketTimeout(); IdleTimeoutFilter.setCustomTimeout(ctx.getConnection(), } else { httpHeader.setSkipRemainder(true); ((WebSocketUpgradeHandler) context.getAsyncHandler()).onClose( context.webSocket, 1002, "WebSocket protocol error: unexpected HTTP response status during handshake.");
@Override protected void onHttpHeadersEncoded(final HttpHeader httpHeader, final FilterChainContext ctx) { final HttpTransactionContext context = HttpTransactionContext.currentTransaction(httpHeader); final AsyncHandler handler = context.getAsyncHandler(); if (handler instanceof TransferCompletionHandler) { ((TransferCompletionHandler) handler).onHeaderWriteCompleted(); } }
final AsyncHandler ah = httpTransactionContext.getAsyncHandler();
@Override protected void onHttpHeadersEncoded(final HttpHeader httpHeader, final FilterChainContext ctx) { final HttpTransactionContext context = HttpTransactionContext.currentTransaction(httpHeader); final AsyncHandler handler = context.getAsyncHandler(); if (handler instanceof TransferCompletionHandler) { ((TransferCompletionHandler) handler).onHeaderWriteCompleted(); } }
final AsyncHandler handler = context.getAsyncHandler(); if (handler != null) { try {
final AsyncHandler ah = httpTransactionContext.getAsyncHandler();
if (isUpgradeRequest(httpTxCtx.getAsyncHandler()) && isWSRequest(httpTxCtx.requestUri)) { httpTxCtx.isWSRequest = true;
@Override public void updated(WriteResult result) { final AsyncHandler ah = context.getAsyncHandler(); if (ah instanceof TransferCompletionHandler) { final long written = result.getWrittenSize(); context.totalBodyWritten += written; final long total = context.totalBodyWritten; ((TransferCompletionHandler) ah).onContentWriteProgress( written, total, requestPacket.getContentLength()); } } });
@Override public void updated(WriteResult result) { final AsyncHandler ah = context.getAsyncHandler(); if (ah instanceof TransferCompletionHandler) { final long written = result.getWrittenSize(); context.totalBodyWritten += written; final long total = context.totalBodyWritten; ((TransferCompletionHandler) ah).onContentWriteProgress( written, total, requestPacket.getContentLength()); } } });
@Override protected void onHttpContentParsed(final HttpContent content, final FilterChainContext ctx) { final HttpTransactionContext context = HttpTransactionContext.currentTransaction(content.getHttpHeader()); final AsyncHandler handler = context.getAsyncHandler(); if (handler != null && context.currentState != AsyncHandler.STATE.ABORT) { try { context.currentState = handler.onBodyPartReceived( new GrizzlyResponseBodyPart(content, ctx.getConnection())); } catch (Exception e) { handler.onThrowable(e); } } }
@Override protected void onHttpContentParsed(final HttpContent content, final FilterChainContext ctx) { final HttpTransactionContext context = HttpTransactionContext.currentTransaction(content.getHttpHeader()); final AsyncHandler handler = context.getAsyncHandler(); if (handler != null && context.currentState != AsyncHandler.STATE.ABORT) { try { context.currentState = handler.onBodyPartReceived( new GrizzlyResponseBodyPart(content, ctx.getConnection())); } catch (Exception e) { handler.onThrowable(e); } } }
@Override protected void onHttpContentEncoded(final HttpContent content, final FilterChainContext ctx) { final HttpTransactionContext context = HttpTransactionContext.currentTransaction(content.getHttpHeader()); final AsyncHandler handler = context.getAsyncHandler(); if (handler instanceof TransferCompletionHandler) { final int written = content.getContent().remaining(); context.totalBodyWritten += written; final long total = context.totalBodyWritten; ((TransferCompletionHandler) handler).onContentWriteProgress( written, total, content.getHttpHeader().getContentLength()); } }
@Override protected void onHttpContentEncoded(final HttpContent content, final FilterChainContext ctx) { final HttpTransactionContext context = HttpTransactionContext.currentTransaction(content.getHttpHeader()); final AsyncHandler handler = context.getAsyncHandler(); if (handler instanceof TransferCompletionHandler) { final int written = content.getContent().remaining(); context.totalBodyWritten += written; final long total = context.totalBodyWritten; ((TransferCompletionHandler) handler).onContentWriteProgress( written, total, content.getHttpHeader().getContentLength()); } }
final AsyncHandler h = httpTxCtx.getAsyncHandler();