模块 org.redkale
程序包 org.redkale.net

类 Response<C extends Context,​R extends Request<C>>

  • 类型参数:
    C - Context的子类型
    R - Request的子类型
    直接已知子类:
    HttpResponse, SncpResponse

    public abstract class Response<C extends Context,​R extends Request<C>>
    extends Object
    协议响应对象

    详情见: https://redkale.org

    作者:
    zhangjx
    • 构造器详细资料

      • Response

        protected Response​(C context,
                           R request)
    • 方法详细资料

      • prepare

        protected void prepare()
      • recycle

        protected boolean recycle()
      • updateNonBlocking

        protected void updateNonBlocking​(boolean nonBlocking)
      • inNonBlocking

        protected boolean inNonBlocking()
      • refuseAlive

        protected void refuseAlive()
      • thenEvent

        protected void thenEvent​(Servlet servlet)
      • addAfterFinishListener

        public void addAfterFinishListener​(Runnable listener)
      • getOutput

        public Object getOutput()
      • isClosed

        public boolean isClosed()
        是否已关闭
        返回:
        boolean
      • finishError

        public final void finishError​(Throwable t)
        Servlet.execute执行时报错

        被重载后kill不一定为true

        参数:
        t - Throwable
      • defaultError

        protected void defaultError​(Throwable t)
      • codecError

        protected void codecError​(Throwable t)
        对请求包进行编解码时报错, 非Servlet.execute执行报错
        参数:
        t - Throwable
      • completeFinishBytes

        protected void completeFinishBytes​(Integer result,
                                           Void attachment)
      • finish

        public final void finish​(byte[] bs)
      • finish

        public final void finish​(byte[] bs,
                                 int offset,
                                 int length)
      • finish

        public final void finish​(ByteTuple array)
      • finish

        public final void finish​(boolean kill,
                                 byte[] bs)
      • finish

        public final void finish​(boolean kill,
                                 ByteTuple array)
      • finish

        public void finish​(boolean kill,
                           byte[] bs,
                           int offset,
                           int length)
      • finish

        public void finish​(boolean kill,
                           byte[] bs1,
                           int offset1,
                           int length1,
                           byte[] bs2,
                           int offset2,
                           int length2)
      • finishBuffers

        protected void finishBuffers​(boolean kill,
                                     ByteBuffer... buffers)
      • finishBuffer

        protected final void finishBuffer​(ByteBuffer buffer)
      • finishBuffers

        protected final void finishBuffers​(ByteBuffer... buffers)
      • finishBuffer

        protected void finishBuffer​(boolean kill,
                                    ByteBuffer buffer)
      • getContext

        public C getContext()