class XPluginImpl implements Plugin {

    private SocketdRouter socketdRouter;
    private WebSocketRouter webSocketRouter;

    @Override
    public void start(AppContext context) throws Throwable {
        webSocketRouter = WebSocketRouter.getInstance();

        //websocket
        context.lifecycle((() -> {
            //尝试设置 context-path
            if (Utils.isNotEmpty(Solon.cfg().serverContextPath())) {
                webSocketRouter.beforeIfAbsent(new ContextPathWebSocketListener());
            }
        }));

        //socket.d
        if (ClassUtil.hasClass(() -> Listener.class)) {
            socketdRouter = SocketdRouter.getInstance();
        }

        //添加注解处理
        context.beanBuilderAdd(ServerEndpoint.class, this::serverEndpointBuild);
    }

    private void serverEndpointBuild(Class<?> clz, BeanWrap bw, ServerEndpoint anno) {<FILL_FUNCTION_BODY>}
}

        String path = anno.value();
        boolean registered = false;

        //socket.d
        if (ClassUtil.hasClass(() -> Listener.class)) {
            if (bw.raw() instanceof Listener) {
                if (Utils.isEmpty(path)) {
                    path = "**";
                }

                socketdRouter.of(path, bw.raw());
                registered = true;
            }
        }

        //websocket
        if (bw.raw() instanceof WebSocketListener) {
            if (Utils.isEmpty(path)) {
                path = "**";
            }

            webSocketRouter.of(path, bw.raw());
            registered = true;
        }

        if (registered == false) {
            LogUtil.global().warn("@ServerEndpoint does not support type: " + clz.getName());
        }
    
<no_super_class>