final NettyHttpResponse response = new NettyHttpResponse(ctx, keepAlive, dispatcher.getProviderFactory(), request.method());
@Override protected Object decode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception { if (!(msg instanceof org.jboss.netty.handler.codec.http.HttpRequest)) { return msg; } org.jboss.netty.handler.codec.http.HttpRequest request = (org.jboss.netty.handler.codec.http.HttpRequest) msg; boolean keepAlive = org.jboss.netty.handler.codec.http.HttpHeaders.isKeepAlive(request) & isKeepAlive; NettyHttpResponse response = new NettyHttpResponse(channel, keepAlive, request.getMethod()); ResteasyHttpHeaders headers = null; ResteasyUriInfo uriInfo = null; try { headers = NettyUtil.extractHttpHeaders(request); uriInfo = NettyUtil.extractUriInfo(request, servletMappingPrefix, proto); HttpRequest nettyRequest = new NettyHttpRequest(headers, uriInfo, request.getMethod().getName(), dispatcher, response, org.jboss.netty.handler.codec.http.HttpHeaders.is100ContinueExpected(request) ); ChannelBufferInputStream is = new ChannelBufferInputStream(request.getContent()); nettyRequest.setInputStream(is); return nettyRequest; } catch (Exception e) { response.sendError(400); // made it warn so that people can filter this. LogMessages.LOGGER.warn(Messages.MESSAGES.failedToParseRequest(), e); return null; } }
final NettyHttpResponse response = new NettyHttpResponse(ctx, keepAlive, dispatcher.getProviderFactory(), request.method());
NettyHttpResponse nettyResponse = new NettyHttpResponse(event.getChannel(), keepAlive);
boolean keepAlive = org.jboss.netty.handler.codec.http.HttpHeaders.isKeepAlive(request) & isKeepAlive; NettyHttpResponse response = new NettyHttpResponse(channel, keepAlive, request.getMethod());