class YarMessageRouter extends ProviderMessageRouter {
    protected ConcurrentHashMap<String, Provider<?>> providerMap = new ConcurrentHashMap<String, Provider<?>>();

    public YarMessageRouter() {
        super();
    }

    public YarMessageRouter(URL url) {
        super(url);
    }

    @Override
    public Object handle(Channel channel, Object message) {<FILL_FUNCTION_BODY>}

    @Override
    public void addProvider(Provider<?> provider) {
        String path = YarProtocolUtil.getYarPath(provider.getInterface(), provider.getUrl());
        Provider<?> old = providerMap.putIfAbsent(path, provider);
        if (old != null) {
            throw new MotanFrameworkException("duplicate yar provider");
        }
    }

    @Override
    public void removeProvider(Provider<?> provider) {
        String path = YarProtocolUtil.getYarPath(provider.getInterface(), provider.getUrl());
        providerMap.remove(path);
    }

}

        YarRequest yarRequest = (YarRequest) message;

        String packagerName = yarRequest.getPackagerName();
        Provider<?> provider = providerMap.get(yarRequest.getRequestPath());
        if (provider == null) {
            throw new MotanServiceException("can not find service provider. request path:" + yarRequest.getRequestPath());
        }
        Class<?> clazz = provider.getInterface();
        Request request = YarProtocolUtil.convert(yarRequest, clazz);
        Response response = call(request, provider);
        YarResponse yarResponse = YarProtocolUtil.convert(response, packagerName);
        return yarResponse;
    
<methods>public void <init>() ,public void <init>(com.weibo.api.motan.rpc.URL) ,public void <init>(Provider<?>) ,public synchronized void addProvider(Provider<?>) ,public int getPublicMethodCount() ,public Map<java.lang.String,java.lang.Object> getRuntimeInfo() ,public java.lang.Object handle(com.weibo.api.motan.transport.Channel, java.lang.Object) ,public synchronized void removeProvider(Provider<?>) <variables>private static final boolean STRICT_CHECK_GROUP,protected Map<java.lang.String,Provider<?>> frameworkProviders,protected java.util.concurrent.atomic.AtomicInteger methodCounter,protected Map<java.lang.String,Provider<?>> providers,protected com.weibo.api.motan.transport.ProviderProtectedStrategy strategy