Exemplo n.º 1
0
 /**
  * Sets the request whose response is being served through this instance of NettyResponseChannel.
  *
  * @param request the {@link NettyRequest} whose response is being served through this instance of
  *     NettyResponseChannel.
  */
 protected void setRequest(NettyRequest request) {
   if (request != null) {
     if (this.request == null) {
       this.request = request;
       HttpHeaders.setKeepAlive(responseMetadata, request.isKeepAlive());
     } else {
       throw new IllegalStateException(
           "Request has already been set inside NettyResponseChannel for channel {} "
               + ctx.channel());
     }
   } else {
     throw new IllegalArgumentException("RestRequest provided is null");
   }
 }