class YarExporter<T> extends AbstractExporter<T> {
    protected Server server;
    private YarRpcProtocol yarProtocol;

    public YarExporter(URL url, Provider<T> provider, YarRpcProtocol yarProtocol) {
        super(provider, url);
        EndpointFactory endpointFactory =
                ExtensionLoader.getExtensionLoader(EndpointFactory.class).getExtension(
                        url.getParameter(URLParamType.endpointFactory.getName(), "netty4yar"));
        // set noheartbeat factory
        String heartbeatFactory = url.getParameter(URLParamType.heartbeatFactory.getName());
        if (heartbeatFactory == null) {
            url.addParameter(URLParamType.heartbeatFactory.getName(), "noHeartbeat");
        }
        // FIXME to avoid parameters ambiguous in weak type language，parameters size of method with
        // same name must be different.
        validateInterface(provider.getInterface());
        server = endpointFactory.createServer(url, yarProtocol.initRequestRouter(url, provider));

    }


    @Override
    public void destroy() {
        server.close();
    }

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

    @Override
    public void unexport() {
        yarProtocol.unexport(url, provider);
    }

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

    protected void validateInterface(Class<?> interfaceClazz) {<FILL_FUNCTION_BODY>}

}

        HashMap<String, List<Integer>> tempMap = new HashMap<String, List<Integer>>();
        for (Method m : interfaceClazz.getDeclaredMethods()) {
            if (!tempMap.containsKey(m.getName())) {
                List<Integer> templist = new ArrayList<Integer>();
                templist.add(m.getParameterTypes().length);
                tempMap.put(m.getName(), templist);
            } else {
                List<Integer> templist = tempMap.get(m.getName());
                if (templist.contains(m.getParameterTypes().length)) {
                    throw new MotanFrameworkException("in yar protocol, methods with same name must have different params size !");
                } else {
                    templist.add(m.getParameterTypes().length);
                }
            }
        }
    
<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