class DefaultRpcExporter<T> extends AbstractExporter<T> {

    protected final ConcurrentHashMap<String, ProviderMessageRouter> ipPort2RequestRouter;
    protected final ConcurrentHashMap<String, Exporter<?>> exporterMap;
    protected Server server;
    protected EndpointFactory endpointFactory;

    public DefaultRpcExporter(Provider<T> provider, URL url, ConcurrentHashMap<String, ProviderMessageRouter> ipPort2RequestRouter,
                              ConcurrentHashMap<String, Exporter<?>> exporterMap) {
        super(provider, url);
        this.exporterMap = exporterMap;
        this.ipPort2RequestRouter = ipPort2RequestRouter;

        ProviderMessageRouter requestRouter = initRequestRouter(url);
        endpointFactory =
                ExtensionLoader.getExtensionLoader(EndpointFactory.class).getExtension(
                        url.getParameter(URLParamType.endpointFactory.getName(), URLParamType.endpointFactory.getValue()));
        server = endpointFactory.createServer(url, requestRouter);
    }

    @SuppressWarnings("unchecked")
    @Override
    public void unexport() {<FILL_FUNCTION_BODY>}

    @Override
    protected boolean doInit() {
        boolean result = server.open();
        if (result && getUrl().getPort() == 0) { // use random port
            ProviderMessageRouter requestRouter = this.ipPort2RequestRouter.remove(getUrl().getServerPortStr());
            if (requestRouter == null) {
                throw new MotanFrameworkException("can not find message router. url:" + getUrl().getIdentity());
            }
            updateRealServerPort(server.getLocalAddress().getPort());
            ProviderMessageRouter oldRouter = this.ipPort2RequestRouter.get(getUrl().getServerPortStr());
            if (oldRouter != null) {
                oldRouter.addProvider(provider);
            } else {
                this.ipPort2RequestRouter.put(getUrl().getServerPortStr(), requestRouter);
            }
        }
        return result;
    }

    @Override
    public boolean isAvailable() {
        return server.isAvailable();
    }

    @Override
    public void destroy() {
        endpointFactory.safeReleaseResource(server, url);
        LoggerUtil.info("DefaultRpcExporter destroy Success: url={}", url);
    }

    protected ProviderMessageRouter initRequestRouter(URL url) {
        String ipPort = url.getServerPortStr();
        ProviderMessageRouter requestRouter = ipPort2RequestRouter.get(ipPort);

        if (requestRouter == null) {
            ProviderMessageRouter router = new ProviderMessageRouter(url);
            ipPort2RequestRouter.putIfAbsent(ipPort, router);
            requestRouter = ipPort2RequestRouter.get(ipPort);
        }
        requestRouter.addProvider(provider);

        return requestRouter;
    }
}

        String protocolKey = MotanFrameworkUtil.getProtocolKey(url);
        String ipPort = url.getServerPortStr();

        Exporter<T> exporter = (Exporter<T>) exporterMap.remove(protocolKey);
        if (exporter != null) {
            exporter.destroy();
        }

        ProviderMessageRouter requestRouter = ipPort2RequestRouter.get(ipPort);
        if (requestRouter != null) {
            requestRouter.removeProvider(provider);
        }

        LoggerUtil.info("DefaultRpcExporter unexport Success: url={}", url);
    
<methods>public void <init>(Provider<T>, com.weibo.api.motan.rpc.URL) ,public java.lang.String desc() ,public Provider<T> getProvider() ,public Map<java.lang.String,java.lang.Object> getRuntimeInfo() <variables>protected Provider<T> provider