1 个回答
  • 17

这是ChannelHandler里的代码

public interface ChannelHandler {
    void handlerAdded(ChannelHandlerContext var1) throws Exception;

    void handlerRemoved(ChannelHandlerContext var1) throws Exception;

    /** @deprecated */
    @Deprecated
    void exceptionCaught(ChannelHandlerContext var1, Throwable var2) throws Exception;

    @Inherited
    @Documented
    @Target({ElementType.TYPE})
    @Retention(RetentionPolicy.RUNTIME)
    public @interface Sharable {
    }
}

@Sharable是属于接口ChannelHandler的,你应该使用@ChannelHandler.Sharable

    撰写回答

    登录后参与交流、获取后续更新提醒