ProxyFactory$Adaptive

笑着哭i 提交于 2019-12-25 19:11:37

【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>

package com.alibaba.dubbo.rpc;

import com.alibaba.dubbo.common.Node;
import com.alibaba.dubbo.common.URL;
import com.alibaba.dubbo.common.extension.ExtensionLoader;

public class ProxyFactory$Adaptive
  implements ProxyFactory
{
  public Object getProxy(Invoker paramInvoker)
    throws RpcException
  {
    if (paramInvoker == null) {
      throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument == null");
    }
    if (paramInvoker.getUrl() == null) {
      throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument getUrl() == null");
    }
    URL localURL = paramInvoker.getUrl();
    String str = localURL.getParameter("proxy", "javassist");
    if (str == null) {
      throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.ProxyFactory) name from url(" + localURL.toString() + ") use keys([proxy])");
    }
    ProxyFactory localProxyFactory = (ProxyFactory)ExtensionLoader.getExtensionLoader(ProxyFactory.class).getExtension(str);
    return localProxyFactory.getProxy(paramInvoker);
  }
  
  public Object getProxy(Invoker paramInvoker, boolean paramBoolean)
    throws RpcException
  {
    if (paramInvoker == null) {
      throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument == null");
    }
    if (paramInvoker.getUrl() == null) {
      throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument getUrl() == null");
    }
    URL localURL = paramInvoker.getUrl();
    String str = localURL.getParameter("proxy", "javassist");
    if (str == null) {
      throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.ProxyFactory) name from url(" + localURL.toString() + ") use keys([proxy])");
    }
    ProxyFactory localProxyFactory = (ProxyFactory)ExtensionLoader.getExtensionLoader(ProxyFactory.class).getExtension(str);
    return localProxyFactory.getProxy(paramInvoker, paramBoolean);
  }
  
  public Invoker getInvoker(Object paramObject, Class paramClass, URL paramURL)
    throws RpcException
  {
    if (paramURL == null) {
      throw new IllegalArgumentException("url == null");
    }
    URL localURL = paramURL;
    String str = localURL.getParameter("proxy", "javassist");
    if (str == null) {
      throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.ProxyFactory) name from url(" + localURL.toString() + ") use keys([proxy])");
    }
    ProxyFactory localProxyFactory = (ProxyFactory)ExtensionLoader.getExtensionLoader(ProxyFactory.class).getExtension(str);
    return localProxyFactory.getInvoker(paramObject, paramClass, paramURL);
  }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!