protected Runnable doExport()

in src/main/java/com/qianmi/dubbo/rpc/protocol/jsonrpc/JsonRpcProtocol.java [88:103]


    protected <T> Runnable doExport(T impl, Class<T> type, URL url) throws RpcException {
        String addr = url.getIp() + ":" + url.getPort();
        HttpServer server = serverMap.get(addr);
        if (server == null) {
            server = httpBinder.bind(url, new InternalHandler(url.getParameter("cors", false)));
            serverMap.put(addr, server);
        }
        final String path = url.getAbsolutePath();
        JsonRpcServer skeleton = new JsonRpcServer(impl, type);
        skeletonMap.put(path, skeleton);
        return new Runnable() {
            public void run() {
                skeletonMap.remove(path);
            }
        };
    }