public void continueConfirmed(final FilterChainContext ctx) throws IOException { delegate.generate(ctx, request, requestPacket); }
@Override public NextAction handleEvent(final FilterChainContext ctx, final FilterChainEvent event) throws IOException { final Object type = event.type(); if (type == ContinueEvent.class) { final ContinueEvent continueEvent = (ContinueEvent) event; continueEvent.getContext().payloadGenerator.continueConfirmed(ctx); } return ctx.getStopAction(); } // ----------------------------------------------------- Private Methods
public static PayloadGenerator getPayloadGenerator(final Request request) { for (final PayloadGenerator h : HANDLERS) { if (h.handlesPayloadType(request)) { return h; } } return null; }
@SuppressWarnings({"unchecked"}) public boolean generate(final FilterChainContext ctx, final Request request, final HttpRequestPacket requestPacket) throws IOException { this.request = request; this.requestPacket = requestPacket; // Set content-length if possible final long contentLength = delegate.getContentLength(request); if (contentLength != -1) { requestPacket.setContentLengthLong(contentLength); } ctx.write(requestPacket, ((!requestPacket.isCommitted()) ? ctx.getTransportContext().getCompletionHandler() : null)); return true; }
@SuppressWarnings({"unchecked"}) public boolean generate(final FilterChainContext ctx, final Request request, final HttpRequestPacket requestPacket) throws IOException { this.request = request; this.requestPacket = requestPacket; // Set content-length if possible final long contentLength = delegate.getContentLength(request); if (contentLength != -1) { requestPacket.setContentLengthLong(contentLength); } ctx.write(requestPacket, ((!requestPacket.isCommitted()) ? ctx.getTransportContext().getCompletionHandler() : null)); return true; }
LOGGER.debug("REQUEST: " + requestPacket.toString()); isWriteComplete = payloadGenerator.generate(ctx, request, requestPacket); } else { if (LOGGER.isDebugEnabled()) {
public boolean handlesPayloadType(Request request) { return delegate.handlesPayloadType(request); }
@Override public NextAction handleEvent(final FilterChainContext ctx, final FilterChainEvent event) throws IOException { final Object type = event.type(); if (type == ContinueEvent.class) { final ContinueEvent continueEvent = (ContinueEvent) event; continueEvent.getContext().payloadGenerator.continueConfirmed(ctx); } return ctx.getStopAction(); } // ----------------------------------------------------- Private Methods
@SuppressWarnings({"unchecked"}) public boolean generate(final FilterChainContext ctx, final Request request, final HttpRequestPacket requestPacket) throws IOException { this.request = request; this.requestPacket = requestPacket; // Set content-length if possible final long contentLength = delegate.getContentLength(request); if (contentLength != -1) { requestPacket.setContentLengthLong(contentLength); } ctx.write(requestPacket, ((!requestPacket.isCommitted()) ? ctx.getTransportContext().getCompletionHandler() : null)); return true; }
public void continueConfirmed(final FilterChainContext ctx) throws IOException { delegate.generate(ctx, request, requestPacket); }
public static PayloadGenerator getPayloadGenerator(final Request request) { for (final PayloadGenerator h : HANDLERS) { if (h.handlesPayloadType(request)) { return h; } } return null; }
@Override public NextAction handleEvent(final FilterChainContext ctx, final FilterChainEvent event) throws IOException { final Object type = event.type(); if (type == ContinueEvent.class) { final ContinueEvent continueEvent = (ContinueEvent) event; continueEvent.getContext().payloadGenerator.continueConfirmed(ctx); } return ctx.getStopAction(); } // ----------------------------------------------------- Private Methods
public void continueConfirmed(final FilterChainContext ctx) throws IOException { delegate.generate(ctx, request, requestPacket); }
public static PayloadGenerator getPayloadGenerator(final Request request) { for (final PayloadGenerator h : HANDLERS) { if (h.handlesPayloadType(request)) { return h; } } return null; }
@Test public void testBodyIsClosed() throws Exception { getPayloadGenerator(request).generate(context, request, requestPacket); verify(body).close(); }
public boolean handlesPayloadType(Request request) { return delegate.handlesPayloadType(request); }
LOGGER.debug("REQUEST: " + requestPacket.toString()); isWriteComplete = payloadGenerator.generate(ctx, request, requestPacket); } else { if (LOGGER.isDebugEnabled()) {
public boolean handlesPayloadType(Request request) { return delegate.handlesPayloadType(request); }
LOGGER.debug("REQUEST: " + requestPacket.toString()); isWriteComplete = payloadGenerator.generate(ctx, request, requestPacket); } else { if (LOGGER.isDebugEnabled()) {