class DefaultRpcReferer<T> extends AbstractReferer<T> {
    protected Client client;
    protected EndpointFactory endpointFactory;

    public DefaultRpcReferer(Class<T> clz, URL url, URL serviceUrl) {
        super(clz, url, serviceUrl);

        endpointFactory =
                ExtensionLoader.getExtensionLoader(EndpointFactory.class).getExtension(
                        url.getParameter(URLParamType.endpointFactory.getName(), URLParamType.endpointFactory.getValue()));

        client = endpointFactory.createClient(url);
    }

    @Override
    protected Response doCall(Request request) {
        try {
            // 为了能够实现跨group请求，需要使用server端的group。
            request.setAttachment(URLParamType.group.getName(), serviceUrl.getGroup());
            return client.request(request);
        } catch (TransportException exception) {
            throw new MotanServiceException("DefaultRpcReferer call Error: url=" + url.getUri(), exception);
        }
    }

    @Override
    protected void decrActiveCount(Request request, Response response) {<FILL_FUNCTION_BODY>}

    @Override
    protected boolean doInit() {
        return client.open();
    }

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

    @Override
    public void destroy() {
        endpointFactory.safeReleaseResource(client, url);
        LoggerUtil.info("DefaultRpcReferer destroy client: url={}" + url);
    }

    @Override
    public Map<String, Object> getRuntimeInfo() {
        Map<String, Object> infos = super.getRuntimeInfo();
        infos.putAll(client.getRuntimeInfo());
        return infos;
    }
}

        if (!(response instanceof Future)) {
            activeRefererCount.decrementAndGet();
            return;
        }

        Future future = (Future) response;

        future.addListener(future1 -> activeRefererCount.decrementAndGet());
    
<methods>public void <init>(Class<T>, com.weibo.api.motan.rpc.URL) ,public void <init>(Class<T>, com.weibo.api.motan.rpc.URL, com.weibo.api.motan.rpc.URL) ,public int activeRefererCount() ,public com.weibo.api.motan.rpc.Response call(com.weibo.api.motan.rpc.Request) ,public java.lang.String desc() ,public Class<T> getInterface() ,public Map<java.lang.String,java.lang.Object> getRuntimeInfo() ,public com.weibo.api.motan.rpc.URL getServiceUrl() <variables>protected java.util.concurrent.atomic.AtomicInteger activeRefererCount,protected Class<T> clz,protected com.weibo.api.motan.rpc.URL serviceUrl