0

图片描述

2019-04-10 提问
1 个回答
0

已采纳

这是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

撰写答案

推广链接